diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-11-13 09:45:47 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-11-13 14:54:36 +0100 |
commit | 65d6173152deab49f9c9ed138f6d9fa56008b800 (patch) | |
tree | 641247c55616d5eb89bb1bbbea30340ac406d824 /writerfilter/qa | |
parent | dd2532203b7928d5f06de96da7f15d45d9c38d80 (diff) |
DOCX import: lost cached result of fields: fix leading whitespace
" IF " and "IF " is the same, but "IFF " is something different.
Change-Id: Ieb2d128d28ed3daa3df73128804bcc40dda9878d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105783
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'writerfilter/qa')
-rw-r--r-- | writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx | 9 | ||||
-rw-r--r-- | writerfilter/qa/cppunittests/dmapper/data/field-if-inside-if.docx | bin | 12778 -> 12874 bytes |
2 files changed, 9 insertions, 0 deletions
diff --git a/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx b/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx index c7df72b25703..77bd616f37d6 100644 --- a/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx @@ -179,6 +179,15 @@ CPPUNIT_TEST_FIXTURE(Test, testFieldIfInsideIf) // - Actual : 0** Expression is faulty **2 // i.e. some of the inner fields escaped outside the outer field. CPPUNIT_ASSERT_EQUAL(OUString("2"), xCell->getString()); + + // Test the second cell: it contains "IF ", not the usual " IF ". + xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); + + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 25 + // - Actual : 025 + // i.e. some of the inner fields escaped outside the outer field. + CPPUNIT_ASSERT_EQUAL(OUString("25"), xCell->getString()); } } diff --git a/writerfilter/qa/cppunittests/dmapper/data/field-if-inside-if.docx b/writerfilter/qa/cppunittests/dmapper/data/field-if-inside-if.docx Binary files differindex 93aaab52d497..65e238869b1b 100644 --- a/writerfilter/qa/cppunittests/dmapper/data/field-if-inside-if.docx +++ b/writerfilter/qa/cppunittests/dmapper/data/field-if-inside-if.docx |