diff options
author | László Németh <nemeth@numbertext.org> | 2020-08-26 11:51:41 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-08-27 09:17:45 +0200 |
commit | a2b48254e4ce731edcdbd2f3fa9f6720ae676ae8 (patch) | |
tree | 42bdbd9e4f67f4bf4672f4c5473be47a8fb4a3bd | |
parent | 79681f6a35ebf70293136034d675d312c5b6cdee (diff) |
Revert "tdf#123390 DOCX import: fix SIGN formula"
This reverts commit 4d9b72d1c3929eca04c7a2e363ab6214676b0f64.
Change-Id: Icd342121c375b26ad9c95631ee118de5e0a5f585
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101397
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf123390.docx | bin | 25081 -> 0 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 24 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 6 |
3 files changed, 1 insertions, 29 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf123390.docx b/sw/qa/extras/ooxmlexport/data/tdf123390.docx Binary files differdeleted file mode 100644 index c3591dbfd2e6..000000000000 --- a/sw/qa/extras/ooxmlexport/data/tdf123390.docx +++ /dev/null diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 8436eed13a04..ae3e174ca911 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -89,30 +89,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123354, "tdf123354.docx") CPPUNIT_ASSERT_EQUAL(OUString("233423"), xEnumerationAccess3->getPresentation(false).trim()); } -DECLARE_OOXMLEXPORT_TEST(testTdf123390, "tdf123390.docx") -{ - // Tests cell formula SIGN(x) to (0 < x) - (x < 0) 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("((0 L (-11)) - ((-11) L 0))"), xEnumerationAccess1->getPresentation(true).trim()); - CPPUNIT_ASSERT_EQUAL(OUString("-1"), xEnumerationAccess1->getPresentation(false).trim()); - - uno::Reference<text::XTextField> xEnumerationAccess4(xFields->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("((0 L (<B2>)) - ((<B2>) L 0))"), xEnumerationAccess4->getPresentation(true).trim()); - CPPUNIT_ASSERT_EQUAL(OUString("0"), xEnumerationAccess4->getPresentation(false).trim()); - - uno::Reference<text::XTextField> xEnumerationAccess3(xFields->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("((0 L (0)) - ((0) L 0))"), xEnumerationAccess3->getPresentation(true).trim()); - CPPUNIT_ASSERT_EQUAL(OUString("0"), xEnumerationAccess3->getPresentation(false).trim()); - - uno::Reference<text::XTextField> xEnumerationAccess2(xFields->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("((0 L (<B1>)) - ((<B1>) L 0))"), xEnumerationAccess2->getPresentation(true).trim()); - CPPUNIT_ASSERT_EQUAL(OUString("1"), xEnumerationAccess2->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 b5a8f124c142..d720e53a2a53 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -4264,14 +4264,10 @@ 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) */ + /* 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); - /* Fix up SIGN(x) using (0 < x) - (x < 0) (it supports only 1-level nesting) */ - icu::RegexMatcher rmatch7("\\bSIGN\\s*(\\(([^()]*|([^()])*\\([^()]*\\)[^()]*)*\\))", usInput, rMatcherFlags, status); - usInput = rmatch7.replaceAll(icu::UnicodeString("((0 L $1) - ($1 L 0))"), status); - return OUString(usInput.getTerminatedBuffer()); } |