sw/qa/extras/ww8export/ww8export2.cxx |  129 ++++++++++++++++------------------
 sw/qa/extras/ww8export/ww8export3.cxx |   93 ++++++++++++------------
 2 files changed, 109 insertions(+), 113 deletions(-)

New commits:
commit 9018cf4d1c39a21e22c720ddcaaa696bb8ea5761
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Oct 16 10:16:54 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Oct 16 11:34:50 2024 +0200

    ww8export: drop isExported
    
    Change-Id: I3eb65c8d9666d6f0a22360a691938e9e82ccd3d9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174990
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/extras/ww8export/ww8export2.cxx 
b/sw/qa/extras/ww8export/ww8export2.cxx
index 910789fdef7e..510b522ee432 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -144,60 +144,67 @@ DECLARE_WW8EXPORT_TEST(testTdf49102_mergedCellNumbering, 
"tdf49102_mergedCellNum
 
 CPPUNIT_TEST_FIXTURE(Test, testTdf55427_footnote2endnote)
 {
-    loadAndReload("tdf55427_footnote2endnote.odt");
-    uno::Reference<beans::XPropertySet> 
xPageStyle(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Footnote"_ustr), 
uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote style is rose color", 
Color(0xFF007F), getProperty< Color >(xPageStyle, u"CharColor"_ustr));
-    
xPageStyle.set(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Endnote"_ustr), 
uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Endnote style is cyan3 color", 
Color(0x2BD0D2), getProperty< Color >(xPageStyle, u"CharColor"_ustr));
-
-    SwXTextDocument* pTextDoc = 
dynamic_cast<SwXTextDocument*>(mxComponent.get());
-    CPPUNIT_ASSERT(pTextDoc);
-    SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
-    // The footnote numbering type of ARABIC will not transfer over when those 
footnotes are converted to endnotes.
-    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote numbering type", SVX_NUM_ARABIC, 
pDoc->GetFootnoteInfo().m_aFormat.GetNumberingType() );
-    // The original document has a real endnote using ROMAN_LOWER numbering, 
so that setting MUST remain unchanged.
-    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Endnote numbering type", 
SVX_NUM_ROMAN_LOWER, pDoc->GetEndNoteInfo().m_aFormat.GetNumberingType() );
+    auto verify = [this](bool bIsExport = false) {
+        uno::Reference<beans::XPropertySet> 
xPageStyle(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Footnote"_ustr), 
uno::UNO_QUERY);
+        CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote style is rose color", 
Color(0xFF007F), getProperty< Color >(xPageStyle, u"CharColor"_ustr));
+        
xPageStyle.set(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Endnote"_ustr), 
uno::UNO_QUERY);
+        CPPUNIT_ASSERT_EQUAL_MESSAGE( "Endnote style is cyan3 color", 
Color(0x2BD0D2), getProperty< Color >(xPageStyle, u"CharColor"_ustr));
+
+        SwXTextDocument* pTextDoc = 
dynamic_cast<SwXTextDocument*>(mxComponent.get());
+        CPPUNIT_ASSERT(pTextDoc);
+        SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+        // The footnote numbering type of ARABIC will not transfer over when 
those footnotes are converted to endnotes.
+        CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote numbering type", 
SVX_NUM_ARABIC, pDoc->GetFootnoteInfo().m_aFormat.GetNumberingType() );
+        // The original document has a real endnote using ROMAN_LOWER 
numbering, so that setting MUST remain unchanged.
+        CPPUNIT_ASSERT_EQUAL_MESSAGE( "Endnote numbering type", 
SVX_NUM_ROMAN_LOWER, pDoc->GetEndNoteInfo().m_aFormat.GetNumberingType() );
+
+        uno::Reference<text::XFootnotesSupplier> 
xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
+        uno::Reference<container::XIndexAccess> xFootnotes = 
xFootnotesSupplier->getFootnotes();
+
+        uno::Reference<text::XEndnotesSupplier> xEndnotesSupplier(mxComponent, 
uno::UNO_QUERY);
+        uno::Reference<container::XIndexAccess> xEndnotes = 
xEndnotesSupplier->getEndnotes();
+        uno::Reference<text::XFootnote> xEndnote;
+        xEndnotes->getByIndex(0) >>= xEndnote;
+        uno::Reference<text::XText> xEndnoteText;
+        xEndnotes->getByIndex(0) >>= xEndnoteText;
+
+        // ODT footnote-at-document-end's closest DOC match is an endnote, so 
the two imports will not exactly match by design.
+        if (!bIsExport)
+        {
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "original footnote count", 
sal_Int32(5), xFootnotes->getCount() );
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote count", 
sal_Int32(1), xEndnotes->getCount() );
+
+            uno::Reference<text::XFootnote> xFootnote;
+            xFootnotes->getByIndex(0) >>= xFootnote;
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "original footnote's number", 
u"1"_ustr, xFootnote->getAnchor()->getString() );
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote's number", 
u"i"_ustr, xEndnote->getAnchor()->getString() );
+
+            uno::Reference<text::XText> xFootnoteText;
+            xFootnotes->getByIndex(0) >>= xFootnoteText;
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "original footnote style", 
u"Footnote"_ustr, getProperty<OUString>(getParagraphOfText(1, xFootnoteText), 
u"ParaStyleName"_ustr) );
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote style", 
u"Endnote"_ustr, getProperty<OUString>(getParagraphOfText(1, xEndnoteText), 
u"ParaStyleName"_ustr) );
+        }
+        else
+        {
+            // These asserted items are major differences in the conversion 
from footnote to endnote, NOT necessary conditions for a proper functioning 
document.
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "At-Document-End footnotes were 
converted into endnotes", sal_Int32(0), xFootnotes->getCount() );
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "At-Document-End footnotes became 
endnotes", sal_Int32(6), xEndnotes->getCount() );
 
-    uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, 
uno::UNO_QUERY);
-    uno::Reference<container::XIndexAccess> xFootnotes = 
xFootnotesSupplier->getFootnotes();
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "converted footnote's number", 
u"i"_ustr, xEndnote->getAnchor()->getString() );
+            xEndnotes->getByIndex(4) >>= xEndnote;
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote's new number", 
u"v"_ustr, xEndnote->getAnchor()->getString() );
 
-    uno::Reference<text::XEndnotesSupplier> xEndnotesSupplier(mxComponent, 
uno::UNO_QUERY);
-    uno::Reference<container::XIndexAccess> xEndnotes = 
xEndnotesSupplier->getEndnotes();
-    uno::Reference<text::XFootnote> xEndnote;
-    xEndnotes->getByIndex(0) >>= xEndnote;
-    uno::Reference<text::XText> xEndnoteText;
-    xEndnotes->getByIndex(0) >>= xEndnoteText;
-
-    // ODT footnote-at-document-end's closest DOC match is an endnote, so the 
two imports will not exactly match by design.
-    if (!isExported())
-    {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "original footnote count", sal_Int32(5), 
xFootnotes->getCount() );
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote count", sal_Int32(1), 
xEndnotes->getCount() );
-
-        uno::Reference<text::XFootnote> xFootnote;
-        xFootnotes->getByIndex(0) >>= xFootnote;
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "original footnote's number", u"1"_ustr, 
xFootnote->getAnchor()->getString() );
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote's number", u"i"_ustr, 
xEndnote->getAnchor()->getString() );
-
-        uno::Reference<text::XText> xFootnoteText;
-        xFootnotes->getByIndex(0) >>= xFootnoteText;
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "original footnote style", 
u"Footnote"_ustr, getProperty<OUString>(getParagraphOfText(1, xFootnoteText), 
u"ParaStyleName"_ustr) );
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote style", 
u"Endnote"_ustr, getProperty<OUString>(getParagraphOfText(1, xEndnoteText), 
u"ParaStyleName"_ustr) );
-    }
-    else
-    {
-        // These asserted items are major differences in the conversion from 
footnote to endnote, NOT necessary conditions for a proper functioning document.
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "At-Document-End footnotes were 
converted into endnotes", sal_Int32(0), xFootnotes->getCount() );
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "At-Document-End footnotes became 
endnotes", sal_Int32(6), xEndnotes->getCount() );
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "retained footnote style", 
u"Footnote"_ustr, getProperty<OUString>(getParagraphOfText(1, xEndnoteText), 
u"ParaStyleName"_ustr) );
+            xEndnotes->getByIndex(4) >>= xEndnoteText;
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote style", 
u"Endnote"_ustr, getProperty<OUString>(getParagraphOfText(1, xEndnoteText), 
u"ParaStyleName"_ustr) );
+        }
+    };
 
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "converted footnote's number", 
u"i"_ustr, xEndnote->getAnchor()->getString() );
-        xEndnotes->getByIndex(4) >>= xEndnote;
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote's new number", 
u"v"_ustr, xEndnote->getAnchor()->getString() );
 
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "retained footnote style", 
u"Footnote"_ustr, getProperty<OUString>(getParagraphOfText(1, xEndnoteText), 
u"ParaStyleName"_ustr) );
-        xEndnotes->getByIndex(4) >>= xEndnoteText;
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote style", 
u"Endnote"_ustr, getProperty<OUString>(getParagraphOfText(1, xEndnoteText), 
u"ParaStyleName"_ustr) );
-    }
+    createSwDoc("tdf55427_footnote2endnote.odt");
+    verify();
+    saveAndReload(mpFilter);
+    verify(/*bIsExport*/ true);
 }
 
 DECLARE_WW8EXPORT_TEST(testTdf107931_KERN_DocEnabled_disabledDefStyle, 
"testTdf107931_KERN_DocEnabled_disabledDefStyle.doc")
@@ -569,10 +576,7 @@ CPPUNIT_TEST_FIXTURE(Test, testActiveXCheckbox)
     CPPUNIT_ASSERT_EQUAL(1, getPages());
     // First check box anchored as a floating object
     uno::Reference<drawing::XControlShape> xControlShape;
