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 358dab006806..44c3ea622d13 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4545,8 +4545,26 @@ void ScInterpreter::ScCountEmptyCells()
ScCellIterator aIter( pDok, aRange, mnSubTotalFlags);
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:
+ ;
+ }
}
}
}