From 48b81a64d27faddf50f60679a0b09fe78f4aebaf Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Sat, 29 May 2021 14:32:18 +0200 Subject: [PATCH] Fixed numberings validation --- Redaction/Validation.xba | 18 ++++++++++-------- gradle.properties | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Redaction/Validation.xba b/Redaction/Validation.xba index dd1728d..928dc5d 100644 --- a/Redaction/Validation.xba +++ b/Redaction/Validation.xba @@ -1,6 +1,6 @@ -Sub markval21 +Sub markval22 End Sub @@ -83,9 +83,9 @@ Sub validateButton needExtendedInfo = false EndIf - printNumberingSymbols(needExtendedInfo) + numberingsErros = printNumberingSymbols(needExtendedInfo) statusIndicator.setValue(80) - If badText OR badNumberings OR footnotesReport <> "" OR graphicsReport <> "" Or outlineInNotesReport <> "" Or sectionsReport <> "" OR oulineInTablesReport <> "" OR outlinePageStylesReport <> "" Then + If numberingsErros OR badText OR badNumberings OR footnotesReport <> "" OR graphicsReport <> "" Or outlineInNotesReport <> "" Or sectionsReport <> "" OR oulineInTablesReport <> "" OR outlinePageStylesReport <> "" Then MsgBox getTranslation("validationWarning") If badText Then MsgBox getTranslation("validationBadSymbolsNotification") @@ -433,7 +433,7 @@ Function isHeadingsInText(oText As Object) As Boolean isHeadingsInText = false End Function -Private Sub printNumberingSymbols(needExtendedInfo) +Function printNumberingSymbols(needExtendedInfo) As Boolean Dim families As Object Dim numStyles As Object Dim numStyle As Object @@ -450,6 +450,7 @@ Private Sub printNumberingSymbols(needExtendedInfo) Dim exLength As Integer Dim report As String Dim k As Integer + printNumberingSymbols = false families = ThisComponent.StyleFamilies numStyles = families.getByName("NumberingStyles") result = "" @@ -479,7 +480,7 @@ Private Sub printNumberingSymbols(needExtendedInfo) exLength = Len(excerpt) EndIf If fontChar <> "" Then - tmp = getTranslation("validateNumberingLevel") &" " & (j + 1) & " " & getTranslation("validateNumberingFont") & " " & fontName & " " & getTranslation("validateNumberingSymbol") & " " & fontChar & " (" & Hex(Asc(fontChar)) & ") "& Left(excerpt,exLength) & chr(10) + tmp = numRules.Name &" "& getTranslation("validateNumberingLevel") &" " & (j + 1) & " " & getTranslation("validateNumberingFont") & " " & fontName & " " & getTranslation("validateNumberingSymbol") & " " & fontChar & " (" & Hex(Asc(fontChar)) & ") "& Left(excerpt,exLength) & chr(10) If Asc(fontChar) > 57344 AND Asc(fontChar) < 63743 Then resultBad = resultBad & tmp ElseIf fontName <> "IPH Astra Serif" _ @@ -499,8 +500,9 @@ Private Sub printNumberingSymbols(needExtendedInfo) report = "" If result = "" AND resultBad = "" Then - Exit sub - Else + Exit Function + Else + printNumberingSymbols = true If resultBad <> "" Then report = getTranslation("validateNumberingsReportSymbols") & chr(10) & resultBad EndIf @@ -509,7 +511,7 @@ Private Sub printNumberingSymbols(needExtendedInfo) EndIf EndIf MsgBox report -End Sub +End Function Private Sub showTrackedChanges dim document as object diff --git a/gradle.properties b/gradle.properties index b7a0434..a364566 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.9.28 +version=0.9.29