Check extension properties on config initialization
This commit is contained in:
parent
da680a506d
commit
09cb1f1d90
1 changed files with 12 additions and 6 deletions
|
@ -1,24 +1,30 @@
|
|||
<?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"
|
||||
Public Const redactionExtensionVersion = "0.9.10"
|
||||
Public Const redactionExtensionVersion = "0.9.8"
|
||||
Function initRedactionConfiguration()
|
||||
On Error Goto exceptionHandler
|
||||
Dim regFactory As Object
|
||||
Dim reg As Object
|
||||
Dim redactionProps As Object
|
||||
Dim props(2) As New com.sun.star.beans.PropertyValue
|
||||
|
||||
Dim propSetInfo As Object
|
||||
regFactory = CreateUnoService("com.sun.star.ucb.Store")
|
||||
reg = regFactory.createPropertySetRegistry(redactionExtensionName)
|
||||
|
||||
redactionProps = reg.openPropertySet(redactionExtensionName, TRUE)
|
||||
redactionProps.addProperty("fixes_russian_iph", 128, "true")
|
||||
redactionProps.addProperty("complexity", 128, "user")
|
||||
propSetInfo = redactionProps.getPropertySetInfo()
|
||||
If Not propSetInfo.hasPropertyByName("fixes_russian_iph") Then
|
||||
redactionProps.addProperty("fixes_russian_iph", 128, "true")
|
||||
EndIf
|
||||
If Not propSetInfo.hasPropertyByName("complexity") Then
|
||||
redactionProps.addProperty("complexity", 128, "user")
|
||||
EndIf
|
||||
exceptionHandler:
|
||||
Resume Next
|
||||
On Error Goto exceptionHandler2
|
||||
redactionProps.addProperty("defaultTemplate", 128, "Статья.ott")
|
||||
If Not propSetInfo.hasPropertyByName("complexity") Then
|
||||
redactionProps.addProperty("defaultTemplate", 128, "Статья.ott")
|
||||
EndIf
|
||||
exceptionHandler2:
|
||||
Resume Next
|
||||
initRedactionConfiguration = redactionProps
|
||||
|
|
Loading…
Add table
Reference in a new issue