Fixed numberings validation

This commit is contained in:
Georgy Litvinov 2021-05-29 14:32:18 +02:00
parent 32518cec1e
commit 48b81a64d2
2 changed files with 11 additions and 9 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> <!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 markval21 <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">Sub markval22
End Sub End Sub
@ -83,9 +83,9 @@ Sub validateButton
needExtendedInfo = false needExtendedInfo = false
EndIf EndIf
printNumberingSymbols(needExtendedInfo) numberingsErros = printNumberingSymbols(needExtendedInfo)
statusIndicator.setValue(80) statusIndicator.setValue(80)
If 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 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
MsgBox getTranslation(&quot;validationWarning&quot;) MsgBox getTranslation(&quot;validationWarning&quot;)
If badText Then If badText Then
MsgBox getTranslation(&quot;validationBadSymbolsNotification&quot;) MsgBox getTranslation(&quot;validationBadSymbolsNotification&quot;)
@ -433,7 +433,7 @@ Function isHeadingsInText(oText As Object) As Boolean
isHeadingsInText = false isHeadingsInText = false
End Function End Function
Private Sub printNumberingSymbols(needExtendedInfo) Function printNumberingSymbols(needExtendedInfo) As Boolean
Dim families As Object Dim families As Object
Dim numStyles As Object Dim numStyles As Object
Dim numStyle As Object Dim numStyle As Object
@ -450,6 +450,7 @@ Private Sub printNumberingSymbols(needExtendedInfo)
Dim exLength As Integer Dim exLength As Integer
Dim report As String Dim report As String
Dim k As Integer Dim k As Integer
printNumberingSymbols = false
families = ThisComponent.StyleFamilies families = ThisComponent.StyleFamilies
numStyles = families.getByName(&quot;NumberingStyles&quot;) numStyles = families.getByName(&quot;NumberingStyles&quot;)
result = &quot;&quot; result = &quot;&quot;
@ -479,7 +480,7 @@ Private Sub printNumberingSymbols(needExtendedInfo)
exLength = Len(excerpt) exLength = Len(excerpt)
EndIf EndIf
If fontChar &lt;&gt; &quot;&quot; Then If fontChar &lt;&gt; &quot;&quot; Then
tmp = getTranslation(&quot;validateNumberingLevel&quot;) &amp;&quot; &quot; &amp; (j + 1) &amp; &quot; &quot; &amp; getTranslation(&quot;validateNumberingFont&quot;) &amp; &quot; &quot; &amp; fontName &amp; &quot; &quot; &amp; getTranslation(&quot;validateNumberingSymbol&quot;) &amp; &quot; &quot; &amp; fontChar &amp; &quot; (&quot; &amp; Hex(Asc(fontChar)) &amp; &quot;) &quot;&amp; Left(excerpt,exLength) &amp; chr(10) tmp = numRules.Name &amp;&quot; &quot;&amp; getTranslation(&quot;validateNumberingLevel&quot;) &amp;&quot; &quot; &amp; (j + 1) &amp; &quot; &quot; &amp; getTranslation(&quot;validateNumberingFont&quot;) &amp; &quot; &quot; &amp; fontName &amp; &quot; &quot; &amp; getTranslation(&quot;validateNumberingSymbol&quot;) &amp; &quot; &quot; &amp; fontChar &amp; &quot; (&quot; &amp; Hex(Asc(fontChar)) &amp; &quot;) &quot;&amp; Left(excerpt,exLength) &amp; chr(10)
If Asc(fontChar) &gt; 57344 AND Asc(fontChar) &lt; 63743 Then If Asc(fontChar) &gt; 57344 AND Asc(fontChar) &lt; 63743 Then
resultBad = resultBad &amp; tmp resultBad = resultBad &amp; tmp
ElseIf fontName &lt;&gt; &quot;IPH Astra Serif&quot; _ ElseIf fontName &lt;&gt; &quot;IPH Astra Serif&quot; _
@ -499,8 +500,9 @@ Private Sub printNumberingSymbols(needExtendedInfo)
report = &quot;&quot; report = &quot;&quot;
If result = &quot;&quot; AND resultBad = &quot;&quot; Then If result = &quot;&quot; AND resultBad = &quot;&quot; Then
Exit sub Exit Function
Else Else
printNumberingSymbols = true
If resultBad &lt;&gt; &quot;&quot; Then If resultBad &lt;&gt; &quot;&quot; Then
report = getTranslation(&quot;validateNumberingsReportSymbols&quot;) &amp; chr(10) &amp; resultBad report = getTranslation(&quot;validateNumberingsReportSymbols&quot;) &amp; chr(10) &amp; resultBad
EndIf EndIf
@ -509,7 +511,7 @@ Private Sub printNumberingSymbols(needExtendedInfo)
EndIf EndIf
EndIf EndIf
MsgBox report MsgBox report
End Sub End Function
Private Sub showTrackedChanges Private Sub showTrackedChanges
dim document as object dim document as object

View file

@ -1 +1 @@
version=0.9.28 version=0.9.29