Consider this Basic code: > Sub TestGlobalSheetSettings > oManager = GetProcessServiceManager() > oConfigProvider = oManager.createInstance("com.sun.star.configuration.ConfigurationProvider") > Dim aArg(0 to 0) As New com.sun.star.beans.PropertyValue > aArg(0).Name = "nodepath" > aArg(0).Value = "/org.openoffice.Office.Math/Misc" > oConfigAccess = oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", aArg) > oConfigAccess.SetPropertyValue("AutoCloseBrackets", True) > oConfigAccess.SetPropertyValue("AutoCloseBrackets", Not True) > oConfigAccess.CommitChanges() > End Sub Running it, the line 'oConfigAccess.SetPropertyValue("AutoCloseBrackets", Not True)' fails with the message: > BASIC runtime error. > An exception occurred > Type: com.sun.star.lang.IllegalArgumentException > Message: configmgr inappropriate property value. The previous line, using plain boolean constant, without Not, passes fine. Tested with Version: 7.2.3.2 (x64) / LibreOffice Community Build ID: d166454616c1632304285822f9c83ce2e660fd92 CPU threads: 12; OS: Windows 10.0 Build 19043; UI render: default; VCL: win Locale: ru-RU (ru_RU); UI: en-US Calc: threaded and current master.
Just for the record, on pc Debian x86-64 with master sources updated today, I could reproduce this. I tried to dig in "value.isExtractableTo(mapType(type))" (configmgr/source/access.cxx line 1500), I understood nothing.
I suppose that the problem is related to TypeName(Not True) returning "Long", instead of expected "Boolean". But that was already that way in OOo 3.2.0. Yet, the code from comment 0 (replacing "AutoCloseBrackets" property missing in that version with "IgnoreSpacesRight") works fine in that version; it fails in OOo 3.3.0. Likely the check for the type was added in 3.3.0 release cycle. So the fix likely should be to make sure that Not + Boolean (as well as And and Or) results in Boolean.
Code pointer: https://opengrok.libreoffice.org/xref/core/basic/source/sbx/sbxvalue.cxx?r=26f46b86#846 Small test case in both MS and LO: Sub TestCase() Dim a As Boolean Dim b As Boolean a = True b = True ' MS LO LO Removing bVBAInterop MsgBox TypeName(a \ b) ' Integer Long Boolean MsgBox TypeName(a Mod b) ' Integer Long Boolean MsgBox TypeName(a And b) ' Boolean Long Boolean MsgBox TypeName(a Or b) ' Boolean Long Boolean MsgBox TypeName(a Xor b) ' Boolean Long Boolean MsgBox TypeName(a Eqv b) ' Boolean Long Boolean MsgBox TypeName(a Imp b) ' Boolean Long Boolean MsgBox TypeName(Not a) ' Boolean Boolean Boolean MsgBox TypeName(Not True) ' Boolean Long Boolean MsgBox TypeName(Not False) ' Boolean Long Boolean End Sub I would exclude the mod and the integer division from the boolean assignment.
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/565a5fdee3c00b383b4d36180be845d48fd42556 tdf#145960 - Return type of boolean operators should be of type boolean It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Andreas Heinisch committed a patch related to this issue. It has been pushed to "libreoffice-7-3": https://git.libreoffice.org/core/commit/bd7f01c4ca5222d8d3293cc81802cfd6c0bfdcc3 tdf#145960 - Return type of boolean operators should be of type boolean It will be available in 7.3.0.2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.