Fix for previous commit

This commit is contained in:
Georgy Litvinov 2020-02-04 11:23:35 +01:00
parent e849641e00
commit 3fb6cd1713

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 mark7 <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark8
End Sub End Sub
@ -13,18 +13,29 @@ Sub cleanButton
Exit Sub Exit Sub
EndIf EndIf
saveDocument saveDocument
statusIndicator.Start(&quot;Чистка документа начата, подождите&quot;,100)
doNotTrack doNotTrack
statusIndicator.Start(&quot;Чистка документа начата, подождите&quot;,30) statusIndicator.SetText(&quot;Заменяем шрифты в стилях&quot;)
replaceStyleFonts replaceStyleFonts
statusIndicator.SetText(&quot;Конвертируем символы в целевые шрифты&quot;)
unicodeSymbolsConversion unicodeSymbolsConversion
statusIndicator.SetText(&quot;Чистим ручное форматирование&quot;)
cleanFormatting cleanFormatting
statusIndicator.SetText(&quot;Удаленем гиперссылки&quot;)
removeHyperlinks removeHyperlinks
statusIndicator.SetText(&quot;Удаляем закладки&quot;)
disposeAllBookmarks disposeAllBookmarks
statusIndicator.SetText(&quot;Настраиваем таблицы&quot;)
fixTableWidth fixTableWidth
statusIndicator.SetText(&quot;Настраиваем привязку изображений&quot;)
fixDrawingAnchors fixDrawingAnchors
statusIndicator.SetText(&quot;Исправляем часто встречающиеся ошибки&quot;)
fixFrequentMistakes fixFrequentMistakes
statusIndicator.SetText(&quot;Удаляем разрыв страницы, если он задан в начале документа&quot;)
removeFirstElementPageBreak removeFirstElementPageBreak
statusIndicator.SetText(&quot;Удаляем пользовательские стили страниц&quot;)
removeUserPageStyles removeUserPageStyles
statusIndicator.SetText(&quot;Загружаем стили из шаблона&quot;)
loadArticleStyles loadArticleStyles
statusIndicator.end() statusIndicator.end()
saveAndreload() saveAndreload()
@ -456,10 +467,8 @@ Sub setAttributesBySearchPattern(searchPattern As String,ReplAttributes, Optiona
EndIf EndIf
If replace then If replace then
For i = LBound(ReplAttributes) To Ubound(ReplAttributes) For i = LBound(ReplAttributes) To Ubound(ReplAttributes)
attrName = ReplAttributes(i).Name If oFound.getPropertySetInfo.hasPropertyByName(ReplAttributes(i).Name) Then
attrValue = ReplAttributes(i).Value oFound.SetPropertyValue(ReplAttributes(i).Name, ReplAttributes(i).Value)
If oFound.getPropertySetInfo.hasPropertyByName(attrName) Then
oFound.SetPropertyValue(attrName,attrValue)
EndIf EndIf
Next i Next i
EndIf EndIf
@ -626,8 +635,7 @@ Private Sub removeDirectFormatting
document = ThisComponent.CurrentController.Frame document = ThisComponent.CurrentController.Frame
Dim oViewCursor As Object &apos;View cursor Dim oViewCursor As Object &apos;View cursor
oViewCursor = ThisComponent.CurrentController.getViewCursor() oViewCursor = ThisComponent.CurrentController.getViewCursor()
&apos; Globalscope.BasicLibraries.LoadLibrary( &quot;MRILib&quot; )
&apos; Mri oViewCursor
oViewCursor.jumpToFirstPage() oViewCursor.jumpToFirstPage()
oViewCursor.gotoStart(false) oViewCursor.gotoStart(false)
oViewCursor.gotoEnd(true) oViewCursor.gotoEnd(true)
@ -984,7 +992,7 @@ Private Sub convertWLLatin2IPHAstra
ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false) ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
oSearchString = &quot;(.)\u0331&quot; oSearchString = &quot;(.)\u0331&quot;
&apos;from unicode to remove direct formatting &apos;from unicode to remove direct formatting
searchAndRemoveDirectFormatting(oSearchString) ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
&apos;Replace dot below &apos;Replace dot below
oSearchString = &quot;(.)\uF0D6&quot; oSearchString = &quot;(.)\uF0D6&quot;
@ -993,7 +1001,7 @@ Private Sub convertWLLatin2IPHAstra
ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false) ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
&apos;from unicode to remove direct formatting &apos;from unicode to remove direct formatting
oSearchString = &quot;(.)\u0323&quot; oSearchString = &quot;(.)\u0323&quot;
searchAndRemoveDirectFormatting(oSearchString) ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
&apos;replace macron &apos;replace macron
oSearchString = &quot;(.)\uF0F4&quot; oSearchString = &quot;(.)\uF0F4&quot;
@ -1002,7 +1010,7 @@ Private Sub convertWLLatin2IPHAstra
ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false) ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
&apos;from unicode to remove direct formatting &apos;from unicode to remove direct formatting
oSearchString = &quot;(.)\u0304&quot; oSearchString = &quot;(.)\u0304&quot;
searchAndRemoveDirectFormatting(oSearchString) ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
&apos;replace accent &apos;replace accent
oSearchString = &quot;(.)\uF0F1&quot; oSearchString = &quot;(.)\uF0F1&quot;
@ -1010,7 +1018,7 @@ Private Sub convertWLLatin2IPHAstra
ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false) ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
&apos;from unicode to remove direct formatting &apos;from unicode to remove direct formatting
oSearchString = &quot;(.)\u0341&quot; oSearchString = &quot;(.)\u0341&quot;
searchAndRemoveDirectFormatting(oSearchString) ReplaceFormatting(oSearchString,oReplaceString,SrchAttributes,ReplAttributes, false)
replaceFontsInStyles( &quot;WL LatinAllIn1Goth&quot;, newFontName) replaceFontsInStyles( &quot;WL LatinAllIn1Goth&quot;, newFontName)
End Sub End Sub