61 lines
No EOL
2 KiB
XML
61 lines
No EOL
2 KiB
XML
<?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 redactionExtensionName 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(redactionExtensionName)
|
|
|
|
redactionProps = reg.openPropertySet(redactionExtensionName, TRUE)
|
|
redactionProps.addProperty("complexity", 128, "user")
|
|
initConfigureation = redactionProps
|
|
exceptionHandler:
|
|
Resume Next
|
|
initRedactionConfiguration = redactionProps
|
|
End Function
|
|
|
|
Private Sub setConfigFromDialog(dialog)
|
|
Dim config As Object
|
|
config = initRedactionConfiguration()
|
|
If dialog.getControl("CB_complexity").state = 1 Then
|
|
config.setPropertyValue("complexity", "makerUp")
|
|
Else
|
|
config.setPropertyValue("complexity", "user")
|
|
EndIf
|
|
End Sub
|
|
|
|
Private Sub loadConfigToDialog(dialog)
|
|
Dim config As Object
|
|
config = initRedactionConfiguration()
|
|
If config.getPropertyValue("complexity") = "makerUp" Then
|
|
dialog.getControl("CB_complexity").state = 1
|
|
Else
|
|
dialog.getControl("CB_complexity").state = 0
|
|
EndIf
|
|
|
|
End Sub
|
|
|
|
Private Sub configurationDialog
|
|
Dim dialog As Object
|
|
DialogLibraries.LoadLibrary("Redaction")
|
|
dialog = CreateUnoDialog(DialogLibraries.Redaction.ConfigDialog)
|
|
loadConfigToDialog(dialog)
|
|
dialog.setVisible(true)
|
|
Select Case dialog.Execute()
|
|
Case 1
|
|
setConfigFromDialog(dialog)
|
|
Case 0
|
|
End Select
|
|
|
|
dialog.setVisible(false)
|
|
dialog.dispose()
|
|
Exit sub
|
|
|
|
|
|
End Sub
|
|
</script:module> |