summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-12-22 16:21:49 +0100
committerEike Rathke <erack@redhat.com>2014-12-22 16:35:28 +0100
commitce6f9cbb5f46921ba6670c0b057463d61d05d46e (patch)
tree9178c011acd614514e7cf842d566406dbd7ae487
parentdef217464a2ac4a5d140725ba0e1247ff85fbd2e (diff)
comment on COUNTBLANK() why we do what we do
Change-Id: I67c00ad672d7509b52fd50e4b5b3e18e72dc22c2
-rw-r--r--sc/source/core/tool/interpr1.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 93d6fc65087b..252d38d0e312 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;