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