sw/qa/extras/ww8export/data/tdf150197_anlv2ListFormat.doc |binary
 sw/qa/extras/ww8export/ww8export4.cxx                     |    7 +++++++
 sw/source/filter/ww8/ww8par2.cxx                          |    2 ++
 3 files changed, 9 insertions(+)

New commits:
commit 285f5306d75892963707b64a3782850c80d4a315
Author:     Justin Luth <[email protected]>
AuthorDate: Tue Aug 23 09:20:01 2022 -0400
Commit:     Justin Luth <[email protected]>
CommitDate: Tue Aug 23 17:52:36 2022 +0200

    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 <[email protected]>

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<text::TextContentAnchorType>(getShapeByName(u"Image2"), 
"AnchorType"));
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf150197_anlv2ListFormat, 
"tdf150197_anlv2ListFormat.doc")
+{
+    CPPUNIT_ASSERT_EQUAL(OUString("1."), 
getProperty<OUString>(getParagraph(2), "ListLabelString"));
+    CPPUNIT_ASSERT_EQUAL(OUString("2."), 
getProperty<OUString>(getParagraph(3), "ListLabelString"));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Did you fix me? I should be 2.1", 
OUString("4.1"),
+                                 getProperty<OUString>(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,

Reply via email to