Description: The text comparison result (for example, "A" and "Z") in Basic is incorrect. Steps to Reproduce: Run Basic script Sub TestCompare Print Cbool("A"<"Z") End Sub Actual Results: False Expected Results: True Reproducible: Always User Profile Reset: Yes Additional Info: Version: 7.1.3.2 (x64) / LibreOffice Community Build ID: 47f78053abe362b9384784d31a6e56f8511eb1c1 CPU threads: 6; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win Locale: ru-RU (ru_RU); UI: ru-RU Calc: threaded
Also repro with OOo 3.2.0. Additional observations: msgbox TypeName("A"<"Z") msgbox "A"<"Z" A = "A" Z = "Z" msgbox TypeName(A < Z) msgbox A < Z gives: Integer 0 Boolean True So it's a matter of handling literals. Code pointer: SbiExprNode::FoldConstantsBinaryNode in basic/source/comp/exprnode.cxx.
Hoping to get this done within a week or so. Looks like some operators were switched in the code. I already have the fix made, but this is my first contribution, so I just have to figure out how to correctly submit the change.
PS, thanks for the code pointer Mike. That made it easy.
Should be fixed by commit 115983 (https://gerrit.libreoffice.org/c/core/+/115983)
Joshua Williams committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6cdfd89413eab85dba7b975199358cb8fae44661 tdf#142180 Swapped comparison operators for static strings It will be available in 7.2.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.
Joshua Williams committed a patch related to this issue. It has been pushed to "libreoffice-7-1": https://git.libreoffice.org/core/commit/073a78b8c4080e6fc9e4e61a614616edcb4153dc tdf#142180 Swapped comparison operators for static strings It will be available in 7.1.5. 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.
Joshua, Mike, thanks a lot!