summaryrefslogtreecommitdiff
path: root/sw/source/core/bastyp
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-08-25 10:11:50 +0200
committerLászló Németh <nemeth@numbertext.org>2020-08-25 12:27:18 +0200
commit267da17721fae4708c0168b9a1e2917cae38628b (patch)
tree880dcb8780451d58b91a3c3f23263f40d3e1220b /sw/source/core/bastyp
parenteef202b0659a8ef5f2c1d0b38f292039f0ceaa8d (diff)
tdf#123388 sw: add PRODUCT table formula
for DOCX interoperability. Change-Id: Icd19d1e0025e76bc3ff00a347fa2743ed7c8ee06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101306 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/bastyp')
-rw-r--r--sw/source/core/bastyp/calc.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 8d0bc3f5fa34..b604ff49d066 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -83,6 +83,7 @@ const char sCalc_Acos[] = "acos";
const char sCalc_Atan[] = "atan";
const char sCalc_Round[]= "round";
const char sCalc_Date[] = "date";
+const char sCalc_Product[] = "product";
// ATTENTION: sorted list of all operators
struct CalcOp
@@ -117,6 +118,7 @@ CalcOp const aOpTable[] = {
/* OR */ {{sCalc_Or}, CALC_OR}, // log. OR
/* PHD */ {{sCalc_Phd}, CALC_PHD}, // Percentage
/* POW */ {{sCalc_Pow}, CALC_POW}, // Exponentiation
+/* PRODUCT */ {{sCalc_Product}, CALC_PRODUCT}, // Product
/* ROUND */ {{sCalc_Round}, CALC_ROUND}, // Rounding
/* SIN */ {{sCalc_Sin}, CALC_SIN}, // Sine
/* SQRT */ {{sCalc_Sqrt}, CALC_SQRT}, // Square root
@@ -675,6 +677,9 @@ SwCalcOper SwCalc::GetToken()
case CALC_DATE:
m_eCurrListOper = CALC_MONTH;
break;
+ case CALC_PRODUCT:
+ m_eCurrListOper = CALC_MUL;
+ break;
default:
break;
}
@@ -1192,11 +1197,12 @@ SwSbxValue SwCalc::PrimFunc(bool &rChkPow)
break;
}
case CALC_SUM:
+ case CALC_PRODUCT:
case CALC_DATE:
case CALC_MIN:
case CALC_MAX:
{
- SAL_INFO("sw.calc", "sum/date/min/max");
+ SAL_INFO("sw.calc", "sum/product/date/min/max");
GetToken();
SwSbxValue nErg = Expr();
return nErg;