summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-02-10 13:38:34 +0300
committerJustin Luth <justin_luth@sil.org>2018-02-13 05:34:03 +0100
commited8221aa0b1550834f8ca18ca3af21f2a41e678d (patch)
tree9699d1fbc6e8341a5af2f6584eb09686347e82e7 /sw/qa
parentadff6293ce22d84e5a380aa649e7d0f0ffdc4d80 (diff)
tdf#106541 preventative unit test: don't force inheritance
In LO, it appears to be impossible for a style based on a Chapter Numbering List style to inherit the numbering and outline level. Ensure that any fix for Word-authored documents that DO inherit this don't break round-tripping natively created docx files. Change-Id: I0cd4c25fbc7cd60346fcd949d5a3b89c2b311dbd Reviewed-on: https://gerrit.libreoffice.org/49544 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf106541_noinheritChapterNumbering.odtbin0 -> 13859 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf106541_noinheritChapterNumbering.odt b/sw/qa/extras/ooxmlexport/data/tdf106541_noinheritChapterNumbering.odt
new file mode 100644
index 000000000000..2408ecf550e0
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf106541_noinheritChapterNumbering.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 00448c979dbe..b7acdffbdc16 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -346,6 +346,23 @@ DECLARE_OOXMLEXPORT_TEST(testNumberingFont, "numbering-font.docx")
CPPUNIT_ASSERT_EQUAL(OUString("Verdana"), getProperty<OUString>(xStyle, "CharFontName"));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf106541_noinheritChapterNumbering, "tdf106541_noinheritChapterNumbering.odt")
+{
+ // in LO, it appears that styles based on the Chapter Numbering style explicitly sets the
+ // numbering style/outline level to 0 by default, and prevents inheriting directly from "Outline" style.
+ // Adding this preventative unit test to ensure that any fix for tdf106541 doesn't make incorrect assumptions.
+ CPPUNIT_ASSERT_EQUAL(OUString("Outline"), getProperty<OUString>(getParagraph(1), "NumberingStyleName"));
+ OUString sPara3NumberingStyle = getProperty<OUString>(getParagraph(3), "NumberingStyleName");
+ CPPUNIT_ASSERT_EQUAL(sPara3NumberingStyle, getProperty<OUString>(getParagraph(4), "NumberingStyleName"));
+
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+ assertXPath(pXmlDoc, "//body/txt/Special", 3); //three of the four paragraphs have numbering
+ assertXPath(pXmlDoc, "//body/txt[1]/Special", "rText", "1");
+ assertXPath(pXmlDoc, "//body/txt[2]/Special", 0); //second paragraph style disables numbering
+ assertXPath(pXmlDoc, "//body/txt[3]/Special", "rText", "I.");
+ assertXPath(pXmlDoc, "//body/txt[4]/Special", "rText", "II.");
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf53856_conflictingStyle, "tdf53856_conflictingStyle.docx")
{
// The "Text" style conflicted with builtin paragraph style Caption -> Text