diff options
author | László Németh <nemeth@numbertext.org> | 2019-01-07 21:28:29 +0100 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2019-01-16 17:24:08 +0100 |
commit | b095e8f3b27331f0d646b1d33e51e17c37e43e2c (patch) | |
tree | bee32c4739475170c9a9e97d4857288e6b28f77b /writerfilter | |
parent | 95b3a12c5c55cb1696995ccba7eb5f33832fa69f (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>
(cherry picked from commit 7209feef41c3c858476a2ae9795a7d2264c0ffc0)
Reviewed-on: https://gerrit.libreoffice.org/65959
Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 326fb0df9a89..f2a14ceb8f7a 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -3402,6 +3402,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; |