Added two Symbol conversion chars and fixed reload macro

This commit is contained in:
Georgy Litvinov 2020-11-05 09:37:01 +01:00
parent 12f7f4ab34
commit 42ed0a21ee

View file

@ -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 mark64 <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark65
End Sub End Sub
@ -249,6 +249,7 @@ End Sub
Private Sub unicodeSymbolsConversion Private Sub unicodeSymbolsConversion
convertWLLatin2IPHAstra convertWLLatin2IPHAstra
convertSymbol
Dim newFontName As String Dim newFontName As String
newFontName = &quot;IPH Astra Serif&quot; newFontName = &quot;IPH Astra Serif&quot;
@ -303,9 +304,10 @@ Private Sub unicodeSymbolsConversion
RAtts(1).Value = newFontName RAtts(1).Value = newFontName
RAtts(2).Value = newFontName RAtts(2).Value = newFontName
&apos;\u2200-\u22FF CJK Unified Ideographs &apos;\u2200-\u22FF CJK Unified Ideographs
&apos;\u21d2 двойная стрелка вправо
&apos;3000—303F Символы и пунктуация ККЯ &apos;3000—303F Символы и пунктуация ККЯ
unicodeConversionEverywhere(&quot;[\u302b\uff00-\uffef]+&quot;,RAtts) unicodeConversionEverywhere(&quot;[\u21d2\u302b\uff00-\uffef]+&quot;,RAtts)
newFontName = &quot;Noto Serif CJK SC&quot; newFontName = &quot;Noto Serif CJK SC&quot;
RAtts(0).Value = newFontName RAtts(0).Value = newFontName
@ -695,6 +697,7 @@ Private Sub saveAndreload()
document = ThisComponent.CurrentController.Frame document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService(&quot;com.sun.star.frame.DispatchHelper&quot;) dispatcher = createUnoService(&quot;com.sun.star.frame.DispatchHelper&quot;)
dispatcher.executeDispatch(document, &quot;.uno:Save&quot;, &quot;&quot;, 0, Array()) dispatcher.executeDispatch(document, &quot;.uno:Save&quot;, &quot;&quot;, 0, Array())
dispatcher.executeDispatch(document, &quot;.uno:Reload&quot;, &quot;&quot;, 0, Array())
End Sub End Sub
@ -1328,6 +1331,29 @@ Private Sub replaceWhiteBackgroundWithTransparent
statusIndicator.end() statusIndicator.end()
End Sub End Sub
Sub convertSymbol
Dim newFontName As String
Dim oSearchString As String
Dim oReplaceString As String
&apos;newFontName = &quot;IPH Astra Serif&quot;
Dim SrchAttributes(0) as new com.sun.star.beans.PropertyValue
Dim ReplAttributes(0) as new com.sun.star.beans.PropertyValue
SrchAttributes(0).Name = &quot;CharFontName&quot;
SrchAttributes(0).Value = &quot;Symbol&quot;
ReplAttributes(0).Name = &quot;CharFontName&quot;
ReplAttributes(0).Value = &quot;Noto Serif CJK JP&quot;
oSearchString = &quot;\uF0DE&quot;
oReplaceString = &quot;⇒&quot;
ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
oSearchString = &quot;\uF0DB&quot;
oReplaceString = &quot;⇔&quot;
ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
&apos;replaceFontsInStyles( &quot;WL LatinAllIn1Goth&quot;, newFontName)
End Sub
Private Sub convertWLLatin2IPHAstra Private Sub convertWLLatin2IPHAstra
Dim newFontName As String Dim newFontName As String
Dim oSearchString As String Dim oSearchString As String