Added fonts to styles conversion
This commit is contained in:
parent
e9caf166d1
commit
d5ba33005f
3 changed files with 29 additions and 1 deletions
|
@ -11,6 +11,8 @@
|
|||
saveDocument
|
||||
doNotTrack
|
||||
statusIndicator.Start("Чистка документа начата, подождите",30)
|
||||
|
||||
convertFontsToCharStyles
|
||||
cleanFormatting
|
||||
disposeAllLinks
|
||||
disposeAllBookmarks
|
||||
|
@ -22,6 +24,32 @@
|
|||
saveAndreload()
|
||||
End Sub
|
||||
|
||||
|
||||
'Replaces manual formatting text with font into character style with assigned font
|
||||
Private Sub convertFontsToCharStyles
|
||||
Dim oDoc
|
||||
oDoc = Thiscomponent
|
||||
Dim srch(0) as new com.sun.star.beans.PropertyValue
|
||||
SDesc = Thiscomponent.createSearchDescriptor()
|
||||
SDesc.SearchAll = true
|
||||
SDesc.ValueSearch = false
|
||||
SDesc.SearchStyles = false
|
||||
SDesc.SearchRegularExpression = false
|
||||
SDesc.SearchString = ""
|
||||
srch(0).Name = "CharFontName"
|
||||
SDesc.SetSearchAttributes(srch())
|
||||
founds = Thiscomponent.findFirst(SDesc)
|
||||
do while not isNull(founds)
|
||||
curFont = founds.CharFontName
|
||||
If Not DocHasCharStyle(oDoc,curFont) Then
|
||||
oProps() = Array(CreateProperty("CharFontName", curFont))
|
||||
CreateCharacterStyle(curFont, oProps())
|
||||
End If
|
||||
founds.CharStyleNames = Array(curFont)
|
||||
founds = Thiscomponent.findNext(founds.getend, SDesc)
|
||||
loop
|
||||
End Sub
|
||||
|
||||
Private Sub fixFrequentMistakes
|
||||
Dim NBSP As String
|
||||
Dim space As String
|
||||
|
|
|
@ -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.3" />
|
||||
<version value="0.2.4" />
|
||||
<platform value="all" />
|
||||
<display-name>
|
||||
<name lang="en">Redaction for publishing in Institute of philosophy</name>
|
||||
|
|
BIN
redaction.oxt
BIN
redaction.oxt
Binary file not shown.
Loading…
Add table
Reference in a new issue