Check for bad symbols in endnote signs

This commit is contained in:
Georgy Litvinov 2020-07-03 15:47:47 +02:00
parent 067119da14
commit 17c5b58f7d

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">Sub markval2
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">Sub markval3
End Sub
@ -34,7 +34,7 @@ Sub validateButton
badText = false
badFootnoteSigns = false
badNumberings = false
footnotesReport = checkAllFootnotes
footnotesReport = noteSingsCheck
graphicsReport = checkGraphics
If footnotesReport &lt;&gt; &quot;&quot; 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 = &quot;&quot;
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 &gt;= 57344 AND char &lt;= 63743 then
result = result &amp; getTranslation(&quot;validateFootnotes1&quot;) &amp; &quot; &quot; &amp; Chr(char) &amp; &quot; &quot; &amp; getTranslation(&quot;validateFootnotes2&quot;) &amp; &quot; &quot; &amp; i &amp; &quot; &quot; &amp; getTranslation(&quot;validateFootnotes3&quot;) &amp; chr(10)
End If
Next j
Next i
noteSingsCheck = result
End Function
Private Sub printNumberingSymbols(needExtendedInfo)