Added check for sections in tables
This commit is contained in:
parent
6c42e2b6b3
commit
6059460ced
7 changed files with 63 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
<?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="Configuration" script:language="StarBasic" script:moduleType="normal">Public Const redactionExtensionName As String = "cleanAndValidate"
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Configuration" script:language="StarBasic" script:moduleType="normal">Public Const redactionExtensionName As String = "cleanAndValidate"
|
||||||
Public Const redactionExtensionVersion = "0.8.2"
|
Public Const redactionExtensionVersion = "0.8.3"
|
||||||
Function initRedactionConfiguration()
|
Function initRedactionConfiguration()
|
||||||
On Error Goto exceptionHandler
|
On Error Goto exceptionHandler
|
||||||
Dim regFactory As Object
|
Dim regFactory As Object
|
||||||
|
|
|
@ -212,6 +212,12 @@ Function getRussian(identifier As String) As String
|
||||||
Case "setOutlineLevel"
|
Case "setOutlineLevel"
|
||||||
getRussian = "задан уровень структуры документа"
|
getRussian = "задан уровень структуры документа"
|
||||||
Exit Function
|
Exit Function
|
||||||
|
Case "section"
|
||||||
|
getRussian = "Раздел"
|
||||||
|
Exit Function
|
||||||
|
Case "isInTable"
|
||||||
|
getRussian = "находится внутри таблицы."
|
||||||
|
Exit Function
|
||||||
Case Else
|
Case Else
|
||||||
getRussian = "Перевод не найден"
|
getRussian = "Перевод не найден"
|
||||||
End Select
|
End Select
|
||||||
|
@ -406,6 +412,12 @@ Function getEnglish(identifier As String) As String
|
||||||
Case "setOutlineLevel"
|
Case "setOutlineLevel"
|
||||||
getEnglish = "set document structure level"
|
getEnglish = "set document structure level"
|
||||||
Exit Function
|
Exit Function
|
||||||
|
Case "section"
|
||||||
|
getEnglish = "Section"
|
||||||
|
Exit Function
|
||||||
|
Case "isInTable"
|
||||||
|
getEnglish = "located inside the table."
|
||||||
|
Exit Function
|
||||||
Case Else
|
Case Else
|
||||||
getEnglish = "No translation"
|
getEnglish = "No translation"
|
||||||
End Select
|
End Select
|
||||||
|
@ -599,6 +611,12 @@ Function getCroatian(identifier As String) As String
|
||||||
Case "setOutlineLevel"
|
Case "setOutlineLevel"
|
||||||
getCroatian = "zadati uroven strukturni dokument"
|
getCroatian = "zadati uroven strukturni dokument"
|
||||||
Exit Function
|
Exit Function
|
||||||
|
Case "section"
|
||||||
|
getCroatian = "Odjeljak"
|
||||||
|
Exit Function
|
||||||
|
Case "isInTable"
|
||||||
|
getCroatian = "smještene unutar stola."
|
||||||
|
Exit Function
|
||||||
Case Else
|
Case Else
|
||||||
getCroatian = "No translation"
|
getCroatian = "No translation"
|
||||||
End Select
|
End Select
|
||||||
|
@ -792,6 +810,12 @@ Function getSerbian(identifier As String) As String
|
||||||
Case "setOutlineLevel"
|
Case "setOutlineLevel"
|
||||||
getSerbian = "задатен уровен структури документа"
|
getSerbian = "задатен уровен структури документа"
|
||||||
Exit Function
|
Exit Function
|
||||||
|
Case "section"
|
||||||
|
getSerbian = "Одјељак"
|
||||||
|
Exit Function
|
||||||
|
Case "isInTable"
|
||||||
|
getSerbian = "смештене унутар стола."
|
||||||
|
Exit Function
|
||||||
Case Else
|
Case Else
|
||||||
getSerbian = "No translation"
|
getSerbian = "No translation"
|
||||||
End Select
|
End Select
|
||||||
|
@ -985,6 +1009,12 @@ Function getBosnian(identifier As String) As String
|
||||||
Case "setOutlineLevel"
|
Case "setOutlineLevel"
|
||||||
getBosnian = "zadati uroven strukturni dokument"
|
getBosnian = "zadati uroven strukturni dokument"
|
||||||
Exit Function
|
Exit Function
|
||||||
|
Case "section"
|
||||||
|
getBosnian = "Odjeljak"
|
||||||
|
Exit Function
|
||||||
|
Case "isInTable"
|
||||||
|
getBosnian = "smještene unutar stola."
|
||||||
|
Exit Function
|
||||||
Case Else
|
Case Else
|
||||||
getBosnian = "No translation"
|
getBosnian = "No translation"
|
||||||
End Select
|
End Select
|
||||||
|
|
|
@ -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 markval5
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">Sub markval6
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ End Function
|
||||||
Sub validateButton
|
Sub validateButton
|
||||||
Dim footnotesReport As String
|
Dim footnotesReport As String
|
||||||
Dim graphicsReport As String
|
Dim graphicsReport As String
|
||||||
|
Dim sectionsReport As String
|
||||||
Dim outlineInNotesReport As String
|
Dim outlineInNotesReport As String
|
||||||
Dim badText As Boolean
|
Dim badText As Boolean
|
||||||
Dim badNumberings As Boolean
|
Dim badNumberings As Boolean
|
||||||
|
@ -35,6 +36,7 @@ Sub validateButton
|
||||||
badNumberings = false
|
badNumberings = false
|
||||||
footnotesReport = noteSingsCheck
|
footnotesReport = noteSingsCheck
|
||||||
graphicsReport = checkGraphics
|
graphicsReport = checkGraphics
|
||||||
|
sectionsReport = checkSectionsInTables
|
||||||
outlineInNotesReport = checkNotesOutline()
|
outlineInNotesReport = checkNotesOutline()
|
||||||
If outlineInNotesReport <> "" Then
|
If outlineInNotesReport <> "" Then
|
||||||
MsgBox outlineInNotesReport
|
MsgBox outlineInNotesReport
|
||||||
|
@ -45,6 +47,9 @@ Sub validateButton
|
||||||
If graphicsReport <> "" Then
|
If graphicsReport <> "" Then
|
||||||
MsgBox graphicsReport
|
MsgBox graphicsReport
|
||||||
EndIf
|
EndIf
|
||||||
|
If sectionsReport <> "" Then
|
||||||
|
MsgBox sectionsReport
|
||||||
|
EndIf
|
||||||
If isInDoc("[\uE000-\uF8FF]") Then
|
If isInDoc("[\uE000-\uF8FF]") Then
|
||||||
badText = true
|
badText = true
|
||||||
EndIf
|
EndIf
|
||||||
|
@ -57,7 +62,7 @@ Sub validateButton
|
||||||
|
|
||||||
printNumberingSymbols(needExtendedInfo)
|
printNumberingSymbols(needExtendedInfo)
|
||||||
|
|
||||||
If badText OR badNumberings OR footnotesReport <> "" OR graphicsReport <> "" Or outlineInNotesReport <> "" Then
|
If badText OR badNumberings OR footnotesReport <> "" OR graphicsReport <> "" Or outlineInNotesReport <> "" Or sectionsReport <> "" Then
|
||||||
MsgBox getTranslation("validationWarning")
|
MsgBox getTranslation("validationWarning")
|
||||||
If badText Then
|
If badText Then
|
||||||
MsgBox getTranslation("validationBadSymbolsNotification")
|
MsgBox getTranslation("validationBadSymbolsNotification")
|
||||||
|
@ -165,6 +170,7 @@ End Function
|
||||||
Function checkNotesOutline As String
|
Function checkNotesOutline As String
|
||||||
Dim oDescriptor As Object
|
Dim oDescriptor As Object
|
||||||
Dim footNotes As Object
|
Dim footNotes As Object
|
||||||
|
Dim endNotes As Object
|
||||||
Dim x As Integer
|
Dim x As Integer
|
||||||
Dim aNote As Object
|
Dim aNote As Object
|
||||||
Dim oEnum As Object
|
Dim oEnum As Object
|
||||||
|
@ -198,6 +204,27 @@ Function checkNotesOutline As String
|
||||||
checkNotesOutline = result
|
checkNotesOutline = result
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Function checkSectionsInTables As String
|
||||||
|
Dim x As Integer
|
||||||
|
Dim oEnum As Object
|
||||||
|
Dim result As String
|
||||||
|
Dim sections As Object
|
||||||
|
Dim section As Object
|
||||||
|
Dim anchor As Object
|
||||||
|
Dim anchorText As Object
|
||||||
|
result = ""
|
||||||
|
sections = thisComponent.TextSections
|
||||||
|
for x = 0 to sections.Count -1
|
||||||
|
section = sections.getByIndex(x)
|
||||||
|
anchor = section.getAnchor()
|
||||||
|
anchorText = anchor.getText()
|
||||||
|
If anchorText.supportsService("com.sun.star.text.CellProperties") Then
|
||||||
|
result = result & getTranslation("section") & " " & section.Name & " " & getTranslation("isInTable") & chr(10)
|
||||||
|
EndIf
|
||||||
|
Next
|
||||||
|
checkSectionsInTables = 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
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
def releaseVersion = "0.8.2"
|
def releaseVersion = "0.8.3"
|
||||||
task oxt(type: Zip) {
|
task oxt(type: Zip) {
|
||||||
dependsOn = [ 'setVersion','setVersionInBasicCode' ]
|
dependsOn = [ 'setVersion','setVersionInBasicCode' ]
|
||||||
from './'
|
from './'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:dep="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink">
|
<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:dep="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
<identifier value="pro.litvinovg.Redaction"/>
|
<identifier value="pro.litvinovg.Redaction"/>
|
||||||
<version value="0.8.2"/>
|
<version value="0.8.3"/>
|
||||||
<platform value="all"/>
|
<platform value="all"/>
|
||||||
<display-name>
|
<display-name>
|
||||||
<name lang="en">Cleaning and validation documents for publishing in html and epub with pagination</name>
|
<name lang="en">Cleaning and validation documents for publishing in html and epub with pagination</name>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
0.8.3 Added check for sections in tables
|
||||||
0.7.19 Do not try to clean in read only mode
|
0.7.19 Do not try to clean in read only mode
|
||||||
0.7.16 Added timestamp to document properties after cleaning
|
0.7.16 Added timestamp to document properties after cleaning
|
||||||
0.7.14 Search for formatting in styles
|
0.7.14 Search for formatting in styles
|
||||||
|
|
BIN
translations.ods
BIN
translations.ods
Binary file not shown.
Loading…
Add table
Reference in a new issue