Remove user defined page styles on cleaning

This commit is contained in:
Georgy Litvinov 2019-11-05 00:40:28 +03:00
parent 874cbea922
commit 0d8e96286f
2 changed files with 21 additions and 3 deletions

View file

@ -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 markXXFXK
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub markXXFXKY
End Sub
@ -23,6 +23,7 @@ Sub cleanButton
fixTableWidth
fixDrawingAnchors
fixFrequentMistakes
removeUserPageStyles
loadArticleStyles
statusIndicator.end()
saveAndreload()
@ -102,6 +103,23 @@ Private Sub convertFontsToCharStyles
loop
End Sub
Private Sub removeUserPageStyles
Dim oStyles As Object
Dim oStyle As Object
oStyles = ThisComponent.StyleFamilies.getByName(&quot;PageStyles&quot;)
Dim count As Long
count = oStyles.count - 1
For i = 0 to count
oStyle = oStyles.getByIndex(i)
If oStyle.isUserDefined Then
oStyles.removeByName(oStyle.getName)
count = oStyles.count - 1
&apos;restart if style removed as sorting is unreliable
i = -1
EndIf
Next i
End Sub
Private Sub fixFrequentMistakes
Dim NBSP As String
Dim space As String
@ -854,4 +872,4 @@ Private Function getStyleNames(oFamily,bLocalized as Boolean, _
Endif
xArray(iUB) = vNextElement
End Sub
</script:module>
</script:module>

View file

@ -3,7 +3,7 @@
xmlns:dep="http://openoffice.org/extensions/description/2006"
xmlns:xlink="http://www.w3.org/1999/xlink">
<identifier value="pro.litvinovg.Redaction" />
<version value="0.2.5" />
<version value="0.2.6" />
<platform value="all" />
<display-name>
<name lang="en">Redaction for publishing in Institute of philosophy</name>