diff --git a/Redaction/ConfigDialog.xdl b/Redaction/ConfigDialog.xdl index 5e124fd..6c6d7e3 100644 --- a/Redaction/ConfigDialog.xdl +++ b/Redaction/ConfigDialog.xdl @@ -2,7 +2,7 @@ - + diff --git a/Redaction/Validation.xba b/Redaction/Validation.xba index 6832422..35a9fd5 100644 --- a/Redaction/Validation.xba +++ b/Redaction/Validation.xba @@ -29,6 +29,7 @@ Sub validateButton Dim badNumberings As Boolean Dim badFootnoteSigns As Boolean Dim badGraphics As Boolean + Dim needExtendedInfo As Boolean badGraphics = false badText = false badFootnoteSigns = false @@ -50,6 +51,15 @@ Sub validateButton 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 MsgBox "Перед публикацией документа следует исправить все найденные замечания." If badText Then @@ -148,6 +158,80 @@ Private Function checkAllFootnotes() checkAllFootnotes = result End Function +Private Sub printNumberingSymbols(needExtendedInfo) + Dim families As Object + Dim numStyles As Object + Dim numStyle As Object + Dim numRules As Object + Dim numRule As Object + Dim prop As Object + Dim enum1 As Object + Dim enum1Element As Object + Dim fontProp As Object + Dim fontName As String + Dim result As String + Dim resultBad As String + dim excerpt As String + dim exLength As Integer + families = ThisComponent.StyleFamilies + numStyles = families.getByName("NumberingStyles") + result = "" + resultBad = "" + enum1 = ThisComponent.Text.createEnumeration + Do While enum1.hasMoreElements + enum1Element = enum1.nextElement + If enum1Element.supportsService("com.sun.star.text.Paragraph") Then + If NOT IsMissing(enum1Element.NumberingRules) AND NOT IsEmpty(enum1Element.NumberingRules) Then + numRules = enum1Element.NumberingRules + If numRules.hasElements Then + numRule = numRules.getByIndex(enum1Element.NumberingLevel) + fontName = "" + fontChar = "" + For k = 0 To Ubound(numRule) + prop = numRule(k) + If prop.Name = "BulletFont" Then + fontName = prop.Value.Name + EndIf + If prop.Name = "BulletChar" Then + fontChar = prop.Value + EndIf + Next k + exLength = 15 + excerpt = enum1Element.String + If Len(excerpt) < exLength Then + exLength = Len(excerpt) + EndIf + tmp = "Уровень " & (j + 1) & " шрифт " & fontName & " символ " & fontChar & " (" & Hex(Asc(fontChar)) & ") "& Left(excerpt,exLength) & chr(10) + If Asc(fontChar) > 57344 AND Asc(fontChar) < 63743 Then + resultBad = resultBad & tmp + ElseIf fontName <> "IPH Astra Serif" _ + AND fontName <> "OpenSymbol" _ + AND fontName <> "IPH Lib Serif" _ + AND fontName <> "IPH Lib Sans" _ + AND fontName <> "Liberation Serif" _ + AND fontName <> "Liberation Sans" _ + AND needExtendedInfo Then + result = result & tmp + EndIf + EndIf + EndIf + EndIf + Loop + dim report as String + report = "" + If result = "" AND resultBad = "" Then + Exit sub + Else + If resultBad <> "" Then + report = "Маркером в следующих списках нумерации задан некорректный символ"& chr(10) & resultBad + EndIf + If result <> "" Then + report = report & "В следующих списках нумерации найдены шрифты "& chr(10)& result + EndIf + EndIf + MsgBox report +End Sub + Private Sub showTrackedChanges dim document as object dim dispatcher as object diff --git a/description.xml b/description.xml index 46e9430..81f2afc 100644 --- a/description.xml +++ b/description.xml @@ -3,7 +3,7 @@ xmlns:dep="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink"> - + Cleaning and validation documents for publishing in html and epub with pagination diff --git a/releasenotes.txt b/releasenotes.txt index 64d8b1c..c7478e2 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -1,3 +1,4 @@ +0.5.1 Added validation for numberings 0.5.1 Added menu to control over cleaning process 0.4.8 Added conversion for И + \u0306 to Й and еЕ + \u308 to ёЁ 0.4.7 Added conversion for и + \u0306 to й