| Summary: | 'inappropriate property value' constructing a value of SetPropertyValue for a boolean property using Not | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Mike Kaganski <mikekaganski> |
| Component: | BASIC | Assignee: | Andreas Heinisch <andreas.heinisch> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | medium | ||
| Version: | Inherited From OOo | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | target:7.4.0 target:7.3.0.2 | ||
| Crash report or crash signature: | Regression By: | ||
|
Description
Mike Kaganski
2021-11-30 08:04:23 UTC
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. |