Improved conversion for diacritic marks
This commit is contained in:
parent
8b44586932
commit
e849641e00
3 changed files with 44 additions and 27 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
<!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 mark6
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark7
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
@ -330,10 +330,10 @@ End Function
|
||||||
|
|
||||||
|
|
||||||
Private Sub removeHyperlinks()
|
Private Sub removeHyperlinks()
|
||||||
Dim statusIndicator as Object
|
|
||||||
Dim aNote As Object
|
Dim aNote As Object
|
||||||
statusIndicator = ThisComponent.getCurrentController.StatusIndicator
|
|
||||||
statusIndicator.Start("Удаление гиперссылок, подождите",10)
|
|
||||||
removeHLInText(ThisComponent.Text)
|
removeHLInText(ThisComponent.Text)
|
||||||
For x = 0 to ThisComponent.FootNotes.Count -1
|
For x = 0 to ThisComponent.FootNotes.Count -1
|
||||||
aNote = ThisComponent.FootNotes.getByIndex(x)
|
aNote = ThisComponent.FootNotes.getByIndex(x)
|
||||||
|
@ -343,7 +343,7 @@ Private Sub removeHyperlinks()
|
||||||
aNote = ThisComponent.EndNotes.getByIndex(x)
|
aNote = ThisComponent.EndNotes.getByIndex(x)
|
||||||
removeHLInText(aNote.Text)
|
removeHLInText(aNote.Text)
|
||||||
Next
|
Next
|
||||||
statusIndicator.end()
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub removeHLInText(textElement)
|
Private Sub removeHLInText(textElement)
|
||||||
|
@ -967,34 +967,50 @@ End Sub
|
||||||
|
|
||||||
Private Sub convertWLLatin2IPHAstra
|
Private Sub convertWLLatin2IPHAstra
|
||||||
Dim newFontName As String
|
Dim newFontName As String
|
||||||
newFontName = "IPH Astra Serif"
|
'newFontName = "IPH Astra Serif"
|
||||||
Dim SrchAttributes(0) as new com.sun.star.beans.PropertyValue
|
Dim SrchAttributes(0) as new com.sun.star.beans.PropertyValue
|
||||||
Dim ReplAttributes(0) as new com.sun.star.beans.PropertyValue
|
Dim ReplAttributes(0) as new com.sun.star.beans.PropertyValue
|
||||||
SrchAttributes(0).Name = "CharFontName"
|
SrchAttributes(0).Name = "CharFontName"
|
||||||
SrchAttributes(0).Value = "WL LatinAllIn1Goth"
|
'SrchAttributes(0).Value = "WL LatinAllIn1Goth"
|
||||||
ReplAttributes(0).Name = "CharFontName"
|
ReplAttributes(0).Name = "CharFontName"
|
||||||
ReplAttributes(0).Value = newFontName
|
'ReplAttributes(0).Value = newFontName
|
||||||
|
|
||||||
SearchString = "\uF0D4"
|
SrchAttributes(0).Value = Empty
|
||||||
oReplaceString = "̱"
|
ReplAttributes(0).Value = Empty
|
||||||
ReplaceFormatting(SearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
|
'Replace macron below
|
||||||
ReplaceFormatting(SearchString,oReplaceString,SrchAttributes,ReplAttributes, true)
|
oSearchString = "(.)\uF0D4"
|
||||||
|
oReplaceString = "$1̱"
|
||||||
|
'from WL
|
||||||
|
ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
|
||||||
|
oSearchString = "(.)\u0331"
|
||||||
|
'from unicode to remove direct formatting
|
||||||
|
searchAndRemoveDirectFormatting(oSearchString)
|
||||||
|
|
||||||
SearchString = "\uF0D6"
|
'Replace dot below
|
||||||
oReplaceString = "̣"
|
oSearchString = "(.)\uF0D6"
|
||||||
ReplaceFormatting(SearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
|
oReplaceString = "$1̣"
|
||||||
ReplaceFormatting(SearchString,oReplaceString,SrchAttributes,ReplAttributes, true)
|
'from WL
|
||||||
|
ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
|
||||||
|
'from unicode to remove direct formatting
|
||||||
|
oSearchString = "(.)\u0323"
|
||||||
|
searchAndRemoveDirectFormatting(oSearchString)
|
||||||
|
|
||||||
SearchString = "\uF0F4"
|
'replace macron
|
||||||
oReplaceString = "̄"
|
oSearchString = "(.)\uF0F4"
|
||||||
ReplaceFormatting(SearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
|
oReplaceString = "$1̄"
|
||||||
ReplaceFormatting(SearchString,oReplaceString,SrchAttributes,ReplAttributes, true)
|
'from WL
|
||||||
|
ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
|
||||||
|
'from unicode to remove direct formatting
|
||||||
|
oSearchString = "(.)\u0304"
|
||||||
|
searchAndRemoveDirectFormatting(oSearchString)
|
||||||
|
|
||||||
ReplAttributes(0).Value = newFontName
|
'replace accent
|
||||||
SearchString = "\uF0F1"
|
oSearchString = "(.)\uF0F1"
|
||||||
oReplaceString = "́"
|
oReplaceString = "$1́"
|
||||||
ReplaceFormatting(SearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
|
ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
|
||||||
ReplaceFormatting(SearchString,oReplaceString,SrchAttributes,ReplAttributes, true)
|
'from unicode to remove direct formatting
|
||||||
|
oSearchString = "(.)\u0341"
|
||||||
|
searchAndRemoveDirectFormatting(oSearchString)
|
||||||
|
|
||||||
replaceFontsInStyles( "WL LatinAllIn1Goth", newFontName)
|
replaceFontsInStyles( "WL LatinAllIn1Goth", newFontName)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:dep="http://openoffice.org/extensions/description/2006"
|
xmlns:dep="http://openoffice.org/extensions/description/2006"
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
<identifier value="pro.litvinovg.Redaction" />
|
<identifier value="pro.litvinovg.Redaction" />
|
||||||
<version value="0.4.0" />
|
<version value="0.4.1" />
|
||||||
<platform value="all" />
|
<platform value="all" />
|
||||||
<display-name>
|
<display-name>
|
||||||
<name lang="en">Cleaning and validation documents for publishing in html and epub with pagination</name>
|
<name lang="en">Cleaning and validation documents for publishing in html and epub with pagination</name>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
0.4.1 Improved conversion for diacritic marks
|
||||||
0.4.0 Added fonts in styles conversion, also added conversion for WL Latin symbols
|
0.4.0 Added fonts in styles conversion, also added conversion for WL Latin symbols
|
||||||
0.3.7 Added greek extended conversion to Tinos, extended latin and letter-like symbols to base font
|
0.3.7 Added greek extended conversion to Tinos, extended latin and letter-like symbols to base font
|
||||||
0.3.6 Added check for null EmbeededObject (13.01.2019)
|
0.3.6 Added check for null EmbeededObject (13.01.2019)
|
||||||
|
|
Loading…
Add table
Reference in a new issue