From 285f5306d75892963707b64a3782850c80d4a315 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Tue, 23 Aug 2022 09:20:01 -0400 Subject: related tdf#150197 doc import: ANLV2 - always SetListFormat Any time there is numbering, we expect to see an optional sListFormat set. This solves another case found by: assert(false && "depricated format still exists and is unhandled. Inform Vasily or Justin"); Change-Id: Ie88d6ea6feaaebaae8a0953668a2801f6f1a139a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138734 Tested-by: Jenkins Reviewed-by: Justin Luth --- .../extras/ww8export/data/tdf150197_anlv2ListFormat.doc | Bin 0 -> 11264 bytes sw/qa/extras/ww8export/ww8export4.cxx | 7 +++++++ sw/source/filter/ww8/ww8par2.cxx | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 sw/qa/extras/ww8export/data/tdf150197_anlv2ListFormat.doc (limited to 'sw') diff --git a/sw/qa/extras/ww8export/data/tdf150197_anlv2ListFormat.doc b/sw/qa/extras/ww8export/data/tdf150197_anlv2ListFormat.doc new file mode 100644 index 000000000000..93d21046d607 Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf150197_anlv2ListFormat.doc differ diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx index bc0d51ff529e..e6d1d27f53a4 100644 --- a/sw/qa/extras/ww8export/ww8export4.cxx +++ b/sw/qa/extras/ww8export/ww8export4.cxx @@ -56,6 +56,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf77964) CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, getProperty(getShapeByName(u"Image2"), "AnchorType")); } +DECLARE_WW8EXPORT_TEST(testTdf150197_anlv2ListFormat, "tdf150197_anlv2ListFormat.doc") +{ + CPPUNIT_ASSERT_EQUAL(OUString("1."), getProperty(getParagraph(2), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString("2."), getProperty(getParagraph(3), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Did you fix me? I should be 2.1", OUString("4.1"), + getProperty(getParagraph(4), "ListLabelString")); +} CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index ecb757c0b89d..d075cd1d8d93 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -592,6 +592,8 @@ static void SetBaseAnlv(SwNumFormat &rNum, WW8_ANLV const &rAV, sal_uInt8 nSwLev OUString sP = "." + rNum.GetSuffix(); rNum.SetListFormat("", sP, nSwLevel); // ordinal number } + else + rNum.SetListFormat("", "", nSwLevel); } void SwWW8ImplReader::SetAnlvStrings(SwNumFormat &rNum, int nLevel, WW8_ANLV const &rAV, -- cgit