summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2019-01-07 21:28:29 +0100
committerLászló Németh <nemeth@numbertext.org>2019-01-08 11:09:11 +0100
commit7209feef41c3c858476a2ae9795a7d2264c0ffc0 (patch)
treec3b1ef7d3e0809ebcc46cbab055bf871a63a57c1 /writerfilter
parent17dd2662ccfa9d04efbea74e5d7548db5b2126d4 (diff)
tdf#122224 DOCX import: fix formula field syntax
by removing the DOCX custom number format string which caused a syntax error message here instead of the formula calculation. Change-Id: Ia643e966440117871f6b4ddceab610100ac34138 Reviewed-on: https://gerrit.libreoffice.org/65945 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 244969372080..6e2fc620fc93 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3401,6 +3401,15 @@ void DomainMapper_Impl::handleFieldFormula
uno::Reference< beans::XPropertySet > const& xFieldProperties)
{
OUString command = pContext->GetCommand().trim();
+
+ // Remove number formatting from \# to end of command
+ // TODO: handle custom number formatting
+ sal_Int32 delimPos = command.indexOf("\\#");
+ if (delimPos != -1)
+ {
+ command = command.replaceAt(delimPos, command.getLength() - delimPos, "").trim();
+ }
+
// command must contains = and at least another char
if (command.getLength() < 2)
return;