-    if(!isExported())
-        xControlShape.set(getShape(1), uno::UNO_QUERY);
-    else
-        xControlShape.set(getShape(2), uno::UNO_QUERY);
+    xControlShape.set(getShape(2), uno::UNO_QUERY);
     CPPUNIT_ASSERT(xControlShape.is());
 
     // Check whether we have the right control
@@ -586,10 +590,7 @@ CPPUNIT_TEST_FIXTURE(Test, testActiveXCheckbox)
     
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER,getProperty<text::TextContentAnchorType>(xPropertySet2,u"AnchorType"_ustr));
 
     // Second check box anchored inline / as character
-    if(!isExported())
-        xControlShape.set(getShape(2), uno::UNO_QUERY);
-    else
-        xControlShape.set(getShape(1), uno::UNO_QUERY);
+    xControlShape.set(getShape(1), uno::UNO_QUERY);
 
     // Check whether we have the right control
     xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY);
@@ -635,13 +636,12 @@ DECLARE_WW8EXPORT_TEST(testTdf67207_MERGEFIELD, 
"mailmerge.doc")
     CPPUNIT_ASSERT_EQUAL(u"com.sun.star.text.fieldmaster.DataBase.Name"_ustr, 
sValue);
 }
 
-DECLARE_OOXMLEXPORT_TEST( testTableCrossReference, "table_cross_reference.odt" 
)
+CPPUNIT_TEST_FIXTURE(Test, testTableCrossReference)
 {
+    loadAndReload("table_cross_reference.odt");
     CPPUNIT_ASSERT_EQUAL(1, getPages());
     // tdf#42346: Cross references to tables were not saved
     // MSO uses simple bookmarks for referencing table caption, so we do the 
same by export
-    if (!isExported())
-        return;
 
     // Check whether we have all the necessary bookmarks exported and imported 
back
     uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, 
uno::UNO_QUERY);
@@ -800,8 +800,6 @@ CPPUNIT_TEST_FIXTURE(Test, 
testTableCrossReferenceCustomFormat)
     CPPUNIT_ASSERT_EQUAL(1, getPages());
     // tdf#42346: Cross references to tables were not saved
     // Check also captions with custom formatting
-    if (!isExported())
-        return;
 
     // Check whether we have all the necessary bookmarks exported and imported 
back
     uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, 
uno::UNO_QUERY);
@@ -912,13 +910,12 @@ CPPUNIT_TEST_FIXTURE(Test, 
testTableCrossReferenceCustomFormat)
     }
 }
 
-DECLARE_OOXMLEXPORT_TEST( testObjectCrossReference, 
"object_cross_reference.odt" )
+CPPUNIT_TEST_FIXTURE(Test, testObjectCrossReference)
 {
+    loadAndReload("object_cross_reference.odt");
     CPPUNIT_ASSERT_EQUAL(2, getPages());
     // tdf#42346: Cross references to objects were not saved
     // MSO uses simple bookmarks for referencing table caption, so we do the 
same by export
-    if (!isExported())
-        return;
 
     // Check whether we have all the necessary bookmarks exported and imported 
back
     uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, 
uno::UNO_QUERY);
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx 
b/sw/qa/extras/ww8export/ww8export3.cxx
index 8809d63fe417..880a3cb31701 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -127,15 +127,14 @@ DECLARE_WW8EXPORT_TEST(testTdf148380_createField, 
"tdf148380_createField.doc")
     CPPUNIT_ASSERT_EQUAL(u"yesterday at noon"_ustr, 
xField->getPresentation(false));
 }
 
-DECLARE_WW8EXPORT_TEST(testTdf148380_fldLocked, "tdf148380_fldLocked.doc")
+CPPUNIT_TEST_FIXTURE(Test, testTdf148380_fldLocked)
 {
+    createSwDoc("tdf148380_fldLocked.doc");
     getParagraph(2, u"4/5/2022 4:29:00 PM"_ustr);
     getParagraph(4, u"1/23/4567 8:9:10 PM"_ustr);
 
     // Verify that these are fields, and not just plain text
     // (import only, since export thankfully just dumps these fixed fields as 
plain text
-    if (isExported())
-        return;
     uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, 
uno::UNO_QUERY);
     auto xFieldsAccess(xTextFieldsSupplier->getTextFields());
     uno::Reference<container::XEnumeration> 
xFields(xFieldsAccess->createEnumeration());
@@ -216,24 +215,21 @@ DECLARE_WW8EXPORT_TEST(testArabicZeroNumbering, 
"arabic-zero-numbering.doc")
                          aMap[u"NumberingType"_ustr].get<sal_uInt16>());
 }
 
-DECLARE_WW8EXPORT_TEST(testTdf128501, "tdf128501.doc")
+CPPUNIT_TEST_FIXTURE(Test, testTdf128501)
 {
-    if (!isExported())
-    {
-        uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor = 
getShape(1);
-        CPPUNIT_ASSERT_EQUAL(u"com.sun.star.drawing.CustomShape"_ustr, 
xShapeDescriptor->getShapeType());
-    }
-    else
-    {
-        uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor = 
getShape(1);
-        // Without the fix in place, this test would have failed with
-        // - Expected: FrameShape
-        // - Actual  : com.sun.star.drawing.CustomShape
-        CPPUNIT_ASSERT_EQUAL(u"FrameShape"_ustr, 
xShapeDescriptor->getShapeType());
-    }
+    createSwDoc("tdf128501.doc");
+    uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor = getShape(1);
+    CPPUNIT_ASSERT_EQUAL(u"com.sun.star.drawing.CustomShape"_ustr, 
xShapeDescriptor->getShapeType());
+
+    saveAndReload(mpFilter);
+    xShapeDescriptor = getShape(1);
+    // Without the fix in place, this test would have failed with
+    // - Expected: FrameShape
+    // - Actual  : com.sun.star.drawing.CustomShape
+    CPPUNIT_ASSERT_EQUAL(u"FrameShape"_ustr, xShapeDescriptor->getShapeType());
 }
 
