summaryrefslogtreecommitdiff
path: root/sw/source/core/bastyp
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-08-26 13:12:21 +0200
committerLászló Németh <nemeth@numbertext.org>2020-08-27 09:19:19 +0200
commit947b7357cc2bb0bd591e4519fa43c4b4bc3cbf2a (patch)
tree06eb350fc32fadb55451e2a09adf0457c5803356 /sw/source/core/bastyp
parent3e6f5176bf433a3f1b543b3bb9fc10d6ad72545f (diff)
tdf#123354 sw: add table formula ABS
for DOCX interoperability. See also commit e1aea22f3f4fbf0cc412a8867165a85a3c55f49c (tdf#123354 DOCX import: fix ABS formula). Change-Id: I8633ff4d4727a1e7a596312cdd62e87c07cbe730 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101402 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 3750aead867c..17179f472352 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -86,7 +86,8 @@ const char sCalc_Date[] = "date";
const char sCalc_Product[] = "product";
const char sCalc_Average[] = "average";
const char sCalc_Count[]= "count";
-const char sCalc_Sign[]= "sign";
+const char sCalc_Sign[] = "sign";
+const char sCalc_Abs[] = "abs";
// ATTENTION: sorted list of all operators
struct CalcOp
@@ -99,6 +100,7 @@ struct CalcOp
};
CalcOp const aOpTable[] = {
+/* ABS */ {{sCalc_Abs}, CALC_ABS}, // Abs (since LibreOffice 7.1)
/* ACOS */ {{sCalc_Acos}, CALC_ACOS}, // Arc cosine
/* ADD */ {{sCalc_Add}, CALC_PLUS}, // Addition
/* AND */ {{sCalc_And}, CALC_AND}, // log. AND
@@ -1072,6 +1074,10 @@ SwSbxValue SwCalc::PrimFunc(bool &rChkPow)
SAL_INFO("sw.calc", "acos");
return StdFunc(&acos, true);
break;
+ case CALC_ABS:
+ SAL_INFO("sw.calc", "abs");
+ return StdFunc(&abs, false);
+ break;
case CALC_SIGN:
{
SAL_INFO("sw.calc", "sign");