From 17c5b58f7d3925de10a9592d2c9ed5340e0b0288 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Fri, 3 Jul 2020 15:47:47 +0200 Subject: [PATCH] Check for bad symbols in endnote signs --- Redaction/Validation.xba | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Redaction/Validation.xba b/Redaction/Validation.xba index 8444ca3..5cfb348 100644 --- a/Redaction/Validation.xba +++ b/Redaction/Validation.xba @@ -1,6 +1,6 @@ -Sub markval2 +Sub markval3 End Sub @@ -34,7 +34,7 @@ Sub validateButton badText = false badFootnoteSigns = false badNumberings = false - footnotesReport = checkAllFootnotes + footnotesReport = noteSingsCheck graphicsReport = checkGraphics If footnotesReport <> "" Then badFootnoteSigns = true @@ -123,15 +123,19 @@ Private Sub removeBadCharacters showTrackedChanges End Sub -Private Function checkAllFootnotes() As String +Private Function noteSingsCheck() As String Dim footnotes As Object + Dim footnote As Object + Dim endnote As Object + Dim endnotes As Object Dim count as Integer Dim charNum as Long Dim char As Long Dim label As String Dim result As String result = "" - footnotes = ThisComponent.Footnotes + footnotes = ThisComponent.footnotes + endnotes = ThisComponent.Footnotes count = footnotes.getCount Dim i As Integer Dim j As Integer @@ -146,7 +150,19 @@ Private Function checkAllFootnotes() As String End If Next j Next i - checkAllFootnotes = result + count = endnotes.getCount + For i = 0 to count-1 + endnote = endnotes.getByIndex(i) + label = endnote.Label + charNum = Len(label) + For j = 1 to charNum + char = Asc(Right(Left(label,j),1)) + If char >= 57344 AND char <= 63743 then + result = result & getTranslation("validateFootnotes1") & " " & Chr(char) & " " & getTranslation("validateFootnotes2") & " " & i & " " & getTranslation("validateFootnotes3") & chr(10) + End If + Next j + Next i + noteSingsCheck = result End Function Private Sub printNumberingSymbols(needExtendedInfo)