formula/source/core/api/FormulaCompiler.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 047351c2f9997dcd345c00c1bc1f0d72c8d62ed9
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Tue Sep 8 21:18:30 2020 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Wed Sep 9 13:24:27 2020 +0200

    Resolves: tdf#136364 treat svSep type with ocUnion as range type
    
    So for RPN
    sv...Ref(ocPush), sv...Ref(ocPush), svSep(ocUnion), sv...Ref(ocPush)
    another svSep(ocUnion) instead of svSep(ocSep) is appended.
    
    Regression from
    
        commit a6032ff5418ad66cc8fec10c636e32b124ee7864
        CommitDate: Thu Oct 11 11:26:37 2018 +0200
    
            Resolves: tdf#90698 catch list (1;2) of non-references as error
    
    that introduced a conditional check on operands and operators.
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102276
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit e00e2be30436b636d93f8852bb6af44972638a7c)
    
    Change-Id: If5da3a781f24f891ff12c4a8f32a2ec92c6b4c8a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102279
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 03386af3cd07..16e58f9c8e71 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -308,7 +308,7 @@ bool isRangeResultOpCode( OpCode eOp )
     @param  bRight
             If bRPN==false, bRight==false means opcodes for left side are
             checked, bRight==true means opcodes for right side. If bRPN==true
-            it doesn't matter.
+            it doesn't matter except for the ocSep converted to ocUnion case.
  */
 bool isPotentialRangeType( FormulaToken const * pToken, bool bRPN, bool bRight 
)
 {
@@ -329,6 +329,10 @@ bool isPotentialRangeType( FormulaToken const * pToken, 
bool bRPN, bool bRight )
         case svExternalDoubleRef:
         case svExternalName:        // could be range
             return true;
+        case svSep:
+            // A special case if a previous ocSep was converted to ocUnion it
+            // stays svSep instead of svByte.
+            return bRPN && !bRight && pToken->GetOpCode() == ocUnion;
         default:
             // Separators are not part of RPN and right opcodes need to be
             // other StackVar types or functions and thus svByte.
@@ -1410,6 +1414,7 @@ void FormulaCompiler::Factor()
                         && ((p = pCode[-1]) != nullptr) && 
isPotentialRangeType( p, true, true))
                 {
                     pFacToken->NewOpCode( ocUnion, 
FormulaToken::PrivateAccess());
+                    // XXX NOTE: the token's eType is still svSep here!
                     PutCode( pFacToken);
                 }
             }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to