diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-01-24 09:37:38 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-01-24 09:42:18 +0000 |
commit | 22c292a2a9f4f459539d042ad902441a3583c804 (patch) | |
tree | b3a82b20bdc058b55b58f45f535c818a7520af91 /sw/qa | |
parent | a90ef17809071b808a8c703e7e47e045ddabcd4a (diff) |
The resolved style name *can* be empty in redlines
I assumed otherwise in commit 20adf4683c7d38ad41edac586b897757393c8029
("tdf#152425 related: don't generate style ids in DocxAttributeOutput::Redline",
2023-01-13). But the string that we try to resolve may come from original file,
and so must be treated as arbitrary user input, which may not resolve to a
known style.
This basically reverts commit 20adf4683c7d38ad41edac586b897757393c8029.
Change-Id: Ia6cbce1b9601df2c15edbab653b9b629d52d5ff6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146055
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/UnknownStyleInRedline.docx | bin | 0 -> 14030 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 11 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/UnknownStyleInRedline.docx b/sw/qa/extras/ooxmlexport/data/UnknownStyleInRedline.docx Binary files differnew file mode 100644 index 000000000000..37457fe1e82b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/UnknownStyleInRedline.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index e27a1f085b11..1be945cb9f49 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -309,6 +309,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153128) CPPUNIT_ASSERT_LESS(sal_Int32(30), nFirstLineHeight); } +CPPUNIT_TEST_FIXTURE(Test, testExportingUnknownStyleInRedline) +{ + // This must not fail assertions + loadAndReload("UnknownStyleInRedline.docx"); + // Check that the original unknown style name "UnknownStyle" is roundtripped + // (maybe this is wrong, because Word does not do this). + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, + "/w:document/w:body/w:p/w:pPr/w:pPrChange/w:pPr/w:pStyle[@w:val='UnknownStyle']"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |