From 91fe6b97952aa6f7cef58327fd085a17db38ad95 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 11:44:47 +0200 Subject: Merging upstream version 4:24.2.2. Signed-off-by: Daniel Baumann --- sw/qa/extras/ww8export/data/listWithLgl.doc | Bin 0 -> 23552 bytes sw/qa/extras/ww8export/ww8export4.cxx | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 sw/qa/extras/ww8export/data/listWithLgl.doc (limited to 'sw/qa/extras/ww8export') diff --git a/sw/qa/extras/ww8export/data/listWithLgl.doc b/sw/qa/extras/ww8export/data/listWithLgl.doc new file mode 100644 index 0000000000..94de2967fe Binary files /dev/null and b/sw/qa/extras/ww8export/data/listWithLgl.doc differ diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx index d47c934d9d..d31bf17a31 100644 --- a/sw/qa/extras/ww8export/ww8export4.cxx +++ b/sw/qa/extras/ww8export/ww8export4.cxx @@ -228,6 +228,30 @@ DECLARE_WW8EXPORT_TEST(testInlinePageBreakFirstLine, "inlinePageBreakFirstLine.d CPPUNIT_ASSERT(IsFirstLine(aTextNodes[2])); } +CPPUNIT_TEST_FIXTURE(Test, testLegalNumbering) +{ + auto verify = [this]() { + // Second level's numbering should use Arabic numbers for first level reference + auto xPara = getParagraph(1); + CPPUNIT_ASSERT_EQUAL(OUString("CH I"), getProperty(xPara, "ListLabelString")); + xPara = getParagraph(2); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: Sect 1.01 + // - Actual : Sect I.01 + // i.e. fLegal was ignored on import/export. + CPPUNIT_ASSERT_EQUAL(OUString("Sect 1.01"), getProperty(xPara, "ListLabelString")); + xPara = getParagraph(3); + CPPUNIT_ASSERT_EQUAL(OUString("CH II"), getProperty(xPara, "ListLabelString")); + xPara = getParagraph(4); + CPPUNIT_ASSERT_EQUAL(OUString("Sect 2.01"), getProperty(xPara, "ListLabelString")); + }; + + createSwDoc("listWithLgl.doc"); + verify(); + saveAndReload(mpFilter); + verify(); +} + DECLARE_WW8EXPORT_TEST(testNonInlinePageBreakFirstLine, "nonInlinePageBreakFirstLine.doc") { SwDoc* pDoc = getSwDoc(); -- cgit v1.2.3