From bd840a6499a6470e2a21d2cfeb994e24cb7c3b1d Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Mon, 14 Dec 2020 12:39:13 +0100 Subject: [PATCH] Fixed status indicator on cleaning and disabled fixing hyphen between numbers --- Redaction/Clean.xba | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Redaction/Clean.xba b/Redaction/Clean.xba index 373660b..e29e713 100644 --- a/Redaction/Clean.xba +++ b/Redaction/Clean.xba @@ -1,6 +1,6 @@ -Sub mark69 +Sub mark70 End Sub @@ -56,9 +56,9 @@ End Sub Private Sub cleanAccordingTo(dialog As Object) Dim statusIndicator as Object - statusIndicator = ThisComponent.getCurrentController.statusIndicator dialog.setVisible(false) saveDocument + statusIndicator = ThisComponent.getCurrentController.statusIndicator statusIndicator.Start(getTranslation("statusStarted"),100) doNotTrack If dialog.getControl("loadStandardStyles").state = 1 Then @@ -106,6 +106,8 @@ Private Sub cleanAccordingTo(dialog As Object) fixDrawingAnchors EndIf If dialog.getControl("fixMistakes").state = 1 Then + saveAndreload() + statusIndicator = ThisComponent.getCurrentController.statusIndicator statusIndicator.Start(getTranslation("statusFixFrequentMistakes"),100) fixFrequentMistakes EndIf @@ -154,9 +156,10 @@ End Sub Private Sub quietCleaning Dim description As String Dim statusIndicator As Object - statusIndicator = ThisComponent.getCurrentController.statusIndicator + saveDocument saveAsDocAndBackToODT + statusIndicator = ThisComponent.getCurrentController.statusIndicator statusIndicator.Start(getTranslation("statusStarted"),100) doNotTrack statusIndicator.Start(getTranslation("statusReplaceFontsInStyles"),100) @@ -177,6 +180,8 @@ Private Sub quietCleaning fixTableWidth statusIndicator.Start(getTranslation("statusConfigureImagesAnchors"),100) fixDrawingAnchors + saveAndreload() + statusIndicator = ThisComponent.getCurrentController.statusIndicator statusIndicator.Start(getTranslation("statusFixFrequentMistakes"),100) fixFrequentMistakes statusIndicator.Start(getTranslation("statusRemovePageBreakAtStart"),100) @@ -428,7 +433,7 @@ Private Sub fixFrequentMistakes AskAndReplace("(?<=[:alpha:][:space:])[-‒—−](?=[:space:][:alpha:])","–") 'Между двумя цифрами и тире не долнжо быть пробелов. А также тире должно быть цифровым. 'Также проверяем, что перед искомым тире нет DOI - AskAndReplace("(?<!DOI[0-9. /XVI:-‒–—−-]{1,50})(?<=[:digit:])(?:[:space:])?[-‒–—−](?:[:space:])?(?=[:digit:])","‒") + '''''AskAndReplace("(?<!DOI[0-9. /XVI:-‒–—−-]{1,50})(?<=[:digit:])(?:[:space:])?[-‒–—−](?:[:space:])?(?=[:digit:])","‒") 'Между двумя римскими цифрами и тире между ними не долнжо быть пробелов. А также тире должно быть средним AskAndReplace("(?<=[MDCLXVI])(?:[:space:])?[-‒–—−](?:[:space:])?(?=[MDCLXVI])","–") 'Между буквой и угловой открывающейся скобкой должен быть пробел