summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/interpr1.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/tool/interpr1.cxx')
-rw-r--r--sc/source/core/tool/interpr1.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 876748cd14a2..68269a331de9 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -6578,10 +6578,20 @@ void ScInterpreter::ScSubTotal()
const FormulaToken* p = pStack[ sp - nParamCount ];
PushTempToken( *p );
int nFunc = (int) ::rtl::math::approxFloor( GetDouble() );
+ bool bIncludeHidden = true;
+ if (nFunc > 100)
+ {
+ // For opcodes 101 through 111, we need to skip hidden cells.
+ // Other than that these opcodes are identical to 1 through 11.
+ bIncludeHidden = false;
+ nFunc -= 100;
+ }
+
if( nFunc < 1 || nFunc > 11 )
PushIllegalArgument(); // simulate return on stack, not SetError(...)
else
{
+ // TODO: Make use of bIncludeHidden flag. Then it's false, we do need to skip hidden cells.
cPar = nParamCount - 1;
glSubTotal = true;
switch( nFunc )