Reset chapters numbering settings
This commit is contained in:
parent
857267ba75
commit
87fcbbbdef
4 changed files with 53 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark72
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark73
|
||||
|
||||
End Sub
|
||||
|
||||
|
@ -40,6 +40,7 @@ Private Sub makerUpMenu
|
|||
dialog.getControl("loadStandardStyles").Label = getTranslation("advancedMenuLoadStandardStyles")
|
||||
dialog.getControl("removeManualPageBreaks").Label = getTranslation("advancedMenuRemoveManualPageBreaks")
|
||||
dialog.getControl("removeBasic").Label = getTranslation("advancedMenuRemoveBasic")
|
||||
dialog.getControl("resetChapterNumberingRules").Label = getTranslation("advancedMenuResetChapterNumberingRules")
|
||||
dialog.getControl("Cancel").Label = getTranslation("buttonCancel")
|
||||
dialog.getControl("OK").Label = getTranslation("buttonOK")
|
||||
dialog.getControl("buttonLoad").Label = getTranslation("buttonLoad")
|
||||
|
@ -133,6 +134,9 @@ Private Sub cleanAccordingTo(dialog As Object)
|
|||
If dialog.getControl("removeBasic").state = 1 Then
|
||||
removeLibs
|
||||
EndIf
|
||||
If dialog.getControl("resetChapterNumberingRules").state = 1 Then
|
||||
resetChapterNumberingRules
|
||||
EndIf
|
||||
|
||||
statusIndicator.end()
|
||||
saveAndreload()
|
||||
|
@ -193,6 +197,7 @@ Private Sub quietCleaning
|
|||
statusIndicator.Start(getTranslation("statusLoadingStylesFromTemplate"),100)
|
||||
loadArticleStyles
|
||||
removeLibs
|
||||
resetChapterNumberingRules
|
||||
addTimeStampToProperties
|
||||
saveCleanedVersion("Standard cleaning")
|
||||
statusIndicator.end()
|
||||
|
@ -1856,5 +1861,31 @@ sub saveCleanedVersion(comment)
|
|||
args1(0).Name = "VersionComment"
|
||||
args1(0).Value = comment
|
||||
dispatcher.executeDispatch(document, ".uno:Save", "", 0, args1())
|
||||
end sub
|
||||
end Sub
|
||||
|
||||
Sub resetChapterNumberingRules
|
||||
Dim chapNumRules As Object
|
||||
Dim numRulesProps As Variant
|
||||
Dim numRuleProperty As Variant
|
||||
Dim i As Integer
|
||||
chapNumRules = ThisComponent.ChapterNumberingRules
|
||||
For i = 0 To chapNumRules.Count - 1
|
||||
numRulesProps = chapNumRules.getByIndex(i)
|
||||
For n = LBound(numRulesProps) To UBound(numRulesProps)
|
||||
numRuleProperty = numRulesProps(n)
|
||||
If (numRuleProperty.Name = "Prefix") Then
|
||||
numRuleProperty.Value = ""
|
||||
End If
|
||||
If (numRuleProperty.Name = "Suffix") Then
|
||||
numRuleProperty.Value = ""
|
||||
End If
|
||||
If (numRuleProperty.Name = "CharStyleName") Then
|
||||
numRuleProperty.Value = "None"
|
||||
End If
|
||||
numRulesProps(n) = numRuleProperty
|
||||
Next n
|
||||
chapNumRules.replaceByIndex(i,numRulesProps)
|
||||
Next i
|
||||
End Sub
|
||||
|
||||
</script:module>
|
Loading…
Add table
Add a link
Reference in a new issue