sc/source/core/tool/interpr1.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
New commits: commit 9efba3817a5c8f426fc1af754bc97ab9b37bafa8 Author: Eike Rathke <er...@redhat.com> Date: Mon Dec 22 16:21:49 2014 +0100 comment on COUNTBLANK() why we do what we do Change-Id: I67c00ad672d7509b52fd50e4b5b3e18e72dc22c2 (cherry picked from commit ce6f9cbb5f46921ba6670c0b057463d61d05d46e) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 327b5ed..2de8c4a 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits