summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/tool/interpr6.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index cbeaa8a2443a..3a77be206acc 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -817,8 +817,12 @@ void ScInterpreter::IterateParameters( ScIterFunc eFunc, bool bTextAsZero )
if ( nGlobalError != FormulaError::NONE )
nGlobalError = FormulaError::NONE;
}
- else if ( ( eFunc == ifSUM || eFunc == ifCOUNT ) && mnSubTotalFlags == SubtotalFlags::NONE )
+ else if (((eFunc == ifSUM && !bCalcAsShown) || eFunc == ifCOUNT )
+ && mnSubTotalFlags == SubtotalFlags::NONE)
{
+ // Use fast span set array method.
+ // ifSUM with bCalcAsShown has to use the slow bells and
+ // whistles ScValueIterator below.
sc::RangeColumnSpanSet aSet( aRange );
if ( eFunc == ifSUM )