Added validation for headings in footnotes and endnotes.
This commit is contained in:
parent
4a9611ce1a
commit
ed6bb42085
4 changed files with 69 additions and 21 deletions
|
@ -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="Clean" script:language="StarBasic">Sub mark60
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark61
|
||||
|
||||
End Sub
|
||||
|
||||
|
@ -531,13 +531,13 @@ End Function
|
|||
|
||||
Private Sub removeHyperlinks()
|
||||
Dim aNote As Object
|
||||
Dim i As Long
|
||||
Dim x As Long
|
||||
removeHLInText(ThisComponent.Text)
|
||||
For i = 0 to ThisComponent.FootNotes.Count -1
|
||||
For x = 0 to ThisComponent.FootNotes.Count -1
|
||||
aNote = ThisComponent.FootNotes.getByIndex(x)
|
||||
removeHLInText(aNote.Text)
|
||||
Next
|
||||
For i = 0 to ThisComponent.EndNotes.Count -1
|
||||
For x = 0 to ThisComponent.EndNotes.Count -1
|
||||
aNote = ThisComponent.EndNotes.getByIndex(x)
|
||||
removeHLInText(aNote.Text)
|
||||
Next
|
||||
|
|
|
@ -208,6 +208,9 @@ Function getRussian(identifier As String) As String
|
|||
Exit Function
|
||||
Case "validateEndnotes1"
|
||||
getRussian = "в концевой сноске (абсолютный номер)"
|
||||
Exit Function
|
||||
Case "setOutlineLevel"
|
||||
getRussian = "задан уровень структуры документа"
|
||||
Exit Function
|
||||
Case Else
|
||||
getRussian = "Перевод не найден"
|
||||
|
@ -399,6 +402,9 @@ Function getEnglish(identifier As String) As String
|
|||
Exit Function
|
||||
Case "validateEndnotes1"
|
||||
getEnglish = "in endnote (absolute number)"
|
||||
Exit Function
|
||||
Case "setOutlineLevel"
|
||||
getEnglish = "set document structure level"
|
||||
Exit Function
|
||||
Case Else
|
||||
getEnglish = "No translation"
|
||||
|
@ -590,6 +596,9 @@ Function getCroatian(identifier As String) As String
|
|||
Case "validateEndnotes1"
|
||||
getCroatian = "u end fusnoti (apsolutni broj)"
|
||||
Exit Function
|
||||
Case "setOutlineLevel"
|
||||
getCroatian = "zadati uroven strukturni dokument"
|
||||
Exit Function
|
||||
Case Else
|
||||
getCroatian = "No translation"
|
||||
End Select
|
||||
|
@ -780,6 +789,9 @@ Function getSerbian(identifier As String) As String
|
|||
Case "validateEndnotes1"
|
||||
getSerbian = "у end фусноти (апсолутни број)"
|
||||
Exit Function
|
||||
Case "setOutlineLevel"
|
||||
getSerbian = "задатен уровен структури документа"
|
||||
Exit Function
|
||||
Case Else
|
||||
getSerbian = "No translation"
|
||||
End Select
|
||||
|
@ -970,6 +982,9 @@ Function getBosnian(identifier As String) As String
|
|||
Case "validateEndnotes1"
|
||||
getBosnian = "u end fusnoti (apsolutni broj)"
|
||||
Exit Function
|
||||
Case "setOutlineLevel"
|
||||
getBosnian = "zadati uroven strukturni dokument"
|
||||
Exit Function
|
||||
Case Else
|
||||
getBosnian = "No translation"
|
||||
End Select
|
||||
|
|
|
@ -25,42 +25,39 @@ End Function
|
|||
Sub validateButton
|
||||
Dim footnotesReport As String
|
||||
Dim graphicsReport As String
|
||||
Dim outlineInNotesReport As String
|
||||
Dim badText As Boolean
|
||||
Dim badNumberings As Boolean
|
||||
Dim badFootnoteSigns As Boolean
|
||||
Dim badGraphics As Boolean
|
||||
Dim needExtendedInfo As Boolean
|
||||
badGraphics = false
|
||||
Dim config As Object
|
||||
config = initRedactionConfiguration()
|
||||
badText = false
|
||||
badFootnoteSigns = false
|
||||
badNumberings = false
|
||||
footnotesReport = noteSingsCheck
|
||||
graphicsReport = checkGraphics
|
||||
If footnotesReport <> "" Then
|
||||
badFootnoteSigns = true
|
||||
outlineInNotesReport = checkNotesOutline()
|
||||
If outlineInNotesReport <> "" Then
|
||||
MsgBox outlineInNotesReport
|
||||
EndIf
|
||||
If footnotesReport <> "" Then
|
||||
MsgBox footnotesReport
|
||||
EndIf
|
||||
If graphicsReport <> "" Then
|
||||
badGraphics = true
|
||||
MsgBox graphicsReport
|
||||
EndIf
|
||||
If isInDoc("[\uE000-\uF8FF]") Then
|
||||
badText = true
|
||||
EndIf
|
||||
If badFootnoteSigns Then
|
||||
MsgBox footnotesReport
|
||||
EndIf
|
||||
If badGraphics Then
|
||||
MsgBox graphicsReport
|
||||
EndIf
|
||||
Dim config As Object
|
||||
config = initRedactionConfiguration()
|
||||
|
||||
If config.getPropertyValue("complexity") = "makerUp" then
|
||||
needExtendedInfo = true
|
||||
Else
|
||||
needExtendedInfo = false
|
||||
EndIf
|
||||
printNumberingSymbols(needExtendedInfo)
|
||||
|
||||
If badText OR badNumberings OR badFootnoteSigns OR badGraphics Then
|
||||
printNumberingSymbols(needExtendedInfo)
|
||||
|
||||
If badText OR badNumberings OR footnotesReport <> "" OR graphicsReport <> "" Or outlineInNotesReport <> "" Then
|
||||
MsgBox getTranslation("validationWarning")
|
||||
If badText Then
|
||||
MsgBox getTranslation("validationBadSymbolsNotification")
|
||||
|
@ -165,6 +162,42 @@ Private Function noteSingsCheck() As String
|
|||
noteSingsCheck = result
|
||||
End Function
|
||||
|
||||
Function checkNotesOutline As String
|
||||
Dim oDescriptor As Object
|
||||
Dim footNotes As Object
|
||||
Dim x As Integer
|
||||
Dim aNote As Object
|
||||
Dim oEnum As Object
|
||||
Dim oCurPar As Object
|
||||
Dim result As String
|
||||
result = ""
|
||||
footNotes = thisComponent.footNotes
|
||||
endNotes = thisComponent.footNotes
|
||||
for x = 0 to footNotes.Count -1
|
||||
aNote = footNotes.getByIndex(x)
|
||||
aNote.Anchor.CharStyleName="Footnote anchor"
|
||||
oEnum = aNote.Text.createEnumeration()
|
||||
Do While oEnum.hasMoreElements()
|
||||
oCurPar = oEnum.nextElement()
|
||||
If oCurPar.OutlineLevel > 0 Then
|
||||
result = result & getTranslation("validateFootnotes2") & " " & x & " " & getTranslation("setOutlineLevel") & " " & oCurPar.OutlineLevel & chr(10)
|
||||
EndIf
|
||||
Loop
|
||||
Next
|
||||
for x = 0 to endNotes.Count -1
|
||||
aNote = endNotes.getByIndex(x)
|
||||
aNote.Anchor.CharStyleName="Footnote anchor"
|
||||
oEnum = aNote.Text.createEnumeration()
|
||||
Do While oEnum.hasMoreElements()
|
||||
oCurPar = oEnum.nextElement()
|
||||
If oCurPar.OutlineLevel > 0 Then
|
||||
result = result & getTranslation("validateEndnotes1") & " " & x & " " & getTranslation("setOutlineLevel") & " " & oCurPar.OutlineLevel & chr(10)
|
||||
EndIf
|
||||
Loop
|
||||
Next
|
||||
checkNotesOutline = result
|
||||
End Function
|
||||
|
||||
Private Sub printNumberingSymbols(needExtendedInfo)
|
||||
Dim families As Object
|
||||
Dim numStyles As Object
|
||||
|
|
BIN
translations.ods
BIN
translations.ods
Binary file not shown.
Loading…
Add table
Reference in a new issue