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"?>
|
||||
<!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"
|
||||
Public Const redactionExtensionVersion = "0.8.2"
|
||||
Public Const redactionExtensionVersion = "0.8.3"
|
||||
Function initRedactionConfiguration()
|
||||
On Error Goto exceptionHandler
|
||||
Dim regFactory As Object
|
||||
|
|
|
@ -212,6 +212,12 @@ Function getRussian(identifier As String) As String
|
|||
Case "setOutlineLevel"
|
||||
getRussian = "задан уровень структуры документа"
|
||||
Exit Function
|
||||
Case "section"
|
||||
getRussian = "Раздел"
|
||||
Exit Function
|
||||
Case "isInTable"
|
||||
getRussian = "находится внутри таблицы."
|
||||
Exit Function
|
||||
Case Else
|
||||
getRussian = "Перевод не найден"
|
||||
End Select
|
||||
|
@ -406,6 +412,12 @@ Function getEnglish(identifier As String) As String
|
|||
Case "setOutlineLevel"
|
||||
getEnglish = "set document structure level"
|
||||
Exit Function
|
||||
Case "section"
|
||||
getEnglish = "Section"
|
||||
Exit Function
|
||||
Case "isInTable"
|
||||
getEnglish = "located inside the table."
|
||||
Exit Function
|
||||
Case Else
|
||||
getEnglish = "No translation"
|
||||
End Select
|
||||
|
@ -599,6 +611,12 @@ Function getCroatian(identifier As String) As String
|
|||
Case "setOutlineLevel"
|
||||
getCroatian = "zadati uroven strukturni dokument"
|
||||
Exit Function
|
||||
Case "section"
|
||||
getCroatian = "Odjeljak"
|
||||
Exit Function
|
||||
Case "isInTable"
|
||||
getCroatian = "smještene unutar stola."
|
||||
Exit Function
|
||||
Case Else
|
||||
getCroatian = "No translation"
|
||||
End Select
|
||||
|
@ -792,6 +810,12 @@ Function getSerbian(identifier As String) As String
|
|||
Case "setOutlineLevel"
|
||||
getSerbian = "задатен уровен структури документа"
|
||||
Exit Function
|
||||
Case "section"
|
||||
getSerbian = "Одјељак"
|
||||
Exit Function
|
||||
Case "isInTable"
|
||||
getSerbian = "смештене унутар стола."
|
||||
Exit Function
|
||||
Case Else
|
||||
getSerbian = "No translation"
|
||||
End Select
|
||||
|
@ -985,6 +1009,12 @@ Function getBosnian(identifier As String) As String
|
|||
Case "setOutlineLevel"
|
||||
getBosnian = "zadati uroven strukturni dokument"
|
||||
Exit Function
|
||||
Case "section"
|
||||
getBosnian = "Odjeljak"
|
||||
Exit Function
|
||||
Case "isInTable"
|
||||
getBosnian = "smještene unutar stola."
|
||||
Exit Function
|
||||
Case Else
|
||||
getBosnian = "No translation"
|
||||
End Select
|
||||
|
|
|
@ -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="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
|
||||
|
||||
|
@ -25,6 +25,7 @@ End Function
|
|||
Sub validateButton
|
||||
Dim footnotesReport As String
|
||||
Dim graphicsReport As String
|
||||
Dim sectionsReport As String
|
||||
Dim outlineInNotesReport As String
|
||||
Dim badText As Boolean
|
||||
Dim badNumberings As Boolean
|
||||
|
@ -35,6 +36,7 @@ Sub validateButton
|
|||
badNumberings = false
|
||||
footnotesReport = noteSingsCheck
|
||||
graphicsReport = checkGraphics
|
||||
sectionsReport = checkSectionsInTables
|
||||
outlineInNotesReport = checkNotesOutline()
|
||||
If outlineInNotesReport <> "" Then
|
||||
MsgBox outlineInNotesReport
|
||||
|
@ -45,6 +47,9 @@ Sub validateButton
|
|||
If graphicsReport <> "" Then
|
||||
MsgBox graphicsReport
|
||||
EndIf
|
||||
If sectionsReport <> "" Then
|
||||
MsgBox sectionsReport
|
||||
EndIf
|
||||
If isInDoc("[\uE000-\uF8FF]") Then
|
||||
badText = true
|
||||
EndIf
|
||||
|
@ -57,7 +62,7 @@ Sub validateButton
|
|||
|
||||
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")
|
||||
If badText Then
|
||||
MsgBox getTranslation("validationBadSymbolsNotification")
|
||||
|
@ -165,6 +170,7 @@ End Function
|
|||
Function checkNotesOutline As String
|
||||
Dim oDescriptor As Object
|
||||
Dim footNotes As Object
|
||||
Dim endNotes As Object
|
||||
Dim x As Integer
|
||||
Dim aNote As Object
|
||||
Dim oEnum As Object
|
||||
|
@ -198,6 +204,27 @@ Function checkNotesOutline As String
|
|||
checkNotesOutline = result
|
||||
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)
|
||||
Dim families As Object
|
||||
Dim numStyles As Object
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
def releaseVersion = "0.8.2"
|
||||
def releaseVersion = "0.8.3"
|
||||
task oxt(type: Zip) {
|
||||
dependsOn = [ 'setVersion','setVersionInBasicCode' ]
|
||||
from './'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?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">
|
||||
<identifier value="pro.litvinovg.Redaction"/>
|
||||
<version value="0.8.2"/>
|
||||
<version value="0.8.3"/>
|
||||
<platform value="all"/>
|
||||
<display-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.16 Added timestamp to document properties after cleaning
|
||||
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