sc/source/core/tool/interpr1.cxx |   19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 64701c68b5878209574663fd1b0ed333cd181511
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Mon Feb 15 20:28:22 2021 +0100
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Tue Feb 16 11:19:56 2021 +0100

    Resolves: tdf#66409 CELL() 2nd argument range take top-left cell
    
    ... instead of the otherwise usual intersecting position.
    
    Change-Id: I0edbf32b39e45e1c8fe8fcd7af2c84380aa4cd6c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110951
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 0d86f2c4dac9..65200917a8cc 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2243,7 +2243,6 @@ void ScInterpreter::ScCell()
         return;
 
     ScAddress aCellPos( aPos );
-    bool bError = false;
     if( nParamCount == 2 )
     {
         switch (GetStackType())
@@ -2255,13 +2254,25 @@ void ScInterpreter::ScCell()
                 ScCellExternal();
                 return;
             }
+            case svDoubleRef:
+            {
+                // Exceptionally not an intersecting position but top left.
+                // See ODF v1.3 part 4 OpenFormula 6.13.3 CELL
+                ScRange aRange;
+                PopDoubleRef( aRange);
+                aCellPos = aRange.aStart;
+            }
+            break;
+            case svSingleRef:
+                PopSingleRef( aCellPos);
+            break;
             default:
-                ;
+                PopError();
+                SetError( FormulaError::NoRef);
         }
-        bError = !PopDoubleRefOrSingleRef( aCellPos );
     }
     OUString aInfoType = GetString().getString();
-    if( bError || nGlobalError != FormulaError::NONE )
+    if (nGlobalError != FormulaError::NONE)
         PushIllegalParameter();
     else
     {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to