diff --git a/Redaction/Configuration.xba b/Redaction/Configuration.xba index 07258ef..9eaa362 100644 --- a/Redaction/Configuration.xba +++ b/Redaction/Configuration.xba @@ -1,24 +1,30 @@ 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