Added configuration storage
This commit is contained in:
parent
4858e854b4
commit
1045e9c871
3 changed files with 41 additions and 2 deletions
|
@ -1,10 +1,21 @@
|
|||
<?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="Clean" script:language="StarBasic">Sub mark21
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark23
|
||||
|
||||
End Sub
|
||||
|
||||
Sub cleanButton
|
||||
Dim config As Object
|
||||
config = initRedactionConfiguration()
|
||||
If config.getPropertyValue("complexity") = "user" then
|
||||
quietCleaning()
|
||||
Else
|
||||
makerUpMenu()
|
||||
EndIf
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub quietCleaning
|
||||
Dim description As String
|
||||
Dim statusIndicator as Object
|
||||
statusIndicator = ThisComponent.getCurrentController.statusIndicator
|
||||
|
@ -39,7 +50,7 @@ Sub cleanButton
|
|||
loadArticleStyles
|
||||
statusIndicator.end()
|
||||
saveAndreload()
|
||||
MsgBox "Чистка завершена."
|
||||
MsgBox "Чистка завершена."
|
||||
End Sub
|
||||
|
||||
Private Sub removeFirstElementPageBreak
|
||||
|
|
27
Redaction/Configuration.xba
Normal file
27
Redaction/Configuration.xba
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?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 redactionExtenstionName As String = "cleanAndValidate"
|
||||
|
||||
Function initRedactionConfiguration()
|
||||
On Error Goto exceptionHandler
|
||||
Dim regFactory As Object
|
||||
Dim reg As Object
|
||||
Dim props(2) As New com.sun.star.beans.PropertyValue
|
||||
|
||||
regFactory = CreateUnoService("com.sun.star.ucb.Store")
|
||||
reg = regFactory.createPropertySetRegistry(redactionExtenstionName)
|
||||
|
||||
redactionProps = reg.openPropertySet(redactionExtenstionName, TRUE)
|
||||
redactionProps.addProperty("complexity", 128, "user")
|
||||
initConfigureation = redactionProps
|
||||
exceptionHandler:
|
||||
Resume Next
|
||||
initRedactionConfiguration = redactionProps
|
||||
End Function
|
||||
|
||||
Sub setRedactionComplexity(complexityLevel)
|
||||
Dim config As Object
|
||||
config = initRedactionConfiguration()
|
||||
config.setPropertyValue("complexity", complexityLevel)
|
||||
End Sub
|
||||
</script:module>
|
|
@ -3,4 +3,5 @@
|
|||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Redaction" library:readonly="false" library:passwordprotected="false">
|
||||
<library:element library:name="Validation"/>
|
||||
<library:element library:name="Clean"/>
|
||||
<library:element library:name="Configuration"/>
|
||||
</library:library>
|
||||
|
|
Loading…
Add table
Reference in a new issue