Created attachment 64803 [details] Excel file with macro In some cases Excel Visual Basic code in LibreOffice working with additional parenthesize only! Example for "If", the following code works in Excel but not in Calc: If Not LCase(Range("A1").Value) Like "*date*from*to*" Then This code works in Calc: If Not (LCase(Range("A1").Value) Like "*date*from*to*") Then Example macro: Sub Test_LIKE_not_ok() ' Preparing Test: Range("A2").FormulaR1C1 = "Date from 12.01.2001 to 31.12.2020" Range("A2").Select ' Testing Excel VBA Code in Libre Office: If Not LCase(Range("A2").Value) Like "*date*from*to*" Then MsgBox "Muster '*date*from*to*' not found!" Else MsgBox "Muster '*date*from*to*' found!" End If End Sub
This bug occurs in LibreOffice version 3.5.6 and 3.6.1
On pc Debian x86-64 with master sources updated yesterday, I can reproduce this. Noel: put you in cc since you might be interested in this one.
This bug was also reproduced in newer versions of LibreOffice for Windows! Tested with LibreOffice versions: 4.0.4.2, 4.1.4.2 and 4.2.0.4
This bug was reproduced also in LibreOffice Calc version 4.2.3.3 and 4.2.4.1 rc!
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (4.4.3 or later) https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results; 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for your help! -- The LibreOffice QA Team This NEW Message was generated on: 2015-06-08
The problem still exists! This bug was also reproduced in LibreOffice 4.4.3.2!
This problem still exists and was also reproduced in LibreOffice versions 4.4.7.2, 5.0.4.2, 5.1.1.3 and 5.1.4.2 for Windows. (Test system: Windows 7 64-bit, Intel Core2Duo P8700 2.53 Ghz, 4 GB RAM, Java SE Runtime Environment build 1.6.0_24-b07)
Changing version back to the earliest affected version.
* Explanations are often easier to understand when we begin with easy lessons, even if the lessons are not directly focusing the problem I'm facing. * To begin with, let's take a look at the following code SbiExprNode* SbiExpression::Comp() https://opengrok.libreoffice.org/xref/core/basic/source/comp/exprtree.cxx?r=85d71244#727 * I see Cat() called in Comp(). This means string concatenation binary operator has stronger associativity the expression a & b < c is interpreted as ((a & b) < c) , but not as (a & (b < c)) * now let's move onto SbiExprNode* SbiExpression::Like() https://opengrok.libreoffice.org/xref/core/basic/source/comp/exprtree.cxx?r=85d71244#727 * when VBASupport is 0, https://opengrok.libreoffice.org/xref/core/basic/source/comp/exprtree.cxx?r=85d71244#754 "NOT" keyword is handled deeper callees inside Comp. * when VBASupport is 1 "NOT" keyword is handled in VBA_not and there Comp is called later. This two descriptions mean the following results from the same code. in VBASupport 1 NOT 3 < 5 => (NOT (3 < 5)) => (NOT (-1)) => 0 in VBASupport 0 ((NOT 3) < 5) (-4 < 5) -1 Likewise we can say -2^2 is (-2)^2 in VBASupport 0, VBASupport 1, and cell formulas in Calc and Excel. In MS Office VBA, the expression is -(2^2) *in both VBASuppport 0 and in VBASupport 1 as NOT has higher associativity than LIKE, the result of the following code is as follows NOT "xyz" LIKE "xyz" =>((NOT "xyz") LIKE "xyz") but not (NOT ("xyz" LIKE "xyz")) Here we try to evaluate (NOT "xyz") and give up. (runtime error, not compile error) *If the function used returns boolean or Integer, the code runs without giving runtime error. the result of NOT operation seems to be converted to string and passed to LIKE operator's first operand. Sub Main() Msgbox(NOT Foo("bar") LIKE "Meaningless sample text : - NOT 13 gives compile error when VBASupport is 1. I don't know the intention of If statement in SbiExpression::Unary()") End Sub Function Foo(meaninglessparameter as string) As Integer Foo = 1 End Function
Oops,typo. now let's move onto SbiExprNode* SbiExpression::Like() https://opengrok.libreoffice.org/xref/core/basic/source/comp/exprtree.cxx?r=85d71244#771
Code tested with "Option VBASupport 1" and the newest version of LibreOffice 5.4.2 (5.4.2.2 for Windows) Still the same problem the code: If Not LCase(Range("A2").Value) Like "*date*from*to*" Then [...] End If It works in MS Excel without any problems but not in LibreOffice!
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
Dear Tor24_1975314, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
This bug was tested again and it can be confirmed that this issue still exists. Tested versions of LibreOffice: LibreOffice 6.4.6.2 (x86) for Windows and LibreOffice 7.0.1.2 (x86) for Windows Installed Java version: Java(TM) SE Runtime Environment (build 1.8.0_231-b11) This test was done using the Excel file as attached in the first bug report.
Dear Tor24_1975314, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug