Added numberings validation
This commit is contained in:
parent
fa3ff2c16b
commit
6d4031e1aa
4 changed files with 87 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
|
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
|
||||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="ConfigDialog" dlg:left="196" dlg:top="109" dlg:width="157" dlg:height="64" dlg:closeable="true" dlg:moveable="true">
|
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="ConfigDialog" dlg:left="196" dlg:top="109" dlg:width="157" dlg:height="64" dlg:closeable="true" dlg:moveable="true">
|
||||||
<dlg:bulletinboard>
|
<dlg:bulletinboard>
|
||||||
<dlg:checkbox dlg:id="CB_complexity" dlg:tab-index="0" dlg:left="5" dlg:top="13" dlg:width="150" dlg:height="19" dlg:value="Включить расширенное управление чисткой" dlg:checked="false"/>
|
<dlg:checkbox dlg:id="CB_complexity" dlg:tab-index="0" dlg:left="5" dlg:top="13" dlg:width="150" dlg:height="19" dlg:value="Включить режим эксперта" dlg:checked="false"/>
|
||||||
<dlg:button dlg:id="OK" dlg:tab-index="1" dlg:left="9" dlg:top="45" dlg:width="59" dlg:height="13" dlg:value="Сохранить" dlg:button-type="ok"/>
|
<dlg:button dlg:id="OK" dlg:tab-index="1" dlg:left="9" dlg:top="45" dlg:width="59" dlg:height="13" dlg:value="Сохранить" dlg:button-type="ok"/>
|
||||||
<dlg:button dlg:id="CommandButton1" dlg:tab-index="2" dlg:left="-132" dlg:top="41" dlg:width="2" dlg:height="0" dlg:value="CommandButton1"/>
|
<dlg:button dlg:id="CommandButton1" dlg:tab-index="2" dlg:left="-132" dlg:top="41" dlg:width="2" dlg:height="0" dlg:value="CommandButton1"/>
|
||||||
<dlg:button dlg:id="CANCEL" dlg:tab-index="3" dlg:left="77" dlg:top="45" dlg:width="59" dlg:height="13" dlg:value="Отмена" dlg:button-type="cancel"/>
|
<dlg:button dlg:id="CANCEL" dlg:tab-index="3" dlg:left="77" dlg:top="45" dlg:width="59" dlg:height="13" dlg:value="Отмена" dlg:button-type="cancel"/>
|
||||||
|
|
|
@ -29,6 +29,7 @@ Sub validateButton
|
||||||
Dim badNumberings As Boolean
|
Dim badNumberings As Boolean
|
||||||
Dim badFootnoteSigns As Boolean
|
Dim badFootnoteSigns As Boolean
|
||||||
Dim badGraphics As Boolean
|
Dim badGraphics As Boolean
|
||||||
|
Dim needExtendedInfo As Boolean
|
||||||
badGraphics = false
|
badGraphics = false
|
||||||
badText = false
|
badText = false
|
||||||
badFootnoteSigns = false
|
badFootnoteSigns = false
|
||||||
|
@ -50,6 +51,15 @@ Sub validateButton
|
||||||
If badGraphics Then
|
If badGraphics Then
|
||||||
MsgBox graphicsReport
|
MsgBox graphicsReport
|
||||||
EndIf
|
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
|
If badText OR badNumberings OR badFootnoteSigns OR badGraphics Then
|
||||||
MsgBox "Перед публикацией документа следует исправить все найденные замечания."
|
MsgBox "Перед публикацией документа следует исправить все найденные замечания."
|
||||||
If badText Then
|
If badText Then
|
||||||
|
@ -148,6 +158,80 @@ Private Function checkAllFootnotes()
|
||||||
checkAllFootnotes = result
|
checkAllFootnotes = result
|
||||||
End Function
|
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
|
Private Sub showTrackedChanges
|
||||||
dim document as object
|
dim document as object
|
||||||
dim dispatcher as object
|
dim dispatcher as object
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:dep="http://openoffice.org/extensions/description/2006"
|
xmlns:dep="http://openoffice.org/extensions/description/2006"
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
<identifier value="pro.litvinovg.Redaction" />
|
<identifier value="pro.litvinovg.Redaction" />
|
||||||
<version value="0.5.2" />
|
<version value="0.5.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.5.1 Added validation for numberings
|
||||||
0.5.1 Added menu to control over cleaning process
|
0.5.1 Added menu to control over cleaning process
|
||||||
0.4.8 Added conversion for И + \u0306 to Й and еЕ + \u308 to ёЁ
|
0.4.8 Added conversion for И + \u0306 to Й and еЕ + \u308 to ёЁ
|
||||||
0.4.7 Added conversion for и + \u0306 to й
|
0.4.7 Added conversion for и + \u0306 to й
|
||||||
|
|
Loading…
Add table
Reference in a new issue