summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/tool/interpr1.cxx22
1 files changed, 20 insertions, 2 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index a42dbad7da9f..7d5b8f3d0b70 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4632,8 +4632,26 @@ void ScInterpreter::ScCountEmptyCells()
ScCellIterator aIter( pDok, aRange, glSubTotal);
for (bool bHas = aIter.first(); bHas; bHas = aIter.next())
{
- if (!aIter.hasEmptyData())
- ++nCount;
+ const ScRefCellValue& rCell = aIter.getRefCellValue();
+ switch (rCell.meType)
+ {
+ case CELLTYPE_VALUE:
+ case CELLTYPE_STRING:
+ case CELLTYPE_EDIT:
+ ++nCount;
+ break;
+ case CELLTYPE_FORMULA:
+ {
+ sc::FormulaResultValue aRes = rCell.mpFormula->GetResult();
+ if (aRes.meType != sc::FormulaResultValue::String)
+ ++nCount;
+ else if (!aRes.maString.isEmpty())
+ ++nCount;
+ }
+ break;
+ default:
+ ;
+ }
}
}
}