-CPPUNIT_TEST_FIXTURE(SwModelTestBase, testArabicZeroNumberingFootnote)
+CPPUNIT_TEST_FIXTURE(Test, testArabicZeroNumberingFootnote)
 {
     // Create a document, set footnote numbering type to ARABIC_ZERO.
     createSwDoc();
@@ -263,7 +259,7 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, 
testArabicZeroNumberingFootnote)
     CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
 }
 
-CPPUNIT_TEST_FIXTURE(SwModelTestBase, testChicagoNumberingFootnote)
+CPPUNIT_TEST_FIXTURE(Test, testChicagoNumberingFootnote)
 {
     // Create a document, set footnote numbering type to SYMBOL_CHICAGO.
     createSwDoc();
@@ -815,10 +811,6 @@ CPPUNIT_TEST_FIXTURE(Test, testBtlrFrame)
     loadAndReload("btlr-frame.odt");
     CPPUNIT_ASSERT_EQUAL(1, getShapes());
     CPPUNIT_ASSERT_EQUAL(1, getPages());
-    if (!isExported())
-    {
-        return;
-    }
 
     // Without the accompanying fix in place, this test would have failed with 
a
     // beans.UnknownPropertyException, as the writing direction was lost, so 
the default direction
@@ -961,32 +953,39 @@ 
DECLARE_WW8EXPORT_TEST(testTdf104239_chapterNumberingLevels, "tdf104239_chapterN
     CPPUNIT_ASSERT_EQUAL(u"1.1.1.1.1.1.1.1.1."_ustr, 
getProperty<OUString>(xPara, u"ListLabelString"_ustr));
 }
 
-DECLARE_WW8EXPORT_TEST(testTdf104239_chapterNumberTortureTest, 
"tdf104239_chapterNumberTortureTest.doc")
+CPPUNIT_TEST_FIXTURE(Test, testTdf104239_chapterNumberTortureTest)
 {
-    // There is no point in identifying what the wrong values where in this 
test,
-    //because EVERYTHING was wrong, and MANY different fixes are required to 
solve the problems.
-    uno::Reference<beans::XPropertySet> xPara(getParagraph(1, u"No numId in 
style or paragraph"_ustr), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(u""_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
-    xPara.set(getParagraph(2, u"Paragraph cancels numbering(0)"_ustr), 
uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(u""_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
-    xPara.set(getParagraph(3, u"First numbered line"_ustr), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(u"1st.i.a.1.I"_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
-    xPara.set(getParagraph(7, u"inheritOnly: inherit outlineLvl and 
listLvl."_ustr), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(u"2nd.ii"_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
-    CPPUNIT_ASSERT_EQUAL(sal_Int16(1), getProperty<sal_Int16>(xPara, 
u"NumberingLevel"_ustr)); // Level 2
-    xPara.set(getParagraph(9, u"outline with Body listLvl(9)."_ustr), 
uno::UNO_QUERY);
-    if (!isExported())
+    auto verify = [this](bool bIsExport = false) {
+        // There is no point in identifying what the wrong values where in 
this test,
+        //because EVERYTHING was wrong, and MANY different fixes are required 
to solve the problems.
+        uno::Reference<beans::XPropertySet> xPara(getParagraph(1, u"No numId 
in style or paragraph"_ustr), uno::UNO_QUERY);
         CPPUNIT_ASSERT_EQUAL(u""_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
-    xPara.set(getParagraph(10, u"outline with Body listLvl(9) #2."_ustr), 
uno::UNO_QUERY);
-    if (!isExported())
+        xPara.set(getParagraph(2, u"Paragraph cancels numbering(0)"_ustr), 
uno::UNO_QUERY);
         CPPUNIT_ASSERT_EQUAL(u""_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
-    xPara.set(getParagraph(11, u"direct formatting - Body listLvl(9)."_ustr), 
uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(u""_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
-    xPara.set(getParagraph(12, u"direct numId, inherit listLvl."_ustr), 
uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(u"2nd.ii.a.1.I"_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
-    CPPUNIT_ASSERT_EQUAL(sal_Int16(4), getProperty<sal_Int16>(xPara, 
u"NumberingLevel"_ustr)); // Level 5
-    xPara.set(getParagraph(13, u"Style numId0 cancels inherited 
numbering."_ustr), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(u""_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
+        xPara.set(getParagraph(3, u"First numbered line"_ustr), 
uno::UNO_QUERY);
+        CPPUNIT_ASSERT_EQUAL(u"1st.i.a.1.I"_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
+        xPara.set(getParagraph(7, u"inheritOnly: inherit outlineLvl and 
listLvl."_ustr), uno::UNO_QUERY);
+        CPPUNIT_ASSERT_EQUAL(u"2nd.ii"_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
+        CPPUNIT_ASSERT_EQUAL(sal_Int16(1), getProperty<sal_Int16>(xPara, 
u"NumberingLevel"_ustr)); // Level 2
+        xPara.set(getParagraph(9, u"outline with Body listLvl(9)."_ustr), 
uno::UNO_QUERY);
+        if (!bIsExport)
+            CPPUNIT_ASSERT_EQUAL(u""_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
+        xPara.set(getParagraph(10, u"outline with Body listLvl(9) #2."_ustr), 
uno::UNO_QUERY);
+        if (!bIsExport)
+            CPPUNIT_ASSERT_EQUAL(u""_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
+        xPara.set(getParagraph(11, u"direct formatting - Body 
listLvl(9)."_ustr), uno::UNO_QUERY);
+        CPPUNIT_ASSERT_EQUAL(u""_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
+        xPara.set(getParagraph(12, u"direct numId, inherit listLvl."_ustr), 
uno::UNO_QUERY);
+        CPPUNIT_ASSERT_EQUAL(u"2nd.ii.a.1.I"_ustr, 
getProperty<OUString>(xPara, u"ListLabelString"_ustr));
+        CPPUNIT_ASSERT_EQUAL(sal_Int16(4), getProperty<sal_Int16>(xPara, 
u"NumberingLevel"_ustr)); // Level 5
+        xPara.set(getParagraph(13, u"Style numId0 cancels inherited 
numbering."_ustr), uno::UNO_QUERY);
+        CPPUNIT_ASSERT_EQUAL(u""_ustr, getProperty<OUString>(xPara, 
u"ListLabelString"_ustr));
+    };
+
+    createSwDoc("tdf104239_chapterNumberTortureTest.doc");
+    verify();
+    saveAndReload(mpFilter);
+    verify(/*bIsExport*/ true);
 }
 
 DECLARE_WW8EXPORT_TEST(testTdf106541_inheritOutlineNumbering, 
"tdf106541_inheritOutlineNumbering.doc")
@@ -1084,7 +1083,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf79186_noLayoutInCell)
     // in MS Word the textbox was contained in column A instead of the 
original column B.)
     // Thus the "perfect look" simply proves that LO is doing the layout wrong.
     CPPUNIT_ASSERT(getProperty<bool>(getShape(1), 
u"IsFollowingTextFlow"_ustr)); // tdf#157637
-    CPPUNIT_ASSERT_EQUAL(isExported(), getProperty<bool>(getShape(1), 
u"IsFollowingTextFlow"_ustr));
+    CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(getShape(1), 
u"IsFollowingTextFlow"_ustr));
     xmlDocUniquePtr pDump = parseLayoutDump();
     sal_Int32 nShapeLeft
         = getXPath(pDump, "//anchored/SwAnchoredDrawObject/bounds",

Reply via email to