Replaces footnote signs report with navigated report

This commit is contained in:
Georgy Litvinov 2021-06-07 12:06:27 +02:00
parent 42682e4331
commit 7e77039620
3 changed files with 197 additions and 162 deletions

View file

@ -1,13 +1,13 @@
<?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 markval27
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">Sub markval28
End Sub
Sub validateButton
Dim footnotesReport As String
Dim footnotesReport As Boolean
Dim graphicsReport As String
Dim sectionsReport As String
Dim outlinePageStylesReport As String
@ -27,7 +27,7 @@ Sub validateButton
badText = false
badNumberings = false
footnotesReport = noteSingsCheck
footnotesReport = noteSingsCheck()
statusIndicator.setValue(10)
graphicsReport = checkGraphics
statusIndicator.setValue(20)
@ -49,9 +49,6 @@ Sub validateButton
MsgBox outlinePageStylesReport
EndIf
If footnotesReport &lt;&gt; &quot;&quot; Then
MsgBox footnotesReport
EndIf
If graphicsReport &lt;&gt; &quot;&quot; Then
MsgBox graphicsReport
EndIf
@ -59,7 +56,7 @@ Sub validateButton
MsgBox sectionsReport
EndIf
badText = findBadCharacters
badText = findBadCharacters()
If config.getPropertyValue(&quot;complexity&quot;) = &quot;makerUp&quot; then
needExtendedInfo = true
@ -75,9 +72,8 @@ Sub validateButton
numberingsErros = printNumberingSymbols(needExtendedInfo)
statusIndicator.setValue(80)
If brokenCharBackTransparent OR needFixColoredText OR numberingsErros OR badText OR badNumberings OR footnotesReport &lt;&gt; &quot;&quot; OR graphicsReport &lt;&gt; &quot;&quot; Or outlineInNotesReport &lt;&gt; &quot;&quot; Or sectionsReport &lt;&gt; &quot;&quot; OR oulineInTablesReport &lt;&gt; &quot;&quot; OR outlinePageStylesReport &lt;&gt; &quot;&quot; Then
If brokenCharBackTransparent OR needFixColoredText OR numberingsErros OR badText OR badNumberings OR footnotesReport OR graphicsReport &lt;&gt; &quot;&quot; Or outlineInNotesReport &lt;&gt; &quot;&quot; Or sectionsReport &lt;&gt; &quot;&quot; OR oulineInTablesReport &lt;&gt; &quot;&quot; OR outlinePageStylesReport &lt;&gt; &quot;&quot; Then
MsgBox getTranslation(&quot;validationWarning&quot;)
Else
MsgBox getTranslation(&quot;validationSuccess&quot;)
EndIf
@ -142,7 +138,7 @@ Sub replaceCharsInDOI
AskAndReplace(&quot;(?&lt;=DOI[0-9. /XVI:ХOО?-]{1,50})[‒–—−]{1,5}&quot;,&quot;-&quot;)
End sub
Private Function noteSingsCheck() As String
Private Function noteSingsCheck() As Boolean
Dim footnotes As Object
Dim footnote As Object
Dim endnote As Object
@ -152,9 +148,11 @@ Private Function noteSingsCheck() As String
Dim char As Long
Dim label As String
Dim result As String
Dim founds() As Object
noteSingsCheck = false
result = &quot;&quot;
footnotes = ThisComponent.footnotes
endnotes = ThisComponent.Footnotes
footnotes = ThisComponent.Footnotes
endnotes = ThisComponent.Endnotes
count = footnotes.getCount
Dim i As Integer
Dim j As Integer
@ -164,8 +162,9 @@ Private Function noteSingsCheck() As String
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)
If char &gt;= 57344 AND char &lt;= 63743 Then
addToArray(founds,footnote.Anchor)
&apos;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
@ -176,12 +175,18 @@ Private Function noteSingsCheck() As String
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;validateEndnotes1&quot;) &amp; &quot; &quot; &amp; i &amp; &quot; &quot; &amp; getTranslation(&quot;validateFootnotes3&quot;) &amp; chr(10)
If char &gt;= 57344 AND char &lt;= 63743 Then
addToArray(founds,endnote.Anchor)
&apos;result = result &amp; getTranslation(&quot;validateFootnotes1&quot;) &amp; &quot; &quot; &amp; Chr(char) &amp; &quot; &quot; &amp; getTranslation(&quot;validateEndnotes1&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
If (UBound(founds) &gt; 0) Then
noteSingsCheck = true
MsgBox(getTranslation(&quot;validationBadFootnotesSymbolsNotification&quot;))
startNavigatorDialog(getTranslation(&quot;badNoteSings&quot;),founds)
EndIf
&apos;noteSingsCheck = result
End Function
Function checkNotesOutline As String
@ -1138,4 +1143,4 @@ Function findInDoc(searchString As String) As Variant
founds = Thiscomponent.findAll(sDesc)
findInDoc = founds
End Function
</script:module>
</script:module>