sw/qa/extras/odfexport/odfexport4.cxx | 9 - sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 78 +++++++---- sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 18 +- sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 27 ++-- sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 171 +++++++++++++++++--------- sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 72 +++++++--- sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 45 ++++-- sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 42 ++++-- sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 39 +++-- sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 24 ++- sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 24 ++- sw/qa/extras/ooxmlexport/ooxmlexport19.cxx | 9 - sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 15 +- sw/qa/extras/ooxmlexport/ooxmlexport20.cxx | 114 +++++++++++------ sw/qa/extras/ooxmlexport/ooxmlexport21.cxx | 48 ++++--- sw/qa/extras/ooxmlexport/ooxmlexport22.cxx | 39 +++-- sw/qa/extras/ooxmlexport/ooxmlexport23.cxx | 63 ++++++--- sw/qa/extras/ooxmlexport/ooxmlexport24.cxx | 42 ++++-- sw/qa/extras/ooxmlexport/ooxmlexport25.cxx | 9 - sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 108 ++++++++++------ sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 171 +++++++++++++++++--------- sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 117 +++++++++++------ sw/qa/extras/ooxmlexport/ooxmlexport6.cxx | 93 +++++++++----- sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 138 +++++++++++++------- sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 36 +++-- sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 3 sw/qa/inc/swmodeltestbase.hxx | 3 sw/qa/unit/swmodeltestbase.cxx | 6 28 files changed, 1036 insertions(+), 527 deletions(-)
New commits: commit e7acc02ef9341eb8f106a9e96db792e6b1c3dc31 Author: Xisco Fauli <[email protected]> AuthorDate: Mon Nov 17 16:55:46 2025 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Tue Nov 18 08:52:19 2025 +0100 SwModelTestBase: drop loadAndSave in preparation for a follow-up commit Change-Id: I0f978945d7cc1bc9cd08910b609f5bcfce2ae022 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194113 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/qa/extras/odfexport/odfexport4.cxx b/sw/qa/extras/odfexport/odfexport4.cxx index 95dc8bed1a48..015125b86bf0 100644 --- a/sw/qa/extras/odfexport/odfexport4.cxx +++ b/sw/qa/extras/odfexport/odfexport4.cxx @@ -143,7 +143,8 @@ CPPUNIT_TEST_FIXTURE(Test, testPersonalMetaData) CPPUNIT_TEST_FIXTURE(Test, testRemoveOnlyEditTimeMetaData) { // 1. Check we have the original edit time info - loadAndSave("personalmetadata.odt"); + createSwDoc("personalmetadata.odt"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"meta.xml"_ustr); assertXPathContent(pXmlDoc, "/office:document-meta/office:meta/meta:editing-duration", u"PT21M22S"); @@ -154,7 +155,8 @@ CPPUNIT_TEST_FIXTURE(Test, testRemoveOnlyEditTimeMetaData) pBatch->commit(); // 2. Check edit time info is 0 - loadAndSave("personalmetadata.odt"); + createSwDoc("personalmetadata.odt"); + save(mpFilter); pXmlDoc = parseExport(u"meta.xml"_ustr); assertXPathContent(pXmlDoc, "/office:document-meta/office:meta/meta:editing-duration", u"P0D"); @@ -389,7 +391,8 @@ CPPUNIT_TEST_FIXTURE(Test, testListFormatDocx) CPPUNIT_TEST_FIXTURE(Test, testShapeWithHyperlink) { - loadAndSave("shape-with-hyperlink.odt"); + createSwDoc("shape-with-hyperlink.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 8e77294687eb..b32a58bc1024 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -42,14 +42,16 @@ public: CPPUNIT_TEST_FIXTURE(Test, testfdo81381) { - loadAndSave("fdo81381.docx"); + createSwDoc("fdo81381.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:object[1]/o:OLEObject[1]", "DrawAspect", u"Icon"); } CPPUNIT_TEST_FIXTURE(Test, testSdtAlias) { - loadAndSave("sdt-alias.docx"); + createSwDoc("sdt-alias.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // <w:alias> was completely missing. @@ -58,7 +60,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtAlias) CPPUNIT_TEST_FIXTURE(Test, testFooterBodyDistance) { - loadAndSave("footer-body-distance.docx"); + createSwDoc("footer-body-distance.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Page break was exported as section break, this was 0 assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); @@ -80,7 +83,8 @@ DECLARE_OOXMLEXPORT_TEST(testfdo81031, "fdo81031.docx") CPPUNIT_TEST_FIXTURE(Test, testPlausableBorder) { - loadAndSave("plausable-border.docx"); + createSwDoc("plausable-border.docx"); + save(mpFilter); // sw::util::IsPlausableSingleWordSection() did not merge two page styles due to borders. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Page break was exported as section break, this was 0 @@ -91,7 +95,8 @@ CPPUNIT_TEST_FIXTURE(Test, testPlausableBorder) CPPUNIT_TEST_FIXTURE(Test, testUnwantedSectionBreak) { - loadAndSave("unwanted-section-break.docx"); + createSwDoc("unwanted-section-break.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 2: an additional sectPr was added to the document. assertXPath(pXmlDoc, "//w:sectPr", 1); @@ -99,7 +104,8 @@ CPPUNIT_TEST_FIXTURE(Test, testUnwantedSectionBreak) CPPUNIT_TEST_FIXTURE(Test, testfdo80897 ) { - loadAndSave("fdo80897.docx"); + createSwDoc("fdo80897.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr/a:prstTxWarp", "prst", u"textTriangle"); } @@ -114,7 +120,8 @@ DECLARE_OOXMLEXPORT_TEST(testFdo80997, "fdo80997.docx") CPPUNIT_TEST_FIXTURE(Test, testFdo80902) { - loadAndSave("fdo80902.docx"); + createSwDoc("fdo80902.docx"); + save(mpFilter); // The problem was that the docGrid type was set as default so fix it for other grid type xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -123,7 +130,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo80902) CPPUNIT_TEST_FIXTURE(Test, testParaShading) { - loadAndSave("para-shading.docx"); + createSwDoc("para-shading.docx"); + save(mpFilter); // Make sure the themeColor attribute is not written when it would be empty. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:shd", "themeColor"); @@ -131,7 +139,8 @@ CPPUNIT_TEST_FIXTURE(Test, testParaShading) CPPUNIT_TEST_FIXTURE(Test, testFDO83044) { - loadAndSave("fdo83044.docx"); + createSwDoc("fdo83044.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:text", 1); @@ -147,7 +156,8 @@ DECLARE_OOXMLEXPORT_TEST(testfdo83428, "fdo83428.docx") CPPUNIT_TEST_FIXTURE(Test, testShapeInFloattable) { - loadAndSave("shape-in-floattable.docx"); + createSwDoc("shape-in-floattable.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // No nested drawingML w:txbxContent. assertXPath(pXmlDoc, "//mc:Choice//w:txbxContent//w:txbxContent", 0); @@ -247,7 +257,8 @@ DECLARE_OOXMLEXPORT_TEST(testTableAlignment, "table-alignment.docx") CPPUNIT_TEST_FIXTURE(Test, testSdtIgnoredFooter) { - loadAndSave("sdt-ignored-footer.docx"); + createSwDoc("sdt-ignored-footer.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 1, make sure no w:sdt sneaks into the main document from the footer. assertXPath(pXmlDoc, "//w:sdt", 0); @@ -255,7 +266,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtIgnoredFooter) CPPUNIT_TEST_FIXTURE(Test, testSdtRunPicture) { - loadAndSave("sdt-run-picture.docx"); + createSwDoc("sdt-run-picture.docx"); + save(mpFilter); // SDT around run was exported as SDT around paragraph xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 1: there was an SDT around w:p. @@ -377,7 +389,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104713_undefinedStyles, "tdf104713_undefinedStyl CPPUNIT_TEST_FIXTURE(Test, testDrawingmlFlipv) { - loadAndSave("drawingml-flipv.docx"); + createSwDoc("drawingml-flipv.docx"); + save(mpFilter); // The problem was that the shape had vertical flip only, but then we added rotation as well on export. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "rot"); @@ -385,7 +398,8 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawingmlFlipv) CPPUNIT_TEST_FIXTURE(Test, testRot90Fliph) { - loadAndSave("rot90-fliph.docx"); + createSwDoc("rot90-fliph.docx"); + save(mpFilter); // The problem was that a shape rotation of 90° got turned into 270° after roundtrip. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//a:xfrm", "flipH", u"1"); @@ -395,7 +409,8 @@ CPPUNIT_TEST_FIXTURE(Test, testRot90Fliph) CPPUNIT_TEST_FIXTURE(Test, testRot180Flipv) { - loadAndSave("rot180-flipv.docx"); + createSwDoc("rot180-flipv.docx"); + save(mpFilter); // 180° rotation got lost after roundtrip. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//a:xfrm", "flipV", u"1"); @@ -405,7 +420,8 @@ CPPUNIT_TEST_FIXTURE(Test, testRot180Flipv) CPPUNIT_TEST_FIXTURE(Test, testRot270Flipv) { - loadAndSave("rot270-flipv.docx"); + createSwDoc("rot270-flipv.docx"); + save(mpFilter); // 270° rotation got turned into 90° after roundtrip. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//a:xfrm", "flipV", u"1"); @@ -490,7 +506,8 @@ DECLARE_OOXMLEXPORT_TEST(testTextboxTable, "textbox-table.docx") CPPUNIT_TEST_FIXTURE(Test, testCropPixel) { - loadAndSave("crop-pixel.docx"); + createSwDoc("crop-pixel.docx"); + save(mpFilter); // If map mode of the graphic is in pixels, then we used to handle original // size of the graphic as mm100, but it was in pixels. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -501,7 +518,8 @@ CPPUNIT_TEST_FIXTURE(Test, testCropPixel) /* FixMe: tdf#142805 Test disabled, because the picture is not load at all. CPPUNIT_TEST_FIXTURE(Test, testEffectExtent) { - loadAndSave("effect-extent.docx"); + createSwDoc("effect-extent.docx"); + save(mpFilter); // The problem was that in case there were no shadows on the picture, we // wrote a <wp:effectExtent> full or zeros. xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -511,7 +529,8 @@ CPPUNIT_TEST_FIXTURE(Test, testEffectExtent) */ CPPUNIT_TEST_FIXTURE(Test, testEffectExtentInline) { - loadAndSave("effect-extent-inline.docx"); + createSwDoc("effect-extent-inline.docx"); + save(mpFilter); // The problem was that in case there was inline rotated picture, we // wrote a <wp:effectExtent> full or zeros. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -570,7 +589,8 @@ DECLARE_OOXMLEXPORT_TEST(testParagraphMark2, "paragraph-mark2.docx") CPPUNIT_TEST_FIXTURE(Test, testParagraphMarkNonempty) { - loadAndSave("paragraph-mark-nonempty.odt"); + createSwDoc("paragraph-mark-nonempty.odt"); + save(mpFilter); validate(maTempFile.GetFileName(), mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -658,7 +678,8 @@ DECLARE_OOXMLEXPORT_TEST(testOoxmlSymbolChicagoList, "symbol_chicago_list.docx") CPPUNIT_TEST_FIXTURE(Test, testOoxmlNumListZHTW) { - loadAndSave("numlist-zhtw.odt"); + createSwDoc("numlist-zhtw.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); @@ -667,7 +688,8 @@ CPPUNIT_TEST_FIXTURE(Test, testOoxmlNumListZHTW) CPPUNIT_TEST_FIXTURE(Test, testOoxmlNumListZHCN) { - loadAndSave("numlist-zhcn.odt"); + createSwDoc("numlist-zhcn.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); @@ -676,7 +698,8 @@ CPPUNIT_TEST_FIXTURE(Test, testOoxmlNumListZHCN) CPPUNIT_TEST_FIXTURE(Test, testOOxmlOutlineNumberTypes) { - loadAndSave("outline-number-types.odt"); + createSwDoc("outline-number-types.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); @@ -979,7 +1002,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166102) CPPUNIT_TEST_FIXTURE(Test, testTdf133647) { - loadAndSave("tdf133647.docx"); + createSwDoc("tdf133647.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Keep original formula during round-trip @@ -995,7 +1019,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133647) CPPUNIT_TEST_FIXTURE(Test, testTdf123386) { - loadAndSave("tdf123386.docx"); + createSwDoc("tdf123386.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Keep original formula during round-trip @@ -1013,7 +1038,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123386) CPPUNIT_TEST_FIXTURE(Test, testTdf123389) { - loadAndSave("tdf123389.docx"); + createSwDoc("tdf123389.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Keep original formula during round-trip diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index 1855bdbe8a64..809cd9d99214 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -274,7 +274,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf162916_nastyTOC, "tdf162916_nastyTOC.docx") CPPUNIT_TEST_FIXTURE(Test, testFontEsc) { - loadAndSave("test_tdf120412.docx"); + createSwDoc("test_tdf120412.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc =parseExport(u"word/document.xml"_ustr); // don't lose the run with superscript formatting assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r", 2); @@ -428,7 +429,8 @@ DECLARE_OOXMLEXPORT_TEST(testFdo69649, "fdo69649.docx") CPPUNIT_TEST_FIXTURE(Test, testFdo73389) { - loadAndSave("fdo73389.docx"); + createSwDoc("fdo73389.docx"); + save(mpFilter); // The width of the inner table was too large. The first fix still converted // the "auto" table width to a fixed one. The second fix used variable width. // The recent fix uses fixed width again, according to the fixed width cells. @@ -440,7 +442,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73389) CPPUNIT_TEST_FIXTURE(Test, testTdf133735) { - loadAndSave("fdo73389.docx"); + createSwDoc("fdo73389.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[2]/w:tc[1]/w:p/w:pPr/w:spacing", "after", u"0"); @@ -460,7 +463,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134569_nestedTable) CPPUNIT_TEST_FIXTURE(Test, testTdf59274) { - loadAndSave("tdf59274.docx"); + createSwDoc("tdf59274.docx"); + save(mpFilter); // Table with "auto" table width and incomplete grid: 11 columns, but only 4 gridCol elements. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -727,7 +731,8 @@ DECLARE_OOXMLEXPORT_TEST(testGridBefore, "gridbefore.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf116194) { - loadAndSave("tdf116194.docx"); + createSwDoc("tdf116194.docx"); + save(mpFilter); // The problem was that the importer lost consecutive tables with w:gridBefore xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl", 2); @@ -735,7 +740,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116194) CPPUNIT_TEST_FIXTURE(Test, testTdf134606) { - loadAndSave("tdf134606.docx"); + createSwDoc("tdf134606.docx"); + save(mpFilter); // The problem was that the importer lost the nested table structure with w:gridBefore xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 190fc1188fa5..425606d0a445 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -165,7 +165,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121456_tabsOffset) // tdf#121561: make sure w:sdt/w:sdtContent around TOC is written during ODT->DOCX conversion CPPUNIT_TEST_FIXTURE(Test, testTdf121561_tocTitle) { - loadAndSave("tdf121456_tabsOffset.odt"); + createSwDoc("tdf121456_tabsOffset.odt"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r/w:t", u"Inhaltsverzeichnis"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r/w:instrText", u" TOC \f \o \"1-9\" \h"); @@ -175,7 +176,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121561_tocTitle) CPPUNIT_TEST_FIXTURE(Test, testTdf129525) { - loadAndSave("tdf129525.rtf"); + createSwDoc("tdf129525.rtf"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[4]/w:t", u"Overview"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[5]/w:t", u"3"); @@ -195,7 +197,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124106, "tdf121456.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf121561_tocTitleDocx) { - loadAndSave("tdf121456_tabsOffset.odt"); + createSwDoc("tdf121456_tabsOffset.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(7, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -251,7 +254,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82065_Ind_start_strict, "tdf82065_Ind_start_stri CPPUNIT_TEST_FIXTURE(Test, testTdf76683_negativeTwipsMeasure) { - loadAndSave("tdf76683_negativeTwipsMeasure.docx"); + createSwDoc("tdf76683_negativeTwipsMeasure.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col", 2); sal_uInt32 nColumn1 = getXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[1]", "w").toUInt32(); @@ -355,7 +359,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf94801, "tdf94801.docx") CPPUNIT_TEST_FIXTURE(Test, testParagraphSplitOnSectionBorder) { - loadAndSave("parasplit-on-section-border.odt"); + createSwDoc("parasplit-on-section-border.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -367,7 +372,8 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphSplitOnSectionBorder) CPPUNIT_TEST_FIXTURE(Test, testTdf44832_testSectionWithDifferentHeader) { - loadAndSave("tdf44832_section_new_header.odt"); + createSwDoc("tdf44832_section_new_header.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:headerReference", 1); @@ -413,7 +419,8 @@ DECLARE_OOXMLEXPORT_TEST(testSignatureLineShape, "signature-line-all-props-set.d CPPUNIT_TEST_FIXTURE(Test, testTdf117805) { - loadAndSave("tdf117805.odt"); + createSwDoc("tdf117805.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<packages::zip::XZipFileAccess2> xNameAccess @@ -540,7 +547,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf142542_cancelledAutospacing, "tdf142542_cancelle CPPUNIT_TEST_FIXTURE(Test, testTdf137655) { - loadAndSave("tdf137655.docx"); + createSwDoc("tdf137655.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // These were 280. assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "before", u"0"); @@ -862,7 +870,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf149996, "lorem_hyperlink.fodt") CPPUNIT_TEST_FIXTURE(Test, testGroupedShapeLink) { - loadAndSave("grouped_link.docx"); + createSwDoc("grouped_link.docx"); + save(mpFilter); // tdf#145147 Hyperlink in grouped shape not imported // tdf#154469 Hyperlink in grouped shape not exported uno::Reference<drawing::XShapes> xGroupShape(getShape(1), uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 7fdd9880333c..bf020ba383b5 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -887,7 +887,8 @@ DECLARE_OOXMLEXPORT_TEST(testWatermarkTrim, "tdf114308.docx") CPPUNIT_TEST_FIXTURE(Test, testVMLShapetypeId) { - loadAndSave("controlshape.fodt"); + createSwDoc("controlshape.fodt"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // must be _x0000_t<NR> assertXPath(pXmlDoc, @@ -904,7 +905,8 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLShapetypeId) CPPUNIT_TEST_FIXTURE(Test, testTdf73547) { - loadAndSave("tdf73547-dash.docx"); + createSwDoc("tdf73547-dash.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); double nD = getXPath(pXmlDoc, "//a:custDash/a:ds[1]", "d").toDouble(); CPPUNIT_ASSERT_DOUBLES_EQUAL(105000.0, nD, 5000.0); // was 100000 @@ -933,7 +935,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119143, "tdf119143.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf105444) { - loadAndSave("tdf105444.docx"); + createSwDoc("tdf105444.docx"); + save(mpFilter); xmlDocUniquePtr pXmlComm = parseExport(u"word/comments.xml"_ustr); // there is no extra paragraph on Win32, only a single one. assertXPath(pXmlComm, "/w:comments/w:comment/w:p", 1); @@ -976,7 +979,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138780) CPPUNIT_TEST_FIXTURE(Test, testTdf134618) { - loadAndSave("tdf134618.doc"); + createSwDoc("tdf134618.doc"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); //Without the fix it in place, it would have failed with @@ -989,7 +993,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134618) CPPUNIT_TEST_FIXTURE(Test, testTdf99631) { - loadAndSave("tdf99631.docx"); + createSwDoc("tdf99631.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:object", 2); @@ -1004,7 +1009,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf99631) CPPUNIT_TEST_FIXTURE(Test, testTdf138899) { - loadAndSave("tdf138899.docx"); + createSwDoc("tdf138899.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // This was 6, not removed empty temporary paragraph at the end of the section assertXPath(pXmlDocument, "/w:document/w:body/w:p", 5); @@ -1015,7 +1021,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138899) CPPUNIT_TEST_FIXTURE(Test, testTdf122563) { - loadAndSave("tdf122563.docx"); + createSwDoc("tdf122563.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object", 1); @@ -1105,7 +1112,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf122594, "tdf122594.docx") CPPUNIT_TEST_FIXTURE(Test, testLanguageInGroupShape) { - loadAndSave("tdf131922_LanguageInGroupShape.docx"); + createSwDoc("tdf131922_LanguageInGroupShape.docx"); + save(mpFilter); // tdf#131922: Check if good language is used in shape group texts xmlDocUniquePtr pXml = parseExport(u"word/document.xml"_ustr); assertXPath(pXml, @@ -1163,7 +1171,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116883, "tdf116883.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf131420) { - loadAndSave("tdf131420.docx"); + createSwDoc("tdf131420.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:pPr/w:pBdr/w:top"); } @@ -1235,7 +1244,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104797, "tdf104797.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf145720) { // check moveFromRangeStart/End and moveToRangeStart/End (to keep tracked text moving) - loadAndSave("tdf104797.docx"); + createSwDoc("tdf104797.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // These were 0 (missing move*FromRange* elements) assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]//w:moveFromRangeStart", 1); @@ -1260,7 +1270,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf145720) CPPUNIT_TEST_FIXTURE(Test, testTdf150166) { // check moveFromRangeStart/End and moveToRangeStart/End (to keep tracked text moving) - loadAndSave("tdf150166.docx"); + createSwDoc("tdf150166.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:moveFromRangeStart", 0); // This was 2 (missing RangeStart elements, but bad unpaired RangeEnds) @@ -1279,7 +1290,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150166) CPPUNIT_TEST_FIXTURE(Test, testTdf143510) { // check moveFromRangeStart/End and moveToRangeStart/End for tracked table move by drag & drop - loadAndSave("TC-table-DnD-move.docx"); + createSwDoc("TC-table-DnD-move.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:del", 2); @@ -1289,7 +1301,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143510) CPPUNIT_TEST_FIXTURE(Test, testTdf143510_table_from_row) { // check moveFromRangeStart/End and moveToRangeStart/End for tracked table move by drag & drop - loadAndSave("TC-table-Separate-Move.docx"); + createSwDoc("TC-table-Separate-Move.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:del", 1); @@ -1301,7 +1314,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143510_table_from_row) CPPUNIT_TEST_FIXTURE(Test, testTdf143510_within_table) { // check moveFromRangeStart/End and moveToRangeStart/End for tracked table row move by DnD - loadAndSave("TC-table-rowDND.docx"); + createSwDoc("TC-table-rowDND.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:del", 1); @@ -1311,7 +1325,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143510_within_table) CPPUNIT_TEST_FIXTURE(Test, testTdf143510_within_table2) { // check moveFromRangeStart/End and moveToRangeStart/End for tracked table row move by DnD - loadAndSave("TC-table-rowDND-front.docx"); + createSwDoc("TC-table-rowDND-front.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:ins", 1); @@ -1321,7 +1336,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143510_within_table2) CPPUNIT_TEST_FIXTURE(Test, testTdf150824) { // check tracked table row insertion (stored in a single redline) - loadAndSave("tdf150824.fodt"); + createSwDoc("tdf150824.fodt"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:ins", 1); @@ -1332,7 +1348,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150824) CPPUNIT_TEST_FIXTURE(Test, testTdf157011) { // check tracked table column insertions and deletions with empty cells - loadAndSave("tdf157011_ins_del_empty_cols.docx"); + createSwDoc("tdf157011_ins_del_empty_cols.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 1 (missing tracked table cell insertions) @@ -1395,7 +1412,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119188_list_margin_in_cell, "tdf119188_list_marg CPPUNIT_TEST_FIXTURE(Test, testChart_BorderLine_Style) { - loadAndSave("Chart_BorderLine_Style.docx"); + createSwDoc("Chart_BorderLine_Style.docx"); + save(mpFilter); /* DOCX containing Chart with BorderLine Style as Dash Type should get preserved * inside an XML tag <a:prstDash> with value "dash", "sysDot, "lgDot", etc. */ @@ -1413,7 +1431,8 @@ CPPUNIT_TEST_FIXTURE(Test, testChart_BorderLine_Style) CPPUNIT_TEST_FIXTURE(Test, testChart_Plot_BorderLine_Style) { - loadAndSave("Chart_Plot_BorderLine_Style.docx"); + createSwDoc("Chart_Plot_BorderLine_Style.docx"); + save(mpFilter); /* DOCX containing Chart wall (plot area) and Chart Page with BorderLine Style as Dash Type * should get preserved inside an XML tag <a:prstDash> with value "dash", "sysDot, "lgDot", etc. */ @@ -1425,14 +1444,16 @@ CPPUNIT_TEST_FIXTURE(Test, testChart_Plot_BorderLine_Style) CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedEmptyParagraph) { - loadAndSave("testTrackChangesDeletedEmptyParagraph.docx"); + createSwDoc("testTrackChangesDeletedEmptyParagraph.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:rPr/w:del"); } CPPUNIT_TEST_FIXTURE(Test, testTrackChangesEmptyParagraphsInADeletion) { - loadAndSave("testTrackChangesEmptyParagraphsInADeletion.docx"); + createSwDoc("testTrackChangesEmptyParagraphsInADeletion.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); for (int i = 1; i < 12; ++i) assertXPath(pXmlDoc, @@ -1441,7 +1462,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTrackChangesEmptyParagraphsInADeletion) CPPUNIT_TEST_FIXTURE(Test, testTdf149708) { - loadAndSave("tdf149708.docx"); + createSwDoc("tdf149708.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // keep tracked insertion of a list item // This was 0 (missing tracked insertion of the paragraph mark) @@ -1450,7 +1472,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149708) CPPUNIT_TEST_FIXTURE(Test, testTdf149707) { - loadAndSave("tdf149711.docx"); + createSwDoc("tdf149711.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveFrom"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:moveTo"); @@ -1461,7 +1484,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149707) CPPUNIT_TEST_FIXTURE(Test, testTdf70234) { - loadAndSave("tdf70234.docx"); + createSwDoc("tdf70234.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import field with tracked deletion assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:del/w:r[1]/w:fldChar"); @@ -1475,7 +1499,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf70234) CPPUNIT_TEST_FIXTURE(Test, testTdf115212) { - loadAndSave("tdf115212.docx"); + createSwDoc("tdf115212.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // export field with tracked deletion assertXPath(pXmlDoc, "//w:p[2]/w:del[1]/w:r[1]/w:fldChar"); @@ -1483,7 +1508,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115212) CPPUNIT_TEST_FIXTURE(Test, testTdf126243) { - loadAndSave("tdf120338.docx"); + createSwDoc("tdf120338.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // export change tracking rejection data for tracked paragraph style change assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pPrChange/w:pPr/w:pStyle", "val", @@ -1492,7 +1518,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126243) CPPUNIT_TEST_FIXTURE(Test, testTdf126245) { - loadAndSave("tdf126245.docx"); + createSwDoc("tdf126245.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // export change tracking rejection data for tracked numbering change assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange/w:pPr/w:numPr/w:numId", "val", @@ -1501,7 +1528,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126245) CPPUNIT_TEST_FIXTURE(Test, testTdf124491) { - loadAndSave("tdf124491.docx"); + createSwDoc("tdf124491.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import format change of empty lines, FIXME: change w:r with w:pPr in export assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/*/w:rPr/w:rPrChange"); @@ -1512,7 +1540,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124491) CPPUNIT_TEST_FIXTURE(Test, testTdf143911) { - loadAndSave("tdf126206.docx"); + createSwDoc("tdf126206.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // export format change of text portions assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w:rPrChange"); @@ -1522,7 +1551,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143911) CPPUNIT_TEST_FIXTURE(Test, testTdf105485) { - loadAndSave("tdf105485.docx"); + createSwDoc("tdf105485.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking of deleted comments assertXPath(pXmlDoc, "//w:del/w:r/w:commentReference"); @@ -1530,7 +1560,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105485) CPPUNIT_TEST_FIXTURE(Test, testTdf125894) { - loadAndSave("tdf125894.docx"); + createSwDoc("tdf125894.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking in frames assertXPath(pXmlDoc, "//w:del", 2); @@ -1540,7 +1571,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125894) CPPUNIT_TEST_FIXTURE(Test, testTdf149388) { // see also testTdf132371 - loadAndSave("tdf132271.docx"); + createSwDoc("tdf132271.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking in floating tables // (don't recognize tracked text moving during the import, @@ -1554,7 +1586,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149388) CPPUNIT_TEST_FIXTURE(Test, testTdf132271) { // see also testTdf149388 - loadAndSave("tdf149388.docx"); + createSwDoc("tdf149388.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking in floating tables assertXPath(pXmlDoc, "//w:del", 2); @@ -1566,7 +1599,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132271) CPPUNIT_TEST_FIXTURE(Test, testTdf149388_fly) { // see also testTdf136667 - loadAndSave("tdf136667.docx"); + createSwDoc("tdf136667.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking in floating tables assertXPath(pXmlDoc, "//w:del", 2); @@ -1578,7 +1612,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149388_fly) CPPUNIT_TEST_FIXTURE(Test, testTdf136667) { // see also testTdf149388_fly - loadAndSave("tdf149388_fly.docx"); + createSwDoc("tdf149388_fly.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking in floating tables assertXPath(pXmlDoc, "//w:del", 2); @@ -1589,7 +1624,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136667) CPPUNIT_TEST_FIXTURE(Test, testTdf136850) { - loadAndSave("tdf136850.docx"); + createSwDoc("tdf136850.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking in floating tables assertXPath(pXmlDoc, "//w:del"); @@ -1597,7 +1633,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136850) CPPUNIT_TEST_FIXTURE(Test, testTdf128156) { - loadAndSave("tdf128156.docx"); + createSwDoc("tdf128156.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // keep tracked insertion of a paragraph // This was 0 before 350972a8bffc1a74b531e0336954bf54b1356025, @@ -1607,7 +1644,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128156) CPPUNIT_TEST_FIXTURE(Test, testTdf165330) { - loadAndSave("CT-with-frame.docx"); + createSwDoc("CT-with-frame.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // check that *both* tracked changes were round tripped @@ -1617,7 +1655,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165330) CPPUNIT_TEST_FIXTURE(Test, testTdf125546) { - loadAndSave("tdf125546.docx"); + createSwDoc("tdf125546.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // compress redlines (it was 15) assertXPath(pXmlDoc, "//w:rPrChange", 3); @@ -1625,7 +1664,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125546) CPPUNIT_TEST_FIXTURE(Test, testLabelWidthAndPosition_Left_FirstLineIndent) { - loadAndSave("Hau_min_list2.fodt"); + createSwDoc("Hau_min_list2.fodt"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // list is LABEL_WIDTH_AND_POSITION with SvxAdjust::Left // I) LTR @@ -1728,7 +1768,8 @@ CPPUNIT_TEST_FIXTURE(Test, testLabelWidthAndPosition_Left_FirstLineIndent) CPPUNIT_TEST_FIXTURE(Test, testTdf124604) { - loadAndSave("tdf124604.docx"); + createSwDoc("tdf124604.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // If the numbering comes from a base style, indentation of the base style has also priority. assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "start", u"0"); @@ -1736,7 +1777,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124604) CPPUNIT_TEST_FIXTURE(Test, testTdf95374) { - loadAndSave("tdf95374.docx"); + createSwDoc("tdf95374.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Numbering disabled by non-existent numId=0, disabling also inheritance of indentation of parent styles assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "hanging", u"0"); @@ -1850,7 +1892,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf77417) CPPUNIT_TEST_FIXTURE(Test, testTdf130494) { - loadAndSave("tdf130494.docx"); + createSwDoc("tdf130494.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight", "val", u"yellow"); @@ -1860,7 +1903,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130494) CPPUNIT_TEST_FIXTURE(Test, testTdf130690) { - loadAndSave("tdf130690.docx"); + createSwDoc("tdf130690.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight", "val", u"yellow"); @@ -1871,7 +1915,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130690) CPPUNIT_TEST_FIXTURE(Test, testTdf105215) { - loadAndSave("tdf105215.docx"); + createSwDoc("tdf105215.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:rPr/w:rFonts", "ascii", u"Linux Libertine G"); @@ -1892,7 +1937,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105215) CPPUNIT_TEST_FIXTURE(Test, testTdf135187) { - loadAndSave("tdf135187.docx"); + createSwDoc("tdf135187.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p/w:pPr/w:rPr/w:b", 0); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:p/w:pPr/w:rPr/w:b", 1); @@ -1912,7 +1958,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135187) CPPUNIT_TEST_FIXTURE(Test, testTdf136617) { - loadAndSave("tdf136617.docx"); + createSwDoc("tdf136617.docx"); + save(mpFilter); // This was 2 CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -1924,7 +1971,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136617) CPPUNIT_TEST_FIXTURE(Test, testTdf121597TrackedDeletionOfMultipleParagraphs) { - loadAndSave("tdf121597.odt"); + createSwDoc("tdf121597.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1939,7 +1987,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121597TrackedDeletionOfMultipleParagraphs) CPPUNIT_TEST_FIXTURE(Test, testTdf141660) { - loadAndSave("tdf141660.docx"); + createSwDoc("tdf141660.docx"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1951,7 +2000,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf141660) CPPUNIT_TEST_FIXTURE(Test, testTdf133643) { - loadAndSave("tdf133643.doc"); + createSwDoc("tdf133643.doc"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -2003,7 +2053,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116084, "tdf116084.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf116084_anonymized) { - loadAndSave("tdf116084.docx"); + createSwDoc("tdf116084.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:del in w:ins is exported correctly assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del/w:r/w:delText", u"must"); @@ -2029,7 +2080,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121176, "tdf121176.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf121176_anonymized) { - loadAndSave("tdf121176.docx"); + createSwDoc("tdf121176.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:del in w:ins is exported correctly assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del/w:r/w:delText", u"must"); @@ -2047,7 +2099,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121176_anonymized) CPPUNIT_TEST_FIXTURE(Test, testTdf128913) { - loadAndSave("tdf128913.docx"); + createSwDoc("tdf128913.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:ins and w:del are imported correctly, if they contain only inline images assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:r/w:drawing/wp:inline/a:graphic"); @@ -2056,7 +2109,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128913) CPPUNIT_TEST_FIXTURE(Test, testTdf142700) { - loadAndSave("tdf142700.docx"); + createSwDoc("tdf142700.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:ins and w:del are imported correctly, if they contain only images anchored to character assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:r/w:drawing/wp:anchor/a:graphic"); @@ -2065,7 +2119,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142700) CPPUNIT_TEST_FIXTURE(Test, testTdf142387) { - loadAndSave("tdf142387.docx"); + createSwDoc("tdf142387.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:del in w:ins is exported correctly (only w:del was exported) assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del/w:r/w:delText", u"inserts "); @@ -2073,7 +2128,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142387) CPPUNIT_TEST_FIXTURE(Test, testTdf147892) { - loadAndSave("tdf147892.fodt"); + createSwDoc("tdf147892.fodt"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:del in w:ins is exported correctly // (both w:del and w:ins were exported for para marker) @@ -2124,7 +2180,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf67207_MERGEFIELD_DATABASE, "tdf67207.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf101122_noFillForCustomShape) { - loadAndSave("tdf101122_noFillForCustomShape.odt"); + createSwDoc("tdf101122_noFillForCustomShape.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // tdf#101122 check whether the "F" (noFill) option has been exported to docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 1b659f16afb3..9c7260e485b3 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -130,7 +130,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121374_sectionHF2) CPPUNIT_TEST_FIXTURE(Test, testTdf121666_lostPage) { - loadAndSave("tdf121666_lostPage.docx"); + createSwDoc("tdf121666_lostPage.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", u"page"); // The second page break is exported too. @@ -152,7 +153,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf140182_extraPagebreak, "tdf140182_extraPagebreak CPPUNIT_TEST_FIXTURE(Test, testTdf121659_loseColumnBrNextToShape) { - loadAndSave("tdf121659_loseColumnBrNextToShape.docx"); + createSwDoc("tdf121659_loseColumnBrNextToShape.docx"); + save(mpFilter); // The third paragraph contains a manual column break and a shape. // The column break was moved into the shape during the first import // (messing also the shape position), and eliminated during the second import, @@ -677,7 +679,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116371) CPPUNIT_TEST_FIXTURE(Test, testFrameSizeExport) { - loadAndSave("floating-tables-anchor.docx"); + createSwDoc("floating-tables-anchor.docx"); + save(mpFilter); // Make sure the table width is 4000 xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tblPr/w:tblW", "w", u"4000"); @@ -723,7 +726,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124594, "tdf124594.docx") CPPUNIT_TEST_FIXTURE(Test, testTextInput) { - loadAndSave("textinput.odt"); + createSwDoc("textinput.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -830,7 +834,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123460) CPPUNIT_TEST_FIXTURE(Test, testTdf146140) { - loadAndSave("tdf123460.docx"); + createSwDoc("tdf123460.docx"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -846,7 +851,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146140) //tdf#125298: fix charlimit restrictions in bookmarknames and field references if they contain non-ascii characters CPPUNIT_TEST_FIXTURE(Test, testTdf125298) { - loadAndSave("tdf125298_crossreflink_nonascii_charlimit.docx"); + createSwDoc("tdf125298_crossreflink_nonascii_charlimit.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // check whether test file keeps non-ascii values or not OUString bookmarkName1 = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:bookmarkStart[1]", "name"); @@ -903,7 +909,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTbrlFrameVml) CPPUNIT_TEST_FIXTURE(Test, testTdf119037) { - loadAndSave("tdf119037.odt"); + createSwDoc("tdf119037.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -961,7 +968,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119037) CPPUNIT_TEST_FIXTURE(Test, testTdf125657) { - loadAndSave("tdf125657.docx"); + createSwDoc("tdf125657.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); auto checkAttrIsInt = [&](const char* sAttrName) { @@ -995,7 +1003,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf125324, "tdf125324.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf78657) { - loadAndSave("tdf78657_picture_hyperlink.docx"); + createSwDoc("tdf78657_picture_hyperlink.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); xmlDocUniquePtr pXmlRels = parseExport(u"word/_rels/document.xml.rels"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/wp:docPr/a:hlinkClick", 1); @@ -1019,7 +1028,8 @@ CPPUNIT_TEST_FIXTURE(Test, testBtlrFrame) CPPUNIT_TEST_FIXTURE(Test, testTdf125518) { - loadAndSave("tdf125518.odt"); + createSwDoc("tdf125518.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(4, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1061,7 +1071,8 @@ DECLARE_OOXMLEXPORT_TEST(testImageCommentAtChar, "image-comment-at-char.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf131594) { - loadAndSave("tdf131594.docx"); + createSwDoc("tdf131594.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // lnNumType should not be exported if w:countBy="0" assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:lnNumType", 0); @@ -1069,7 +1080,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131594) CPPUNIT_TEST_FIXTURE(Test, testTdf121663) { - loadAndSave("tdf121663.docx"); + createSwDoc("tdf121663.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // auto distance of line numbering is 0.5 cm assertXPath(pXmlDoc, "//w:lnNumType", "distance", u"283"); @@ -1184,7 +1196,8 @@ DECLARE_OOXMLEXPORT_TEST(tdf118169, "tdf118169.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf127116) { - loadAndSave("tdf127116.odt"); + createSwDoc("tdf127116.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1196,7 +1209,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127116) CPPUNIT_TEST_FIXTURE(Test, testTdf127339) { - loadAndSave("tdf127339.docx"); + createSwDoc("tdf127339.docx"); + save(mpFilter); xmlDocUniquePtr pXmlRels = parseExport(u"word/_rels/document.xml.rels"_ustr); assertXPathNoAttribute(pXmlRels, "/rels:Relationships/rels:Relationship[@Target='#bookmark']", "TargetMode"); @@ -1204,7 +1218,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127339) CPPUNIT_TEST_FIXTURE(Test, testTdf127362) { - loadAndSave("tdf127362.odt"); + createSwDoc("tdf127362.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1218,7 +1233,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127362) CPPUNIT_TEST_FIXTURE(Test, testTdf127605) { - loadAndSave("tdf127605.odt"); + createSwDoc("tdf127605.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1230,7 +1246,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127605) CPPUNIT_TEST_FIXTURE(Test, testTdf127732) { - loadAndSave("internal_hyperlink_frame.odt"); + createSwDoc("internal_hyperlink_frame.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1242,7 +1259,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127732) CPPUNIT_TEST_FIXTURE(Test, testTdf127733) { - loadAndSave("internal_hyperlink_ole.odt"); + createSwDoc("internal_hyperlink_ole.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1255,7 +1273,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127733) CPPUNIT_TEST_FIXTURE(Test, testTdf127734) { - loadAndSave("internal_hyperlink_region.odt"); + createSwDoc("internal_hyperlink_region.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1266,7 +1285,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127734) CPPUNIT_TEST_FIXTURE(Test, testTdf127735) { - loadAndSave("internal_hyperlink_table.odt"); + createSwDoc("internal_hyperlink_table.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1277,7 +1297,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127735) CPPUNIT_TEST_FIXTURE(Test, testTdf123628) { - loadAndSave("tdf123628.odt"); + createSwDoc("tdf123628.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1299,7 +1320,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127741, "tdf127741.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf142693_hugePaperSizeImport) { - loadAndSave("tdf142693_hugePaperSizeImport.docx"); + createSwDoc("tdf142693_hugePaperSizeImport.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "w", u"90369"); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "h", u"104372"); @@ -1307,7 +1329,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142693_hugePaperSizeImport) CPPUNIT_TEST_FIXTURE(Test, testTdf127925) { - loadAndSave("tdf127925.odt"); + createSwDoc("tdf127925.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='FollowedHyperlink']/w:name", "val", u"FollowedHyperlink"); @@ -1315,7 +1338,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127925) CPPUNIT_TEST_FIXTURE(Test, testTdf127579) { - loadAndSave("tdf127579.odt"); + createSwDoc("tdf127579.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle", "val", u"Hyperlink"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 951f8d361011..c415b9404453 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -172,7 +172,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf78749) CPPUNIT_TEST_FIXTURE(Test, testTdf128207) { - loadAndSave("tdf128207.docx"); + createSwDoc("tdf128207.docx"); + save(mpFilter); //There was the charts on each other, because their horizontal and vertical position was 0! xmlDocUniquePtr p_XmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(p_XmlDoc); @@ -181,7 +182,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128207) CPPUNIT_TEST_FIXTURE(Test, testTdf123873) { - loadAndSave("tdf123873.docx"); + createSwDoc("tdf123873.docx"); + save(mpFilter); //OLE Object were overlapped due to missing wrap import xmlDocUniquePtr p_XmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(p_XmlDoc); @@ -191,7 +193,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123873) CPPUNIT_TEST_FIXTURE(Test, Tdf133065) { - loadAndSave("tdf133065.odt"); + createSwDoc("tdf133065.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(7, getShapes()); CPPUNIT_ASSERT_EQUAL(3, getPages()); auto pxmldoc = parseExport(u"word/document.xml"_ustr); @@ -231,7 +234,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf130814model, "tdf130814.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf107020) { - loadAndSave("tdf107020.docx"); + createSwDoc("tdf107020.docx"); + save(mpFilter); if (!IsDefaultDPI()) return; xmlDocUniquePtr p_XmlDoc = parseExport(u"word/document.xml"_ustr); @@ -248,7 +252,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107020) CPPUNIT_TEST_FIXTURE(Test, testTdf130814ooxml) { - loadAndSave("tdf130814.docx"); + createSwDoc("tdf130814.docx"); + save(mpFilter); xmlDocUniquePtr p_XmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(p_XmlDoc); assertXPath( @@ -297,7 +302,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf129888dml, "tdf129888dml.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf130120) { - loadAndSave("tdf130120.docx"); + createSwDoc("tdf130120.docx"); + save(mpFilter); // Text for exporting the allowincell attribute: xmlDocUniquePtr p_XmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(p_XmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/mc:AlternateContent/" @@ -306,7 +312,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130120) CPPUNIT_TEST_FIXTURE(Test, Tdf133030) { - loadAndSave("tdf133030.docx"); + createSwDoc("tdf133030.docx"); + save(mpFilter); auto pExport = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pExport); @@ -489,7 +496,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130610) CPPUNIT_TEST_FIXTURE(Test, testTdf121045) { - loadAndSave("tdf121045.docx"); + createSwDoc("tdf121045.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:sz", "val", u"20"); @@ -552,7 +560,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf81567) CPPUNIT_TEST_FIXTURE(Test, testTdf92472) { - loadAndSave("tdf92472.docx"); + createSwDoc("tdf92472.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:sz", "val", u"20"); @@ -574,7 +583,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92472) CPPUNIT_TEST_FIXTURE(Test, Tdf133035) { - loadAndSave("tdf133035.docx"); + createSwDoc("tdf133035.docx"); + save(mpFilter); auto pxml = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pxml); OUString aXmlVal = getXPath(pxml, "/w:document/w:body/w:p[1]/w:r[1]/w:object/v:shape", "style"); @@ -713,7 +723,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf83309, "tdf83309.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf121661) { - loadAndSave("tdf121661.docx"); + createSwDoc("tdf121661.docx"); + save(mpFilter); xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlSettings, "/w:settings/w:hyphenationZone", "val", u"851"); @@ -766,7 +777,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf161628, "tdf132599_frames_on_right_pages_no_hyph CPPUNIT_TEST_FIXTURE(Test, testTdf155707) { - loadAndSave("tdf155707.docx"); + createSwDoc("tdf155707.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -778,7 +790,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf155707) CPPUNIT_TEST_FIXTURE(Test, testTdf161643) { - loadAndSave("fdo76163.docx"); + createSwDoc("fdo76163.docx"); + save(mpFilter); xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlSettings, "/w:settings/w:consecutiveHyphenLimit", "val", u"1"); @@ -789,14 +802,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf161643) CPPUNIT_TEST_FIXTURE(Test, testTdf121658) { - loadAndSave("tdf121658.docx"); + createSwDoc("tdf121658.docx"); + save(mpFilter); xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlSettings, "/w:settings/w:doNotHyphenateCaps"); } CPPUNIT_TEST_FIXTURE(Test, testTableStyleConfNested) { - loadAndSave("table-style-conf-nested.docx"); + createSwDoc("table-style-conf-nested.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Without the accompanying fix in place, this test would have failed, as the custom table cell diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 5813100cd917..7960c1bf1e10 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -29,7 +29,8 @@ public: CPPUNIT_TEST_FIXTURE(Test, testTdf123621) { - loadAndSave("tdf123621.docx"); + createSwDoc("tdf123621.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" @@ -133,7 +134,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf137850_compat15ZOrder, "tdf137850_compat15ZOrder CPPUNIT_TEST_FIXTURE(Test, testTdf118701) { - loadAndSave("tdf118701.docx"); + createSwDoc("tdf118701.docx"); + save(mpFilter); // This was 6, related to moving inline images after the page breaks CPPUNIT_ASSERT_EQUAL(4, getPages()); @@ -823,7 +825,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf131561_necessaryBorder, "tdf131561_necessaryBord CPPUNIT_TEST_FIXTURE(Test, testTdf135655) { - loadAndSave("tdf135655.odt"); + createSwDoc("tdf135655.odt"); + save(mpFilter); const xmlDocUniquePtr pExpDoc = parseExport(u"word/document.xml"_ustr); const OUString sXFillColVal = getXPath(pExpDoc, "/w:document/w:body/w:p/w:r/w:object/v:shape", "fillcolor"); CPPUNIT_ASSERT_EQUAL(u"#00A933"_ustr, sXFillColVal); @@ -831,7 +834,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135655) CPPUNIT_TEST_FIXTURE(Test, testTdf138374) { - loadAndSave("tdf138374.odt"); + createSwDoc("tdf138374.odt"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:pict/v:shape", "fillcolor", u"#ffd320"); assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:pict/v:shape", "coordsize", u"1315,6116"); @@ -919,7 +923,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125268) CPPUNIT_TEST_FIXTURE(Test, testTdf138345_numberingHighlight) { - loadAndSave("tdf138345_numberingHighlight.docx"); + createSwDoc("tdf138345_numberingHighlight.docx"); + save(mpFilter); // Before the fix, the highlight was completely lost. xmlDocUniquePtr pXmlStyles = parseExport(u"word/numbering.xml"_ustr); if (pXmlStyles) @@ -970,7 +975,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135665, "tdf135665.docx") CPPUNIT_TEST_FIXTURE(Test, testAtPageShapeRelOrientation) { - loadAndSave("rotated_shape.fodt"); + createSwDoc("rotated_shape.fodt"); + save(mpFilter); // invalid combination of at-page anchor and horizontal-rel="paragraph" // caused relativeFrom="column" instead of relativeFrom="page" @@ -1006,7 +1012,8 @@ CPPUNIT_TEST_FIXTURE(Test, testAtPageShapeRelOrientation) CPPUNIT_TEST_FIXTURE(Test, testVMLallowincell) { - loadAndSave("shape-atpage-in-table.fodt"); + createSwDoc("shape-atpage-in-table.fodt"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // VML o:allowincell, apparently the default is "t" @@ -1018,7 +1025,8 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLallowincell) CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromBottomMarginHasFooter) { - loadAndSave("tdf133070_testRelativeAnchorHeightFromBottomMarginHasFooter.docx"); + createSwDoc("tdf133070_testRelativeAnchorHeightFromBottomMarginHasFooter.docx"); + save(mpFilter); // tdf#133070 The height was set relative to page print area bottom, // but this was handled relative to page height. // Note: page print area bottom = margin + footer height. @@ -1042,7 +1050,8 @@ DECLARE_OOXMLEXPORT_TEST(TestTdf132483, "tdf132483.docx") CPPUNIT_TEST_FIXTURE(Test, TestTdf143028) { - loadAndSave("fail_bracePair.odt"); + createSwDoc("fail_bracePair.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); auto pExportXml = parseExport(u"word/document.xml"_ustr); @@ -1054,7 +1063,8 @@ CPPUNIT_TEST_FIXTURE(Test, TestTdf143028) CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromBottomMarginNoFooter) { - loadAndSave("tdf133070_testRelativeAnchorHeightFromBottomMarginNoFooter.docx"); + createSwDoc("tdf133070_testRelativeAnchorHeightFromBottomMarginNoFooter.docx"); + save(mpFilter); // tdf#133070 The height was set relative to page print area bottom, // but this was handled relative to page height. // Note: page print area bottom = margin + footer height. @@ -1065,14 +1075,16 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromBottomMarginNoFooter) CPPUNIT_TEST_FIXTURE(Test, testTdf133702) { - loadAndSave("tdf133702.docx"); + createSwDoc("tdf133702.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"); } CPPUNIT_TEST_FIXTURE(Test, testTdf135667) { - loadAndSave("tdf135667.odt"); + createSwDoc("tdf135667.odt"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // This was missing. @@ -1090,7 +1102,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135667) CPPUNIT_TEST_FIXTURE(Test, testImageSpaceSettings) { - loadAndSave("tdf135047_ImageSpaceSettings.fodt"); + createSwDoc("tdf135047_ImageSpaceSettings.fodt"); + save(mpFilter); // tdf#135047 The spaces of image were not saved. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distT", u"90170"); @@ -1132,7 +1145,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135660, "tdf135660.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf136814) { - loadAndSave("tdf136814.odt"); + createSwDoc("tdf136814.odt"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // Padding in this document is 0.10 cm which should translate to 3 pt (approx. 1.0583mm) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index 1af0e19e5397..72d141aab1ed 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -54,7 +54,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143860NonPrimitiveCustomShape) CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonCurve) { - loadAndSave("tdf136386_WrapPolygonCurve.odt"); + createSwDoc("tdf136386_WrapPolygonCurve.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Document has a curve with contour wrap and 'outside only'. Error was, that type 'square' was @@ -72,7 +73,8 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonCurve) CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonLineShape) { - loadAndSave("tdf136386_WrapPolygonLineShape.odt"); + createSwDoc("tdf136386_WrapPolygonLineShape.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Document has a sloping line with contour wrap. Error was, that type 'square' was written and @@ -111,7 +113,8 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonCustomShape) CPPUNIT_TEST_FIXTURE(Test, testFrameWrapTextMode) { - loadAndSave("tdf143432_Frame_WrapTextMode.odt"); + createSwDoc("tdf143432_Frame_WrapTextMode.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -199,7 +202,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf142486_LeftMarginShadowLeft, "tdf142486_LeftMarg DECLARE_OOXMLEXPORT_TEST(testTdf151384Hyperlink, "151384Hyperlink.odt") { - loadAndSave("151384Hyperlink.odt"); + createSwDoc("151384Hyperlink.odt"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle", "val", u"Hyperlink"); @@ -424,7 +428,8 @@ DECLARE_OOXMLEXPORT_TEST(testGutterLeft, "gutter-left.docx") CPPUNIT_TEST_FIXTURE(Test, testGutterTop) { - loadAndSave("gutter-top.docx"); + createSwDoc("gutter-top.docx"); + save(mpFilter); xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); CPPUNIT_ASSERT(pXmlSettings); // Without the accompanying fix in place, this test would have failed with: @@ -469,7 +474,8 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomShapePresetExport) CPPUNIT_TEST_FIXTURE(Test, testTdf148671) { - loadAndSave("tdf148671.docx"); + createSwDoc("tdf148671.docx"); + save(mpFilter); // Don't assert with 'pFieldMark' failed when document is opened CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -554,7 +560,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135773_numberingShading) officecfg::Office::Common::Filter::Microsoft::Export::CharBackgroundToHighlighting::set(true, batch); batch->commit(); - loadAndSave("tdf135774_numberingShading.docx"); + createSwDoc("tdf135774_numberingShading.docx"); + save(mpFilter); // This test uses a custom setting to export CharBackground as Highlight instead of the 7.0 default of Shading. // Before the fix, the imported shading was converted into a red highlight. @@ -711,7 +718,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf149198, "tdf149198.docx") CPPUNIT_TEST_FIXTURE(Test, testFooterMarginLost) { - loadAndSave("footer-margin-lost.docx"); + createSwDoc("footer-margin-lost.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Without the accompanying fix in place, this test would have failed with: // - Expected: 709 @@ -910,7 +918,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf105688, "tdf105688.docx") CPPUNIT_TEST_FIXTURE(Test, testCommentReply) { - loadAndSave("CommentReply.docx"); + createSwDoc("CommentReply.docx"); + save(mpFilter); xmlDocUniquePtr pXmlComm = parseExport(u"word/comments.xml"_ustr); xmlDocUniquePtr pXmlCommExt = parseExport(u"word/commentsExtended.xml"_ustr); CPPUNIT_ASSERT(pXmlComm); @@ -928,7 +937,8 @@ CPPUNIT_TEST_FIXTURE(Test, testCommentReply) CPPUNIT_TEST_FIXTURE(Test, testCommentDone) { - loadAndSave("CommentDone.docx"); + createSwDoc("CommentDone.docx"); + save(mpFilter); xmlDocUniquePtr pXmlComm = parseExport(u"word/comments.xml"_ustr); assertXPath(pXmlComm, "/w:comments/w:comment[1]/w:p", 2); OUString idLastPara = getXPath(pXmlComm, "/w:comments/w:comment[1]/w:p[2]", "paraId"); @@ -1003,7 +1013,8 @@ CPPUNIT_TEST_FIXTURE(Test, testCommentDoneModel) CPPUNIT_TEST_FIXTURE(Test, Test_ShadowDirection) { - loadAndSave("tdf142361ShadowDirection.odt"); + createSwDoc("tdf142361ShadowDirection.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The attribute 'rotWithShape' has the default value 'true' in OOXML, so Words interprets a @@ -1019,7 +1030,8 @@ CPPUNIT_TEST_FIXTURE(Test, Test_ShadowDirection) CPPUNIT_TEST_FIXTURE(Test, testTdf150542) { - loadAndSave("tdf150542.docx"); + createSwDoc("tdf150542.docx"); + save(mpFilter); xmlDocUniquePtr pSettingsDoc = parseExport(u"word/settings.xml"_ustr); // Ensure that all docvars from input are written back and with correct values. @@ -1040,7 +1052,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150542) CPPUNIT_TEST_FIXTURE(Test, testTdf139549) { - loadAndSave("tdf139549.docx"); + createSwDoc("tdf139549.docx"); + save(mpFilter); // Document contains a VML textbox, the position of the textbox was incorrect. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); OUString aStyle = getXPath(pXmlDoc, "//w:pict/v:shape", "style"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index f3c0ddacadc9..4afd4d501f16 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -224,7 +224,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf146802, "tdf146802.docx") CPPUNIT_TEST_FIXTURE(Test, testParaStyleNumLevel) { - loadAndSave("para-style-num-level.docx"); + createSwDoc("para-style-num-level.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 @@ -236,7 +237,8 @@ CPPUNIT_TEST_FIXTURE(Test, testParaStyleNumLevel) CPPUNIT_TEST_FIXTURE(Test, testClearingBreak) { // Given a document with a clearing break, when saving to DOCX: - loadAndSave("clearing-break.docx"); + createSwDoc("clearing-break.docx"); + save(mpFilter); // Then make sure that the clearing break is not lost: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -489,7 +491,8 @@ CPPUNIT_TEST_FIXTURE(Test, testNegativePageBorder) CPPUNIT_TEST_FIXTURE(Test, testTdf148494) { - loadAndSave("tdf148494.docx"); + createSwDoc("tdf148494.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -501,7 +504,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148494) CPPUNIT_TEST_FIXTURE(Test, testTdf137466) { - loadAndSave("tdf137466.docx"); + createSwDoc("tdf137466.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Ensure that we have <w:placeholder><w:docPart v:val="xxxx"/></w:placeholder> @@ -538,7 +542,8 @@ CPPUNIT_TEST_FIXTURE(Test, testDontAddNewStyles) }); // When saving that document: - loadAndSave("dont-add-new-styles.docx"); + createSwDoc("dont-add-new-styles.docx"); + save(mpFilter); // Then make sure that export doesn't have additional styles, Caption was one of them: xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); @@ -908,7 +913,8 @@ DECLARE_OOXMLEXPORT_TEST(TestTdf73499, "tdf73499.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf81507) { - loadAndSave("tdf81507.docx"); + createSwDoc("tdf81507.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Ensure that we have <w:text w:multiLine="1"/> @@ -1010,7 +1016,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148455_1, "tdf148455_1.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf148455_2) { - loadAndSave("tdf148455_2.docx"); + createSwDoc("tdf148455_2.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Find list id for restarted list @@ -1074,7 +1081,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf154481, "tdf154481.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf149200) { - loadAndSave("tdf149200.docx"); + createSwDoc("tdf149200.docx"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index c92dd7a582f4..5ea3b12dae85 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -64,14 +64,16 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineSdtHeader) { // Without the accompanying fix in place, this test would have failed with an assertion failure, // we produced not-well-formed XML on save. - loadAndSave("inline-sdt-header.docx"); + createSwDoc("inline-sdt-header.docx"); + save(mpFilter); } CPPUNIT_TEST_FIXTURE(Test, testCellSdtRedline) { // Without the accompanying fix in place, this test would have failed with an assertion failure, // we produced not-well-formed XML on save. - loadAndSave("cell-sdt-redline.docx"); + createSwDoc("cell-sdt-redline.docx"); + save(mpFilter); } CPPUNIT_TEST_FIXTURE(Test, testTdf148956_directEndFormatting) @@ -163,7 +165,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf154751_dualStrikethrough, "tdf154751_dualStriket CPPUNIT_TEST_FIXTURE(Test, testTdf154478) { - loadAndSave("tdf154478.docx"); + createSwDoc("tdf154478.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/comments.xml"_ustr); OUString aValues[5] = { u"Comment1 seen."_ustr, u"Comment2 seen."_ustr, u"Comment3 NOTseen."_ustr, u"Comment4 NOTseen."_ustr, u"Comment5 NOTseen."_ustr }; @@ -179,7 +182,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154478) CPPUNIT_TEST_FIXTURE(Test, testTdf153592_columnBreaks) { - loadAndSave("tdf153592_columnBreaks.docx"); + createSwDoc("tdf153592_columnBreaks.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // The two column breaks were lost on import. (I wouldn't complain if they were at 3,5) @@ -311,7 +315,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154703_framePr2) CPPUNIT_TEST_FIXTURE(Test, testTdf154703_framePrWrapSpacing) { - loadAndSave("tdf154703_framePrWrapSpacing.docx"); + createSwDoc("tdf154703_framePrWrapSpacing.docx"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -522,7 +527,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153964_firstIndentAfterBreak14, "tdf153964_first CPPUNIT_TEST_FIXTURE(Test, testTdf148834_lineNumbering) { - loadAndSave("tdf148834_lineNumbering.odt"); + createSwDoc("tdf148834_lineNumbering.odt"); + save(mpFilter); xmlDocUniquePtr pStylesXml = parseExport(u"word/styles.xml"_ustr); // user specified: do not include in line numbering @@ -535,7 +541,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148834_lineNumbering) CPPUNIT_TEST_FIXTURE(Test, testTdf157598) { - loadAndSave("tdf157598.docx"); + createSwDoc("tdf157598.docx"); + save(mpFilter); xmlDocUniquePtr pStylesXml = parseExport(u"word/styles.xml"_ustr); @@ -590,7 +597,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149551_mongolianVert) CPPUNIT_TEST_FIXTURE(Test, testTdf151912) { - loadAndSave("tdf151912.docx"); + createSwDoc("tdf151912.docx"); + save(mpFilter); // For now just ensure roundtrip is successful //tdf#151548 - ensure block SDT preserves id (instead of random re-assignment) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx index b6fd0c873259..f0efba395d82 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx @@ -860,7 +860,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf107359, "tdf107359-char-pitch.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf77236_MissingSolidFill) { - loadAndSave("tdf77236_MissingSolidFill.docx"); + createSwDoc("tdf77236_MissingSolidFill.docx"); + save(mpFilter); // tdf#77236: solidFill of VML shape was not exported if the colors of line and style were the same xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath( @@ -912,7 +913,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105875_VmlShapeRotationWithFlip) CPPUNIT_TEST_FIXTURE(Test, testTdf133363) { - loadAndSave("tdf133363.docx"); + createSwDoc("tdf133363.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // tdf#133363: remove extra auto space between first and second list elements assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[2]/w:pPr/w:spacing", "before", @@ -1110,7 +1112,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133560) CPPUNIT_TEST_FIXTURE(Test, testTdf150408_isLvl_RoundTrip) { - loadAndSave("listWithLgl.docx"); + createSwDoc("listWithLgl.docx"); + save(mpFilter); // Second level's numbering should use Arabic numbers for first level reference auto xPara = getParagraph(1); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index 96fb290dd764..5bca1a572288 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -57,7 +57,8 @@ CPPUNIT_TEST_FIXTURE(Test, testPageGraphicBackground) CPPUNIT_TEST_FIXTURE(Test, testCustomProperties) { - loadAndSave("custom-properties.docx"); + createSwDoc("custom-properties.docx"); + save(mpFilter); // tdf#133377 tdf#103987 FILESAVE XLSX: Make sure the custom/core/application // file properties are stored correctly after roundtrip to .docx @@ -634,7 +635,8 @@ DECLARE_OOXMLEXPORT_TEST(testTextframeGradient, "textframe-gradient.docx") CPPUNIT_TEST_FIXTURE(Test, testCellBtlr) { - loadAndSave("cell-btlr.docx"); + createSwDoc("cell-btlr.docx"); + save(mpFilter); /* * The problem was that the exporter didn't mirror the workaround of the * importer, regarding the btLr text direction: the <w:textDirection @@ -947,7 +949,8 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66929, "fdo66929.docx") CPPUNIT_TEST_FIXTURE(Test, testPageBorderSpacingExportCase2) { - loadAndSave("page-borders-export-case-2.docx"); + createSwDoc("page-borders-export-case-2.docx"); + save(mpFilter); // The problem was that the exporter didn't mirror the workaround of the // importer, regarding the page border's spacing : the <w:pgBorders w:offsetFrom="page"> // and the inner nodes like <w:top w:space="24" ... /> @@ -969,7 +972,8 @@ CPPUNIT_TEST_FIXTURE(Test, testPageBorderSpacingExportCase2) CPPUNIT_TEST_FIXTURE(Test, testGrabBag) { - loadAndSave("grabbag.docx"); + createSwDoc("grabbag.docx"); + save(mpFilter); // w:mirrorIndents was lost on roundtrip, now should be handled as a grab bag property xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:mirrorIndents"); @@ -1156,7 +1160,8 @@ DECLARE_OOXMLEXPORT_TEST(testTransparentShadow, "transparent-shadow.docx") CPPUNIT_TEST_FIXTURE(Test, NoFillAttrInImagedata) { - loadAndSave("NoFillAttrInImagedata.docx"); + createSwDoc("NoFillAttrInImagedata.docx"); + save(mpFilter); //problem was that type and color2 which are v:fill attributes were written in 'v:imagedata'. The //source file has v:fill and no v:imagedata. Same should be in the file written by LO. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx index 43e5812f452d..9f89db16c145 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx @@ -35,7 +35,8 @@ public: CPPUNIT_TEST_FIXTURE(Test, testfdo79969_xlsb) { - loadAndSave("fdo79969_xlsb.docx"); + createSwDoc("fdo79969_xlsb.docx"); + save(mpFilter); // This UT for DOCX embedded with binary excel work sheet. xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); @@ -57,7 +58,8 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79969_xlsb) CPPUNIT_TEST_FIXTURE(Test, testfdo80097) { - loadAndSave("fdo80097.docx"); + createSwDoc("fdo80097.docx"); + save(mpFilter); //fdo#76635 : Table borders are not getting preserved. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -109,7 +111,8 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80097) CPPUNIT_TEST_FIXTURE(Test, testTdf95033) { - loadAndSave("tdf95033.docx"); + createSwDoc("tdf95033.docx"); + save(mpFilter); //tdf#95033 : Table borders defined by row-level tblPrEx are not getting preserved. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -137,7 +140,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf95033) CPPUNIT_TEST_FIXTURE(Test, testTdf133455) { - loadAndSave("tdf133455.docx"); + createSwDoc("tdf133455.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); //Not disabled table cell borders @@ -169,7 +173,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133455) CPPUNIT_TEST_FIXTURE(Test, testTdf138612) { - loadAndSave("tdf138612.docx"); + createSwDoc("tdf138612.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // Row 5 Col 1 - vertically merged cell @@ -192,7 +197,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138612) CPPUNIT_TEST_FIXTURE(Test, testTdf140597) { - loadAndSave("tdf140597.docx"); + createSwDoc("tdf140597.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // There were missing tblPrEx table exception borders @@ -209,7 +215,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf140597) CPPUNIT_TEST_FIXTURE(Test, testTdf128646) { - loadAndSave("tdf128646.docx"); + createSwDoc("tdf128646.docx"); + save(mpFilter); // The problem was that not hidden shapes anchored to empty hidden paragraphs were imported as hidden. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -246,7 +253,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128646) CPPUNIT_TEST_FIXTURE(Test, testTdf119800) { - loadAndSave("tdf119800.docx"); + createSwDoc("tdf119800.docx"); + save(mpFilter); // The problem was that not hidden shapes anchored to empty hidden paragraphs were imported as hidden. // (tdf#128646 solved the same only for table paragraphs) xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -258,7 +266,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119800) CPPUNIT_TEST_FIXTURE(Test, testTdf131728) { - loadAndSave("tdf131728.docx"); + createSwDoc("tdf131728.docx"); + save(mpFilter); // Inline paragraphs specified by w:specVanish were loaded as not // inline paragraphs, breaking the paragraph layout. Use ODF text // frame to keep the paragraph layout, where the frame contains the @@ -271,7 +280,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131728) CPPUNIT_TEST_FIXTURE(Test, testTdf48459) { - loadAndSave("tdf48459.fodt"); + createSwDoc("tdf48459.fodt"); + save(mpFilter); // export Inline Heading frame style as style separator xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -282,7 +292,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf48459) CPPUNIT_TEST_FIXTURE(Test, testTdf164901) { - loadAndSave("tdf164901.docx"); + createSwDoc("tdf164901.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 (lost floating table because of containing a style separator) @@ -291,7 +302,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf164901) CPPUNIT_TEST_FIXTURE(Test, testFdo77129) { - loadAndSave("fdo77129.docx"); + createSwDoc("fdo77129.docx"); + save(mpFilter); // The problem was that text after TOC field was missing if footer reference comes in field. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -328,7 +340,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf129402, "fdo77129.docx") CPPUNIT_TEST_FIXTURE(Test, testfdo79969_xlsm) { - loadAndSave("fdo79969_xlsm.docx"); + createSwDoc("fdo79969_xlsm.docx"); + save(mpFilter); // This UT for DOCX embedded with excel work sheet. xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); @@ -416,7 +429,8 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80523_sldm) CPPUNIT_TEST_FIXTURE(Test, testfdo80898) { - loadAndSave("fdo80898.docx"); + createSwDoc("fdo80898.docx"); + save(mpFilter); // This UT for DOCX embedded with binary excel work sheet. xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); @@ -437,7 +451,8 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80898) CPPUNIT_TEST_FIXTURE(Test, testOleIconDrawAspect) { - loadAndSave("tdf131537.odt"); + createSwDoc("tdf131537.odt"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/o:OLEObject", "DrawAspect", u"Icon"); @@ -445,7 +460,8 @@ CPPUNIT_TEST_FIXTURE(Test, testOleIconDrawAspect) CPPUNIT_TEST_FIXTURE(Test, testTableCellWithDirectFormatting) { - loadAndSave("fdo80800.docx"); + createSwDoc("fdo80800.docx"); + save(mpFilter); // Issue was Direct Formatting for non-first Table cells was not getting preserved. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -540,7 +556,8 @@ DECLARE_OOXMLEXPORT_TEST(test2colHeader, "2col-header.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf148035) { - loadAndSave("tdf148035.docx"); + createSwDoc("tdf148035.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r[2]/w:t", @@ -558,7 +575,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148035) CPPUNIT_TEST_FIXTURE(Test, testfdo83048) { - loadAndSave("fdo83048.docx"); + createSwDoc("fdo83048.docx"); + save(mpFilter); // Issue was wrong SDT properties were getting exported for Date SDT xmlDocUniquePtr pXmlDoc = parseExport(u"word/footer2.xml"_ustr); @@ -570,7 +588,8 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo83048) CPPUNIT_TEST_FIXTURE(Test, testSdt2Run) { - loadAndSave("sdt-2-run.docx"); + createSwDoc("sdt-2-run.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // The problem was that <w:sdt> was closed after "first", not after "second", so the second assert failed. @@ -582,7 +601,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSdt2Run) CPPUNIT_TEST_FIXTURE(Test, testFD083057) { - loadAndSave("fdo83057.docx"); + createSwDoc("fdo83057.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/header2.xml"_ustr); // A fly frame was attached to a para which started with a hint (run) containing an SDT. @@ -597,7 +617,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFD083057) CPPUNIT_TEST_FIXTURE(Test, testHeaderBorder) { - loadAndSave("header-border.docx"); + createSwDoc("header-border.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0, as header margin was lost during import. assertXPath(pXmlDoc, "//w:pgMar", "header", u"720"); @@ -626,7 +647,8 @@ DECLARE_OOXMLEXPORT_TEST(testImageNoborder, "image-noborder.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf89774) { - loadAndSave("tdf89774.fodt"); + createSwDoc("tdf89774.fodt"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"docProps/app.xml"_ustr); // This was 65, as unit was seconds instead of minutes. assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:TotalTime", @@ -658,7 +680,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSectionProtection) CPPUNIT_TEST_FIXTURE(Test, testSectionProtection2) { - loadAndSave("sectionprot2.odt"); + createSwDoc("sectionprot2.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", u"true"); @@ -713,7 +736,8 @@ CPPUNIT_TEST_FIXTURE(Test, tdf66398_permissions) CPPUNIT_TEST_FIXTURE(Test, tdf166173_enforcement) { - loadAndSave("tdf166173_enforcement.docx"); + createSwDoc("tdf166173_enforcement.docx"); + save(mpFilter); xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); // check if attribute 'enforcement' of 'documentProtection' has still '0' value. @@ -722,7 +746,8 @@ CPPUNIT_TEST_FIXTURE(Test, tdf166173_enforcement) CPPUNIT_TEST_FIXTURE(Test, tdf106843) { - loadAndSave("tdf106843.fodt"); + createSwDoc("tdf106843.fodt"); + save(mpFilter); // check Track Changes permission set in Writer/OpenDocument (password: "test", encoded by default encoding of Writer) xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", u"trackedChanges"); @@ -740,7 +765,8 @@ CPPUNIT_TEST_FIXTURE(Test, tdf106843) CPPUNIT_TEST_FIXTURE(Test, tdf89991_revisionView) { - loadAndSave("tdf89991.docx"); + createSwDoc("tdf89991.docx"); + save(mpFilter); // check revisionView (Show Changes) import and export xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlSettings, "/w:settings/w:revisionView", "insDel", u"0"); @@ -867,7 +893,8 @@ CPPUNIT_TEST_FIXTURE(Test, testOO72950) //considered the same table CPPUNIT_TEST_FIXTURE(Test, fdo60957) { - loadAndSave("fdo60957-2.docx"); + createSwDoc("fdo60957-2.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:tbl", 2); @@ -885,7 +912,8 @@ CPPUNIT_TEST_FIXTURE(Test, fdo60957) //number of cell start and ends CPPUNIT_TEST_FIXTURE(Test, testOO106020) { - loadAndSave("ooo106020-1.odt"); + createSwDoc("ooo106020-1.odt"); + save(mpFilter); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:tbl", 1); } @@ -899,7 +927,8 @@ DECLARE_OOXMLEXPORT_TEST(testNonBMPChar, "nonbmpchar.docx") CPPUNIT_TEST_FIXTURE(Test, testSpacingGroupShapeText) { - loadAndSave("tdf131775_SpacingGroupShapeText.docx"); + createSwDoc("tdf131775_SpacingGroupShapeText.docx"); + save(mpFilter); // tdf#131775: Check if correct spacing. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -913,7 +942,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSpacingGroupShapeText) CPPUNIT_TEST_FIXTURE(Test, testTdf100581) { - loadAndSave("tdf100581.odt"); + createSwDoc("tdf100581.odt"); + save(mpFilter); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -943,7 +973,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf100581) CPPUNIT_TEST_FIXTURE(Test, testTdf112287) { - loadAndSave("tdf112287.docx"); + createSwDoc("tdf112287.docx"); + save(mpFilter); // tdf#131775: Check if correct spacing. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -956,7 +987,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112287) CPPUNIT_TEST_FIXTURE(Test, testTdf157572_defaultVAnchor) { - loadAndSave("tdf157572_defaultVAnchor.docx"); + createSwDoc("tdf157572_defaultVAnchor.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // vAnchor wasn't defined on import. It should default to 'margin' when w:y=non-zero @@ -967,7 +999,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157572_defaultVAnchor) CPPUNIT_TEST_FIXTURE(Test, testTdf157572_insidiousCombination) { - loadAndSave("tdf157572_insidiousCombination.docx"); + createSwDoc("tdf157572_insidiousCombination.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // This is a NASTY example. In MS Word, it IMPORTS yAlign=bottom, but positions it as y=0. @@ -985,7 +1018,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157572_insidiousCombination) CPPUNIT_TEST_FIXTURE(Test, testTdf157572_noVAlignAsText) { - loadAndSave("tdf157572_noVAlignAsText.docx"); + createSwDoc("tdf157572_noVAlignAsText.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "vAnchor", u"text"); @@ -995,7 +1029,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157572_noVAlignAsText) CPPUNIT_TEST_FIXTURE(Test, testTdf112287B) { - loadAndSave("tdf112287B.docx"); + createSwDoc("tdf112287B.docx"); + save(mpFilter); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "vAnchor", u"text"); @@ -1004,7 +1039,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112287B) CPPUNIT_TEST_FIXTURE(Test, testZOrderInHeader) { - loadAndSave("tdf120760_ZOrderInHeader.docx"); + createSwDoc("tdf120760_ZOrderInHeader.docx"); + save(mpFilter); // tdf#120760 Check that the Z-Order of the background is smaller than the front shape's. xmlDocUniquePtr pXml = parseExport(u"word/header2.xml"_ustr); @@ -1023,7 +1059,8 @@ CPPUNIT_TEST_FIXTURE(Test, testZOrderInHeader) CPPUNIT_TEST_FIXTURE(Test, testSvgExtensionsSupport) { - loadAndSave("SvgImageTest.odt"); + createSwDoc("SvgImageTest.odt"); + save(mpFilter); xmlDocUniquePtr pXmlDocRels = parseExport(u"word/_rels/document.xml.rels"_ustr); @@ -1048,7 +1085,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSvgExtensionsSupport) CPPUNIT_TEST_FIXTURE(Test, testtdf158044) { - loadAndSave("tdf158044.odt"); + createSwDoc("tdf158044.odt"); + save(mpFilter); // write hard attributes to prevent multiple toggle attributes from vanishing xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx index 6024dfffe028..f9cfb1db794a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx @@ -768,7 +768,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159207_footerFramePrBorder) CPPUNIT_TEST_FIXTURE(Test, testTdf160814_commentOrder) { // given a document with a comment and 5 replies - loadAndSave("tdf160814_commentOrder.docx"); + createSwDoc("tdf160814_commentOrder.docx"); + save(mpFilter); // make sure the order of the comments is imported and exported correctly xmlDocUniquePtr pXmlComments = parseExport(u"word/comments.xml"_ustr); @@ -785,7 +786,8 @@ CPPUNIT_TEST_FIXTURE(Test, testPersonalMetaData) auto pBatch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::Security::Scripting::RemovePersonalInfoOnSaving::set(true, pBatch); pBatch->commit(); - loadAndSave("personalmetadata.docx"); + createSwDoc("personalmetadata.docx"); + save(mpFilter); xmlDocUniquePtr pAppDoc = parseExport(u"docProps/app.xml"_ustr); assertXPath(pAppDoc, "/extended-properties:Properties/extended-properties:Template", 0); @@ -801,7 +803,8 @@ CPPUNIT_TEST_FIXTURE(Test, testPersonalMetaData) // 2. Remove personal information, keep user information officecfg::Office::Common::Security::Scripting::KeepDocUserInfoOnSaving::set(true, pBatch); pBatch->commit(); - loadAndSave("personalmetadata.docx"); + createSwDoc("personalmetadata.docx"); + save(mpFilter); pAppDoc = parseExport(u"docProps/app.xml"_ustr); assertXPath(pAppDoc, "/extended-properties:Properties/extended-properties:Template", 0); @@ -823,7 +826,8 @@ CPPUNIT_TEST_FIXTURE(Test, testPersonalMetaData) CPPUNIT_TEST_FIXTURE(Test, testTdf169072_illegalDates) { // Given a document that MS Word reports as corrupt - loadAndSave("tdf169072_illegalDates.docx"); + createSwDoc("tdf169072_illegalDates.docx"); + save(mpFilter); // Date Years MUST be greater than 1600 and less than 10,000 // so by dropping invalid entries, we have a document that MS Word can now cleanly open @@ -836,7 +840,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf169072_illegalDates) CPPUNIT_TEST_FIXTURE(Test, testRemoveOnlyEditTimeMetaData) { // 1. Check we have the original edit time info - loadAndSave("personalmetadata.docx"); + createSwDoc("personalmetadata.docx"); + save(mpFilter); xmlDocUniquePtr pAppDoc = parseExport(u"docProps/app.xml"_ustr); assertXPath(pAppDoc, "/extended-properties:Properties/extended-properties:TotalTime", 1); @@ -846,7 +851,8 @@ CPPUNIT_TEST_FIXTURE(Test, testRemoveOnlyEditTimeMetaData) pBatch->commit(); // 2. Check edit time info is removed - loadAndSave("personalmetadata.docx"); + createSwDoc("personalmetadata.docx"); -e ... etc. - the rest is truncated
