summaryrefslogtreecommitdiff
path: root/formula/source
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2021-01-06 17:44:00 +0530
committerXisco Fauli <xiscofauli@libreoffice.org>2021-02-08 12:47:40 +0100
commit98ae69664918348199f5b524005ae9460e3dad58 (patch)
tree189a2e815a8bda8aafa9e5b5c5a2a1d7b1def4fe /formula/source
parent20ce9f5de3c9d3081d197b0a0138d51d75ae3950 (diff)
tdf#133858 reduce the double-ref range to data content
in certain matrix formulas like SUM(IF(A1=G:G, H:H)*B1/B2) where whole columns are used for comparison in the condition of IF ultimately followed by a reducer like SUM. In such cases we can safely reduce the double-refs involved in the comparison to the sheet area where there is data before converting the data to ScMatrix. This is a more restricted version of Noel's fix in 37ffe509ef011357123642577c04ff296d59ce68 Change-Id: I1c2e8985adedb3f4c4648f541fb0e8e7d0fae033 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109050 Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit 65167a9265acfea04733b5ff6ee3220a9da624f4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109118 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.francis@collabora.com> (cherry picked from commit b14107dd0eaf9bfc276544e1900873d36075425e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109290 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'formula/source')
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index bd1d1f082455..73669e84ff04 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1685,18 +1685,25 @@ void FormulaCompiler::Factor()
HandleIIOpCode(pFacToken, pArgArray,
std::min(nSepCount, static_cast<sal_uInt32>(FORMULA_MAXPARAMSII)));
}
+ bool bDone = false;
if (bBadName)
; // nothing, keep current token for return
else if (eOp != ocClose)
SetError( FormulaError::PairExpected);
else
+ {
NextToken();
+ bDone = true;
+ }
// Jumps are just normal functions for the FunctionAutoPilot tree view
if (!mbJumpCommandReorder && pFacToken->GetType() == svJump)
pFacToken = new FormulaFAPToken( pFacToken->GetOpCode(), nSepCount, pFacToken );
else
pFacToken->SetByte( nSepCount );
PutCode( pFacToken );
+
+ if (bDone)
+ AnnotateOperands();
}
else if (IsOpCodeJumpCommand(eOp))
{