sc/source/core/tool/compiler.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 51a0a85247fab56040416e40b7c7d878689acb26
Author:     Eike Rathke <[email protected]>
AuthorDate: Tue Nov 23 18:38:27 2021 +0100
Commit:     Eike Rathke <[email protected]>
CommitDate: Tue Nov 23 23:57:31 2021 +0100

    Resolves: ofz#41299 Rewind also on last resort #REF! IsReference()
    
    Otherwise for #ref!e:o NextNewToken() bailed out with an
    uninitialized maRawToken.
    
    Change-Id: I8b3b399a5a3636ccda3104ba2a5971e5e9a8fc02
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125736
    Reviewed-by: Eike Rathke <[email protected]>
    Tested-by: Jenkins

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 2c8bf6c5655b..dfed2b0e0202 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4433,6 +4433,8 @@ bool ScCompiler::NextNewToken( bool bInArray )
 
     OUString aUpper;
 
+Label_Rewind:
+
     do
     {
         const OUString aOrg( cSymbol );
@@ -4566,7 +4568,11 @@ bool ScCompiler::NextNewToken( bool bInArray )
     // and 2016 until 5.1.4
     OUString aErrRef( mxSymbols->getSymbol( ocErrRef));
     if (aUpper.indexOf( aErrRef) >= 0 && IsReference( aUpper, &aErrRef))
+    {
+        if (mbRewind)
+            goto Label_Rewind;
         return true;
+    }
 
     if ( meExtendedErrorDetection != EXTENDED_ERROR_DETECTION_NONE )
     {

Reply via email to