summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-05-04 16:27:16 -0400
committerKohei Yoshida <kyoshida@novell.com>2011-05-04 16:27:16 -0400
commit8097d32e002f21bd478b8e9ccba7cf4d4451fcda (patch)
treea1474d152acc0c8d769755b41740b4acd6462047 /sc
parent6a47e3b6427264429d571a8356a9e0d2af790884 (diff)
fdo#33137: Fixed external references with COUNTIF.
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/interpr1.cxx36
-rw-r--r--sc/source/core/tool/interpr4.cxx8
2 files changed, 22 insertions, 22 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 476eb6ef2cb0..6aa15fcba02a 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4603,7 +4603,9 @@ void ScInterpreter::ScCountIf()
}
}
break;
- case svMatrix :
+ case svMatrix:
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
ScMatValType nType = GetDoubleOrStringFromMatrix( fVal,
rString);
@@ -4648,23 +4650,25 @@ void ScInterpreter::ScCountIf()
nTab2 = nTab1;
break;
case svMatrix:
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
+ {
+ pQueryMatrix = GetMatrix();
+ if (!pQueryMatrix)
{
- pQueryMatrix = PopMatrix();
- if (!pQueryMatrix)
- {
- PushIllegalParameter();
- return;
- }
- nCol1 = 0;
- nRow1 = 0;
- nTab1 = 0;
- SCSIZE nC, nR;
- pQueryMatrix->GetDimensions( nC, nR);
- nCol2 = static_cast<SCCOL>(nC - 1);
- nRow2 = static_cast<SCROW>(nR - 1);
- nTab2 = 0;
+ PushIllegalParameter();
+ return;
}
- break;
+ nCol1 = 0;
+ nRow1 = 0;
+ nTab1 = 0;
+ SCSIZE nC, nR;
+ pQueryMatrix->GetDimensions( nC, nR);
+ nCol2 = static_cast<SCCOL>(nC - 1);
+ nRow2 = static_cast<SCROW>(nR - 1);
+ nTab2 = 0;
+ }
+ break;
default:
PushIllegalParameter();
return ;
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 1c7ecdd33c78..551a1c2e94ab 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -2350,13 +2350,9 @@ ScMatValType ScInterpreter::GetDoubleOrStringFromMatrix( double& rDouble,
ScMatrixRef pMat;
StackVar eType = GetStackType();
- if (eType == svExternalDoubleRef)
+ if (eType == svExternalDoubleRef || eType == svExternalSingleRef || eType == svMatrix)
{
- PopExternalDoubleRef(pMat);
- }
- else if (eType == svMatrix)
- {
- pMat = PopMatrix();
+ pMat = GetMatrix();
}
else
{