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"?>
|
<?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="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
|
End Sub
|
||||||
|
|
||||||
|
@ -531,13 +531,13 @@ End Function
|
||||||
|
|
||||||
Private Sub removeHyperlinks()
|
Private Sub removeHyperlinks()
|
||||||
Dim aNote As Object
|
Dim aNote As Object
|
||||||
Dim i As Long
|
Dim x As Long
|
||||||
removeHLInText(ThisComponent.Text)
|
removeHLInText(ThisComponent.Text)
|
||||||
For i = 0 to ThisComponent.FootNotes.Count -1
|
For x = 0 to ThisComponent.FootNotes.Count -1
|
||||||
aNote = ThisComponent.FootNotes.getByIndex(x)
|
aNote = ThisComponent.FootNotes.getByIndex(x)
|
||||||
removeHLInText(aNote.Text)
|
removeHLInText(aNote.Text)
|
||||||
Next
|
Next
|
||||||
For i = 0 to ThisComponent.EndNotes.Count -1
|
For x = 0 to ThisComponent.EndNotes.Count -1
|
||||||
aNote = ThisComponent.EndNotes.getByIndex(x)
|
aNote = ThisComponent.EndNotes.getByIndex(x)
|
||||||
removeHLInText(aNote.Text)
|
removeHLInText(aNote.Text)
|
||||||
Next
|
Next
|
||||||
|
|
|
@ -208,6 +208,9 @@ Function getRussian(identifier As String) As String
|
||||||
Exit Function
|
Exit Function
|
||||||
Case "validateEndnotes1"
|
Case "validateEndnotes1"
|
||||||
getRussian = "в концевой сноске (абсолютный номер)"
|
getRussian = "в концевой сноске (абсолютный номер)"
|
||||||
|
Exit Function
|
||||||
|
Case "setOutlineLevel"
|
||||||
|
getRussian = "задан уровень структуры документа"
|
||||||
Exit Function
|
Exit Function
|
||||||
Case Else
|
Case Else
|
||||||
getRussian = "Перевод не найден"
|
getRussian = "Перевод не найден"
|
||||||
|
@ -399,6 +402,9 @@ Function getEnglish(identifier As String) As String
|
||||||
Exit Function
|
Exit Function
|
||||||
Case "validateEndnotes1"
|
Case "validateEndnotes1"
|
||||||
getEnglish = "in endnote (absolute number)"
|
getEnglish = "in endnote (absolute number)"
|
||||||
|
Exit Function
|
||||||
|
Case "setOutlineLevel"
|
||||||
|
getEnglish = "set document structure level"
|
||||||
Exit Function
|
Exit Function
|
||||||
Case Else
|
Case Else
|
||||||
getEnglish = "No translation"
|
getEnglish = "No translation"
|
||||||
|
@ -590,6 +596,9 @@ Function getCroatian(identifier As String) As String
|
||||||
Case "validateEndnotes1"
|
Case "validateEndnotes1"
|
||||||
getCroatian = "u end fusnoti (apsolutni broj)"
|
getCroatian = "u end fusnoti (apsolutni broj)"
|
||||||
Exit Function
|
Exit Function
|
||||||
|
Case "setOutlineLevel"
|
||||||
|
getCroatian = "zadati uroven strukturni dokument"
|
||||||
|
Exit Function
|
||||||
Case Else
|
Case Else
|
||||||
getCroatian = "No translation"
|
getCroatian = "No translation"
|
||||||
End Select
|
End Select
|
||||||
|
@ -780,6 +789,9 @@ Function getSerbian(identifier As String) As String
|
||||||
Case "validateEndnotes1"
|
Case "validateEndnotes1"
|
||||||
getSerbian = "у end фусноти (апсолутни број)"
|
getSerbian = "у end фусноти (апсолутни број)"
|
||||||
Exit Function
|
Exit Function
|
||||||
|
Case "setOutlineLevel"
|
||||||
|
getSerbian = "задатен уровен структури документа"
|
||||||
|
Exit Function
|
||||||
Case Else
|
Case Else
|
||||||
getSerbian = "No translation"
|
getSerbian = "No translation"
|
||||||
End Select
|
End Select
|
||||||
|
@ -970,6 +982,9 @@ Function getBosnian(identifier As String) As String
|
||||||
Case "validateEndnotes1"
|
Case "validateEndnotes1"
|
||||||
getBosnian = "u end fusnoti (apsolutni broj)"
|
getBosnian = "u end fusnoti (apsolutni broj)"
|
||||||
Exit Function
|
Exit Function
|
||||||
|
Case "setOutlineLevel"
|
||||||
|
getBosnian = "zadati uroven strukturni dokument"
|
||||||
|
Exit Function
|
||||||
Case Else
|
Case Else
|
||||||
getBosnian = "No translation"
|
getBosnian = "No translation"
|
||||||
End Select
|
End Select
|
||||||
|
|
|
@ -25,42 +25,39 @@ End Function
|
||||||
Sub validateButton
|
Sub validateButton
|
||||||
Dim footnotesReport As String
|
Dim footnotesReport As String
|
||||||
Dim graphicsReport As String
|
Dim graphicsReport As String
|
||||||
|
Dim outlineInNotesReport As String
|
||||||
Dim badText As Boolean
|
Dim badText As Boolean
|
||||||
Dim badNumberings As Boolean
|
Dim badNumberings As Boolean
|
||||||
Dim badFootnoteSigns As Boolean
|
|
||||||
Dim badGraphics As Boolean
|
|
||||||
Dim needExtendedInfo As Boolean
|
Dim needExtendedInfo As Boolean
|
||||||
badGraphics = false
|
Dim config As Object
|
||||||
|
config = initRedactionConfiguration()
|
||||||
badText = false
|
badText = false
|
||||||
badFootnoteSigns = false
|
|
||||||
badNumberings = false
|
badNumberings = false
|
||||||
footnotesReport = noteSingsCheck
|
footnotesReport = noteSingsCheck
|
||||||
graphicsReport = checkGraphics
|
graphicsReport = checkGraphics
|
||||||
If footnotesReport <> "" Then
|
outlineInNotesReport = checkNotesOutline()
|
||||||
badFootnoteSigns = true
|
If outlineInNotesReport <> "" Then
|
||||||
|
MsgBox outlineInNotesReport
|
||||||
EndIf
|
EndIf
|
||||||
|
If footnotesReport <> "" Then
|
||||||
|
MsgBox footnotesReport
|
||||||
|
EndIf
|
||||||
If graphicsReport <> "" Then
|
If graphicsReport <> "" Then
|
||||||
badGraphics = true
|
MsgBox graphicsReport
|
||||||
EndIf
|
EndIf
|
||||||
If isInDoc("[\uE000-\uF8FF]") Then
|
If isInDoc("[\uE000-\uF8FF]") Then
|
||||||
badText = true
|
badText = true
|
||||||
EndIf
|
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
|
If config.getPropertyValue("complexity") = "makerUp" then
|
||||||
needExtendedInfo = true
|
needExtendedInfo = true
|
||||||
Else
|
Else
|
||||||
needExtendedInfo = false
|
needExtendedInfo = false
|
||||||
EndIf
|
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")
|
MsgBox getTranslation("validationWarning")
|
||||||
If badText Then
|
If badText Then
|
||||||
MsgBox getTranslation("validationBadSymbolsNotification")
|
MsgBox getTranslation("validationBadSymbolsNotification")
|
||||||
|
@ -165,6 +162,42 @@ Private Function noteSingsCheck() As String
|
||||||
noteSingsCheck = result
|
noteSingsCheck = result
|
||||||
End Function
|
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)
|
Private Sub printNumberingSymbols(needExtendedInfo)
|
||||||
Dim families As Object
|
Dim families As Object
|
||||||
Dim numStyles As Object
|
Dim numStyles As Object
|
||||||
|
|
BIN
translations.ods
BIN
translations.ods
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue