Code cleaning
This commit is contained in:
parent
efd45c1c6d
commit
20b7f57087
4 changed files with 41 additions and 39 deletions
|
@ -102,7 +102,7 @@ End Sub
|
||||||
|
|
||||||
Private Sub quietCleaning
|
Private Sub quietCleaning
|
||||||
Dim description As String
|
Dim description As String
|
||||||
Dim statusIndicator as Object
|
Dim statusIndicator As Object
|
||||||
statusIndicator = ThisComponent.getCurrentController.statusIndicator
|
statusIndicator = ThisComponent.getCurrentController.statusIndicator
|
||||||
description = "Вы уверены, что хотите выполнить чистку документа?"
|
description = "Вы уверены, что хотите выполнить чистку документа?"
|
||||||
If NOT confirm(description) Then
|
If NOT confirm(description) Then
|
||||||
|
@ -442,7 +442,6 @@ Private Function getTemplatePath() as String
|
||||||
params(0).Name = "nodepath"
|
params(0).Name = "nodepath"
|
||||||
params(0).Value = "/org.openoffice.Office.Paths/Paths"
|
params(0).Value = "/org.openoffice.Office.Paths/Paths"
|
||||||
settings = configProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", params() )
|
settings = configProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", params() )
|
||||||
|
|
||||||
path = settings.Template.WritePath
|
path = settings.Template.WritePath
|
||||||
convService = CreateUnoService("com.sun.star.util.PathSubstitution")
|
convService = CreateUnoService("com.sun.star.util.PathSubstitution")
|
||||||
path = convService.substituteVariables(path, true)
|
path = convService.substituteVariables(path, true)
|
||||||
|
|
|
@ -14,7 +14,7 @@ Function initRedactionConfiguration()
|
||||||
|
|
||||||
redactionProps = reg.openPropertySet(redactionExtensionName, TRUE)
|
redactionProps = reg.openPropertySet(redactionExtensionName, TRUE)
|
||||||
redactionProps.addProperty("complexity", 128, "user")
|
redactionProps.addProperty("complexity", 128, "user")
|
||||||
initConfigureation = redactionProps
|
initRedactionConfiguration = redactionProps
|
||||||
exceptionHandler:
|
exceptionHandler:
|
||||||
Resume Next
|
Resume Next
|
||||||
initRedactionConfiguration = redactionProps
|
initRedactionConfiguration = redactionProps
|
||||||
|
|
|
@ -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 markval1
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">Sub markval2
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
@ -84,8 +84,7 @@ Private Function checkGraphics() As String
|
||||||
Dim drawingN As Long
|
Dim drawingN As Long
|
||||||
drawingN = 0
|
drawingN = 0
|
||||||
drawPages = ThisComponent.DrawPage
|
drawPages = ThisComponent.DrawPage
|
||||||
' Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
|
Dim i As Integer
|
||||||
' MRI ThisComponent
|
|
||||||
count = drawPages.getCount()
|
count = drawPages.getCount()
|
||||||
For i = 0 to count-1
|
For i = 0 to count-1
|
||||||
draw = drawPages.getByIndex(i)
|
draw = drawPages.getByIndex(i)
|
||||||
|
@ -94,10 +93,7 @@ Private Function checkGraphics() As String
|
||||||
drawingN = drawingN + 1
|
drawingN = drawingN + 1
|
||||||
EndIf
|
EndIf
|
||||||
If InStr(shapeType,"FrameShape") = 1 Then
|
If InStr(shapeType,"FrameShape") = 1 Then
|
||||||
' Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
|
|
||||||
' MRI draw
|
|
||||||
If draw.supportsService("com.sun.star.text.TextEmbeddedObject") Then
|
If draw.supportsService("com.sun.star.text.TextEmbeddedObject") Then
|
||||||
|
|
||||||
embeededObject = draw.getEmbeddedObject()
|
embeededObject = draw.getEmbeddedObject()
|
||||||
If IsNull(embeededObject) Then
|
If IsNull(embeededObject) Then
|
||||||
badFrame = badFrame + 1
|
badFrame = badFrame + 1
|
||||||
|
@ -137,9 +133,10 @@ Private Function checkAllFootnotes() As String
|
||||||
result = ""
|
result = ""
|
||||||
footnotes = ThisComponent.Footnotes
|
footnotes = ThisComponent.Footnotes
|
||||||
count = footnotes.getCount
|
count = footnotes.getCount
|
||||||
|
Dim i As Integer
|
||||||
|
Dim j As Integer
|
||||||
For i = 0 to count-1
|
For i = 0 to count-1
|
||||||
footnote = footnotes.getByIndex(i)
|
footnote = footnotes.getByIndex(i)
|
||||||
' Mri footnote
|
|
||||||
label = footnote.Label
|
label = footnote.Label
|
||||||
charNum = Len(label)
|
charNum = Len(label)
|
||||||
For j = 1 to charNum
|
For j = 1 to charNum
|
||||||
|
@ -165,8 +162,10 @@ Private Sub printNumberingSymbols(needExtendedInfo)
|
||||||
Dim fontName As String
|
Dim fontName As String
|
||||||
Dim result As String
|
Dim result As String
|
||||||
Dim resultBad As String
|
Dim resultBad As String
|
||||||
dim excerpt As String
|
Dim excerpt As String
|
||||||
dim exLength As Integer
|
Dim exLength As Integer
|
||||||
|
Dim report As String
|
||||||
|
Dim k As Integer
|
||||||
families = ThisComponent.StyleFamilies
|
families = ThisComponent.StyleFamilies
|
||||||
numStyles = families.getByName("NumberingStyles")
|
numStyles = families.getByName("NumberingStyles")
|
||||||
result = ""
|
result = ""
|
||||||
|
@ -213,7 +212,7 @@ Private Sub printNumberingSymbols(needExtendedInfo)
|
||||||
EndIf
|
EndIf
|
||||||
EndIf
|
EndIf
|
||||||
Loop
|
Loop
|
||||||
dim report as String
|
|
||||||
report = ""
|
report = ""
|
||||||
If result = "" AND resultBad = "" Then
|
If result = "" AND resultBad = "" Then
|
||||||
Exit sub
|
Exit sub
|
||||||
|
@ -242,6 +241,8 @@ Private Sub showTrackedChanges
|
||||||
end Sub
|
end Sub
|
||||||
|
|
||||||
Private Sub StartTracking
|
Private Sub StartTracking
|
||||||
|
Dim dispatcher As Object
|
||||||
|
Dim document As Object
|
||||||
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
|
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
|
||||||
document = ThisComponent.CurrentController.Frame
|
document = ThisComponent.CurrentController.Frame
|
||||||
dim trackProperties(0) as new com.sun.star.beans.PropertyValue
|
dim trackProperties(0) as new com.sun.star.beans.PropertyValue
|
||||||
|
@ -255,13 +256,15 @@ Private Sub StartTracking
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub StopTracking
|
Private Sub StopTracking
|
||||||
|
Dim dispatcher As Object
|
||||||
|
Dim document As Object
|
||||||
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
|
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
|
||||||
document = ThisComponent.CurrentController.Frame
|
document = ThisComponent.CurrentController.Frame
|
||||||
dim trackProperties(0) as new com.sun.star.beans.PropertyValue
|
Dim trackProperties(0) as new com.sun.star.beans.PropertyValue
|
||||||
trackProperties(0).Name = "TrackChanges"
|
trackProperties(0).Name = "TrackChanges"
|
||||||
trackProperties(0).Value = false
|
trackProperties(0).Value = false
|
||||||
dispatcher.executeDispatch(document, ".uno:TrackChanges", "", 0, trackProperties())
|
dispatcher.executeDispatch(document, ".uno:TrackChanges", "", 0, trackProperties())
|
||||||
dim args1(0) as new com.sun.star.beans.PropertyValue
|
Dim args1(0) as new com.sun.star.beans.PropertyValue
|
||||||
args1(0).Name = "ShowTrackedChanges"
|
args1(0).Name = "ShowTrackedChanges"
|
||||||
args1(0).Value = true
|
args1(0).Value = true
|
||||||
dispatcher.executeDispatch(document, ".uno:ShowTrackedChanges", "", 0, args1())
|
dispatcher.executeDispatch(document, ".uno:ShowTrackedChanges", "", 0, args1())
|
||||||
|
|
|
@ -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.9" />
|
<version value="0.5.10" />
|
||||||
<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>
|
||||||
|
|
Loading…
Add table
Reference in a new issue