[Libreoffice-commits] core.git: sw/qa writerfilter/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Thu Aug 27 07:19:44 UTC 2020
dev/null |binary
sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 20 --------------------
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 ----
3 files changed, 24 deletions(-)
New commits:
commit 3e6f5176bf433a3f1b543b3bb9fc10d6ad72545f
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Wed Aug 26 12:49:12 2020 +0200
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Thu Aug 27 09:18:53 2020 +0200
Revert "tdf#123354 DOCX import: fix ABS formula"
This reverts commit e1aea22f3f4fbf0cc412a8867165a85a3c55f49c,
except some clean-up associated to the patch.
Change-Id: Id9f87b5a02a14ad304c755b10ab157ff0577e249
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101401
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth at numbertext.org>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf123354.docx b/sw/qa/extras/ooxmlexport/data/tdf123354.docx
deleted file mode 100644
index 15c7663c645c..000000000000
Binary files a/sw/qa/extras/ooxmlexport/data/tdf123354.docx and /dev/null differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 6df8475aaa26..e46f99e0c3e9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -69,26 +69,6 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf118701, "tdf118701.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr[1]/w:numPr", 1);
}
-DECLARE_OOXMLEXPORT_TEST(testTdf123354, "tdf123354.docx")
-{
- // Tests cell formula ABS(x) to SQRT(x POW 2) conversion
- uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
- uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
-
- uno::Reference<text::XTextField> xEnumerationAccess1(xFields->nextElement(), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("SQRT((-234) POW 2)"), xEnumerationAccess1->getPresentation(true).trim());
- CPPUNIT_ASSERT_EQUAL(OUString("234"), xEnumerationAccess1->getPresentation(false).trim());
-
- uno::Reference<text::XTextField> xEnumerationAccess2(xFields->nextElement(), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("SQRT((SUM(<A1:B1>)-SUM(<A2>)*2) POW 2)"), xEnumerationAccess2->getPresentation(true).trim());
- CPPUNIT_ASSERT_EQUAL(OUString("700035"), xEnumerationAccess2->getPresentation(false).trim());
-
- uno::Reference<text::XTextField> xEnumerationAccess3(xFields->nextElement(), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("SQRT((<A1>) POW 2)"), xEnumerationAccess3->getPresentation(true).trim());
- CPPUNIT_ASSERT_EQUAL(OUString("233423"), xEnumerationAccess3->getPresentation(false).trim());
-}
-
DECLARE_OOXMLEXPORT_TEST(testTdf123388, "tdf123388.docx")
{
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index d720e53a2a53..ce3fd3fbe3a8 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4264,10 +4264,6 @@ OUString DomainMapper_Impl::convertFieldFormula(const OUString& input) {
icu::RegexMatcher rmatch5("\\bDEFINED\\s*\\(<([A-Z]+[0-9]+)>\\)", usInput, rMatcherFlags, status);
usInput = rmatch5.replaceAll(icu::UnicodeString("DEFINED($1)"), status);
- /* Fix up ABS(x) using SQRT(x POW 2) - it supports only 1-level nesting */
- icu::RegexMatcher rmatch6("\\bABS\\s*(\\(([^()]*|([^()])*\\([^()]*\\)[^()]*)*\\))", usInput, rMatcherFlags, status);
- usInput = rmatch6.replaceAll(icu::UnicodeString("SQRT($1 POW 2)"), status);
-
return OUString(usInput.getTerminatedBuffer());
}
More information about the Libreoffice-commits
mailing list