sc/source/core/inc/interpre.hxx | 1 sc/source/core/tool/interpr5.cxx | 37 +++++++++++++++++++++++++----- sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 2 - 3 files changed, 33 insertions(+), 7 deletions(-)
New commits: commit a9118665637dafddd41ca549d0f73948cf1d332c Author: Justin Luth <[email protected]> Date: Mon May 22 14:24:49 2017 +0300 tdf#99227: remove unneeded specificity in unit test The unit test should only be ensuring that the drawing is in the footnote, not that it is located in the 5th character portion. Change-Id: I58040dc3498b2e78000891a26b7188dfac6c72f7 Reviewed-on: https://gerrit.libreoffice.org/37906 Tested-by: Jenkins <[email protected]> Reviewed-by: Mike Kaganski <[email protected]> Reviewed-by: Justin Luth <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index d38a6ff46364..d2f4aad276aa 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -461,7 +461,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99227, "tdf99227.docx") if (!pXmlDoc) return; - assertXPath(pXmlDoc, "//w:footnote[3]/w:p/w:r[5]/w:drawing", 1); + assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1); } DECLARE_OOXMLEXPORT_TEST(testTdf104162, "tdf104162.docx") commit 6b417ec3daaec72c736fcfe0d980ce205e589633 Author: Eike Rathke <[email protected]> Date: Mon May 22 21:13:38 2017 +0200 Handle SUMPRODUCT with svRefList arguments, tdf#58874 Change-Id: I03c2ed1f957db5ad8a67aaab45076373a020e9c1 diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 4e0ee214897c..3d994f4852ea 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -1690,28 +1690,30 @@ public: void ScInterpreter::ScSumProduct() { - sal_uInt8 nParamCount = GetByte(); + short nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 1, 30 ) ) return; ScMatrixRef pMatLast; ScMatrixRef pMat; + size_t nRefInList = 0; - pMatLast = GetMatrix(); + pMatLast = GetMatrix( nParamCount, nRefInList); if (!pMatLast) { PushIllegalParameter(); return; } + --nParamCount; SCSIZE nC, nCLast, nR, nRLast; pMatLast->GetDimensions(nCLast, nRLast); std::vector<double> aResArray; pMatLast->GetDoubleArray(aResArray); - for (sal_uInt16 i = 1; i < nParamCount; ++i) + while (nParamCount--) { - pMat = GetMatrix(); + pMat = GetMatrix( nParamCount, nRefInList); if (!pMat) { PushIllegalParameter(); commit 8b55956d6a07d1d6b62ffdf58277e6752513f4c0 Author: Eike Rathke <[email protected]> Date: Mon May 22 20:39:37 2017 +0200 Introduce GetMatrix() from svRefList, tdf#58874 Change-Id: Id3a2500c475835c54fbf02505f852bb33e1403cc diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index 29cb26c05220..9e5de664d0dc 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -435,6 +435,7 @@ ScMatrixRef CreateMatrixFromDoubleRef( const formula::FormulaToken* pToken, inline ScTokenMatrixMap& GetTokenMatrixMap(); static ScTokenMatrixMap* CreateTokenMatrixMap(); ScMatrixRef GetMatrix(); +ScMatrixRef GetMatrix( short & rParam, size_t & rInRefList ); sc::RangeMatrix GetRangeMatrix(); void ScTableOp(); // repeated operations diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 2b8e65bb8752..4e0ee214897c 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -323,7 +323,7 @@ ScMatrixRef ScInterpreter::CreateMatrixFromDoubleRef( const FormulaToken* pToken } ScTokenMatrixMap::const_iterator aIter; - if (pTokenMatrixMap && ((aIter = pTokenMatrixMap->find( pToken)) != pTokenMatrixMap->end())) + if (pToken && pTokenMatrixMap && ((aIter = pTokenMatrixMap->find( pToken)) != pTokenMatrixMap->end())) { /* XXX casting const away here is ugly; ScMatrixToken (to which the * result of this function usually is assigned) should not be forced to @@ -340,7 +340,7 @@ ScMatrixRef ScInterpreter::CreateMatrixFromDoubleRef( const FormulaToken* pToken pDok->FillMatrix(*pMat, nTab1, nCol1, nRow1, nCol2, nRow2); - if (pTokenMatrixMap) + if (pToken && pTokenMatrixMap) pTokenMatrixMap->insert( ScTokenMatrixMap::value_type( pToken, new ScMatrixToken( pMat))); return pMat; @@ -463,6 +463,29 @@ ScMatrixRef ScInterpreter::GetMatrix() return pMat; } +ScMatrixRef ScInterpreter::GetMatrix( short & rParam, size_t & rRefInList ) +{ + switch (GetRawStackType()) + { + case svRefList: + { + ScRange aRange( ScAddress::INITIALIZE_INVALID ); + PopDoubleRef( aRange, rParam, rRefInList); + if (nGlobalError != FormulaError::NONE) + return nullptr; + + SCCOL nCol1, nCol2; + SCROW nRow1, nRow2; + SCTAB nTab1, nTab2; + aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); + return CreateMatrixFromDoubleRef( nullptr, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); + } + break; + default: + return GetMatrix(); + } +} + sc::RangeMatrix ScInterpreter::GetRangeMatrix() { sc::RangeMatrix aRet; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
