summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-09-25 15:03:19 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-09-25 16:05:11 -0400
commit40575c20ff9cd693b8a6d3627274ce6d745e0581 (patch)
tree9b1b4e90f66fe804ef0f57f404f00e3607740f3a /sc
parent51734600c5c9826d6c9a0d5f4cb983d08f2ab698 (diff)
Support opcodes 101 through 111 in SUBTOTAL.
Excel 2007 supports them. So should we. Change-Id: I17253bc043bdcce451ee0a7ccf494ed0f84bf3cd
Diffstat (limited to 'sc')
-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 )