diff --git a/Redaction/Configuration.xba b/Redaction/Configuration.xba index c5914f3..73ad8b3 100644 --- a/Redaction/Configuration.xba +++ b/Redaction/Configuration.xba @@ -1,7 +1,7 @@ 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 diff --git a/Redaction/Translations.xba b/Redaction/Translations.xba index af73421..66d2221 100644 --- a/Redaction/Translations.xba +++ b/Redaction/Translations.xba @@ -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 diff --git a/Redaction/Validation.xba b/Redaction/Validation.xba index 2ec9614..270d267 100644 --- a/Redaction/Validation.xba +++ b/Redaction/Validation.xba @@ -1,6 +1,6 @@ -Sub markval5 +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 diff --git a/build.gradle b/build.gradle index 03920e2..631222b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -def releaseVersion = "0.8.2" +def releaseVersion = "0.8.3" task oxt(type: Zip) { dependsOn = [ 'setVersion','setVersionInBasicCode' ] from './' diff --git a/description.xml b/description.xml index 4cfd7bf..4f5bc5d 100644 --- a/description.xml +++ b/description.xml @@ -1,7 +1,7 @@ - + Cleaning and validation documents for publishing in html and epub with pagination diff --git a/releasenotes.txt b/releasenotes.txt index 0bd71bd..3222606 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -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 diff --git a/translations.ods b/translations.ods index 5319347..d3849c9 100644 Binary files a/translations.ods and b/translations.ods differ