[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Mon Dec 22 07:35:59 PST 2014


 sc/source/core/tool/interpr1.cxx |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit ce6f9cbb5f46921ba6670c0b057463d61d05d46e
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Dec 22 16:21:49 2014 +0100

    comment on COUNTBLANK() why we do what we do
    
    Change-Id: I67c00ad672d7509b52fd50e4b5b3e18e72dc22c2

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 93d6fc6..252d38d 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1832,9 +1832,9 @@ void ScInterpreter::ScIsEmpty()
             ScAddress aAdr;
             if ( !PopDoubleRefOrSingleRef( aAdr ) )
                 break;
-            // NOTE: this could test also on inherited emptiness, but then the
-            // cell tested wouldn't be empty. Must correspond with
-            // ScCountEmptyCells().
+            // NOTE: this differs from COUNTBLANK() ScCountEmptyCells() that
+            // may treat ="" in the referenced cell as blank for Excel
+            // interoperability.
             ScRefCellValue aCell;
             aCell.assign(*pDok, aAdr);
             if (aCell.meType == CELLTYPE_NONE)
@@ -4520,6 +4520,14 @@ bool isCellContentEmpty( const ScRefCellValue& rCell )
             return false;
         case CELLTYPE_FORMULA:
         {
+            // NOTE: Excel treats ="" in a referenced cell as blank in
+            // COUNTBLANK() but not in ISBLANK(), which is inconsistent.
+            // COUNTBLANK() tests the (display) result whereas ISBLANK() tests
+            // the cell content.
+            // ODFF allows both for COUNTBLANK().
+            // OOo and LibreOffice prior to 4.4 did not treat ="" as blank in
+            // COUNTBLANK(), we now do for Excel interoperability.
+            /* TODO: introduce yet another compatibility option? */
             sc::FormulaResultValue aRes = rCell.mpFormula->GetResult();
             if (aRes.meType != sc::FormulaResultValue::String)
                 return false;


More information about the Libreoffice-commits mailing list