From 69047ec117cd2e0885efec1824e9c00555da4800 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 4 Sep 2013 15:14:47 -0400 Subject: Correctly handle implicit intersection in group interpretation. Change-Id: I2ea6f41ad4036a6f3f5d99097e83fd988aacd105 --- sc/source/core/tool/interpr4.cxx | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'sc/source/core/tool/interpr4.cxx') diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index c6025d4bde7d..7beb5804575a 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1794,6 +1794,45 @@ ScMatrixRef ScInterpreter::PopMatrix() return NULL; } +sc::RangeMatrix ScInterpreter::PopRangeMatrix() +{ + sc::RangeMatrix aRet; + if (sp) + { + switch (pStack[sp-1]->GetType()) + { + case svMatrix: + { + --sp; + FormulaToken* p = pStack[sp]; + ScToken* p2 = static_cast(p); + aRet.mpMat = p2->GetMatrix(); + if (aRet.mpMat) + { + aRet.mpMat->SetErrorInterpreter(this); + if (p2->GetByte() == MATRIX_TOKEN_HAS_RANGE) + { + const ScComplexRefData& rRef = p2->GetDoubleRef(); + if (!rRef.Ref1.IsColRel() && !rRef.Ref1.IsRowRel() && !rRef.Ref2.IsColRel() && !rRef.Ref2.IsRowRel()) + { + aRet.mnCol1 = rRef.Ref1.Col(); + aRet.mnRow1 = rRef.Ref1.Row(); + aRet.mnCol2 = rRef.Ref2.Col(); + aRet.mnRow2 = rRef.Ref2.Row(); + } + } + } + else + SetError( errUnknownVariable); + } + break; + default: + aRet.mpMat = PopMatrix(); + } + } + return aRet; +} + void ScInterpreter::QueryMatrixType(ScMatrixRef& xMat, short& rRetTypeExpr, sal_uLong& rRetIndexExpr) { if (xMat) -- cgit v1.2.3