diff options
author | Eike Rathke <erack@redhat.com> | 2014-12-22 16:21:49 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-12-22 16:54:26 +0100 |
commit | 9efba3817a5c8f426fc1af754bc97ab9b37bafa8 (patch) | |
tree | 3992618dde71fce23b9895dc9f5b6725c17e7ed6 /sc/source | |
parent | 1fa4783084d495eda9b0cfcab18b193ce3183a4a (diff) |
comment on COUNTBLANK() why we do what we do
Change-Id: I67c00ad672d7509b52fd50e4b5b3e18e72dc22c2
(cherry picked from commit ce6f9cbb5f46921ba6670c0b057463d61d05d46e)
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 327b5edddee8..2de8c4a148d6 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) @@ -4522,6 +4522,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; |