sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 22 ++++++------- sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 10 +++--- sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 6 +-- sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 6 +-- sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 18 +++++------ sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 8 ++-- sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 6 +-- sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 12 +++---- sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 2 - sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 2 - sw/qa/extras/ooxmlexport/ooxmlexport6.cxx | 18 +++++------ sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 4 +- sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 42 +++++++++++++------------- sw/qa/inc/swmodeltestbase.hxx | 2 - 14 files changed, 79 insertions(+), 79 deletions(-)
New commits: commit 0c79a2df8bf3e07933e9dd399bd88e0f0428dee3 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Nov 8 15:50:41 2022 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Nov 8 19:04:27 2022 +0100 swmodeltestbase: Do not use a default parameter in parseExport For better readibility and to help to remove duplicated code in following commits Change-Id: I90745c54492544757e2174412bbb2f16d422a89c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142463 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 2c3debcee302..43c4c926ae50 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -62,7 +62,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo81381) CPPUNIT_TEST_FIXTURE(Test, testSdtAlias) { loadAndSave("sdt-alias.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // <w:alias> was completely missing. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:alias", "val", "Subtitle"); @@ -71,7 +71,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtAlias) CPPUNIT_TEST_FIXTURE(Test, testFooterBodyDistance) { loadAndSave("footer-body-distance.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Page break was exported as section break, this was 0 assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); } @@ -142,7 +142,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPlausableBorder) { loadAndSave("plausable-border.docx"); // sw::util::IsPlausableSingleWordSection() did not merge two page styles due to borders. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Page break was exported as section break, this was 0 assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); @@ -152,7 +152,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPlausableBorder) CPPUNIT_TEST_FIXTURE(Test, testUnwantedSectionBreak) { loadAndSave("unwanted-section-break.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This was 2: an additional sectPr was added to the document. assertXPath(pXmlDoc, "//w:sectPr", 1); } @@ -160,7 +160,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUnwantedSectionBreak) CPPUNIT_TEST_FIXTURE(Test, testfdo80897 ) { loadAndSave("fdo80897.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); 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", "textTriangle"); } @@ -699,7 +699,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphMarkNonempty) { loadAndSave("paragraph-mark-nonempty.odt"); CPPUNIT_ASSERT_EQUAL(1, getPages()); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // There were two <w:sz> elements, make sure the 40 one is dropped and the 20 one is kept. assertXPath(pXmlDoc, "//w:p/w:pPr/w:rPr/w:sz", "val", "20"); } @@ -1027,7 +1027,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118682) { loadAndSave("tdf118682.fodt"); // Support cell references in table formulas - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Formula fields were completely missing. assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r/w:fldChar", 3); @@ -1041,7 +1041,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118682) CPPUNIT_TEST_FIXTURE(Test, testTdf133163) { loadAndSave("tdf133163.fodt"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Formula cells were completely missing. assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r/w:fldChar", 3); @@ -1055,7 +1055,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133163) CPPUNIT_TEST_FIXTURE(Test, testTdf133647) { loadAndSave("tdf133647.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Keep original formula during round-trip assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[4]/w:p/w:r[2]/w:instrText", " =SUM(A1,B1)"); @@ -1071,7 +1071,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133647) CPPUNIT_TEST_FIXTURE(Test, testTdf123386) { loadAndSave("tdf123386.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Keep original formula during round-trip assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[4]/w:p/w:r[2]/w:instrText", " =A1 < 2"); @@ -1089,7 +1089,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123386) CPPUNIT_TEST_FIXTURE(Test, testTdf123389) { loadAndSave("tdf123389.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Keep original formula during round-trip assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[4]/w:p/w:r[2]/w:instrText", " =ROUND(2.345,1)"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index a78ddcb9c578..e5e7394c964c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -369,7 +369,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73389) // 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. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tblPr/w:tblW","type","dxa"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tblPr/w:tblW","w","1611"); @@ -378,7 +378,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73389) CPPUNIT_TEST_FIXTURE(Test, testTdf133735) { loadAndSave("fdo73389.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); 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", "0"); // This was 200 @@ -398,7 +398,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf59274) { loadAndSave("tdf59274.docx"); // Table with "auto" table width and incomplete grid: 11 columns, but only 4 gridCol elements. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW", "type", "dxa"); // This was 7349: sum of the cell widths in first row, but the table width is determined by a longer row later. @@ -624,7 +624,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116194) { loadAndSave("tdf116194.docx"); // The problem was that the importer lost consecutive tables with w:gridBefore - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl", 2); } @@ -632,7 +632,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134606) { loadAndSave("tdf134606.docx"); // The problem was that the importer lost the nested table structure with w:gridBefore - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); 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 872bda8491f5..0f0af36ec7c7 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -161,7 +161,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121456_tabsOffset) CPPUNIT_TEST_FIXTURE(Test, testTdf121561_tocTitle) { loadAndSave("tdf121456_tabsOffset.odt"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r/w:t", "Inhaltsverzeichnis"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r/w:instrText", " TOC \\f \\o \"1-9\" \\h"); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartGallery", "val", "Table of Contents"); @@ -171,7 +171,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121561_tocTitle) CPPUNIT_TEST_FIXTURE(Test, testTdf129525) { loadAndSave("tdf129525.rtf"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[4]/w:t", "Overview"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[5]/w:t", "3"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r[1]/w:t", "More detailed description"); @@ -192,7 +192,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121561_tocTitleDocx) { loadAndSave("tdf121456_tabsOffset.odt"); CPPUNIT_ASSERT_EQUAL(7, getPages()); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // get TOC node uno::Reference<text::XDocumentIndexesSupplier> xIndexSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index d2cb7cefee14..09e916005468 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -1974,7 +1974,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121176, "tdf121176.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf128913) { loadAndSave("tdf128913.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:del/w:r/w:drawing/wp:inline/a:graphic"); @@ -1983,7 +1983,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128913) CPPUNIT_TEST_FIXTURE(Test, testTdf142700) { loadAndSave("tdf142700.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:del/w:r/w:drawing/wp:anchor/a:graphic"); @@ -1992,7 +1992,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142700) CPPUNIT_TEST_FIXTURE(Test, testTdf142387) { loadAndSave("tdf142387.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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", "inserts "); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 19eed0d2efe3..64478819f0b8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -130,7 +130,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118701) // This was 6, related to moving inline images after the page breaks CPPUNIT_ASSERT_EQUAL(4, getPages()); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr[1]/w:numPr", 0); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr[1]/w:numPr", 0); @@ -187,7 +187,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123401) CPPUNIT_ASSERT_EQUAL(OUString("AVERAGE(<A1:A3>)"), xEnumerationAccess2->getPresentation(true).trim()); CPPUNIT_ASSERT_EQUAL(OUString("3"), xEnumerationAccess2->getPresentation(false).trim()); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // MEAN converted to AVERAGE assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:instrText", " =AVERAGE(A1:A2)"); @@ -209,7 +209,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116394, "tdf116394.docx") if (!isExported()) return; - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", " MERGEFIELD ab=cd "); } @@ -361,7 +361,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123355, "tdf123355.docx") if (!isExported()) return; - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // keep original formula IDs assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p/w:r[2]/w:instrText", " =average( below )"); @@ -412,7 +412,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123382, "tdf123382.docx") if (!isExported()) return; - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // keep original formula IDs assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:r[2]/w:instrText", " =MAX(RIGHT)"); @@ -450,7 +450,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf122648, "tdf122648.docx") if (!isExported()) return; - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[2]/w:p/w:r[2]/w:instrText", " =A1"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[2]/w:tc[2]/w:p/w:r[2]/w:instrText", " =SUM(A1:B1)"); @@ -795,7 +795,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf131561_necessaryBorder, "tdf131561_necessaryBord CPPUNIT_TEST_FIXTURE(Test, testTdf135655) { loadAndSave("tdf135655.odt"); - const xmlDocUniquePtr pExpDoc = parseExport(); + const xmlDocUniquePtr pExpDoc = parseExport("word/document.xml"); const OUString sXFillColVal = getXPath(pExpDoc, "/w:document/w:body/w:p/w:r/w:object/v:shape", "fillcolor"); CPPUNIT_ASSERT_EQUAL(OUString("#00A933"), sXFillColVal); } @@ -1009,7 +1009,7 @@ CPPUNIT_TEST_FIXTURE(Test, TestTdf143028) loadAndSave("fail_bracePair.odt"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); - auto pExportXml = parseExport(); + auto pExportXml = parseExport("word/document.xml"); CPPUNIT_ASSERT_EQUAL(1, getXPathNode( pExportXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/" @@ -1057,7 +1057,7 @@ CPPUNIT_TEST_FIXTURE(Test, testImageSpaceSettings) { loadAndSave("tdf135047_ImageSpaceSettings.fodt"); // tdf#135047 The spaces of image were not saved. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distT", "90170"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distB", "90170"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distL", "90170"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index 696bfa303b99..d0f23c5b9d6f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -651,7 +651,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTextframeHyperlink) // (Currently the Writer text frame becomes a text box (shape based)). See tdf#140961 reload(mpFilter, "docxopenhyperlinkbox.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // DML assertXPath(pXmlDoc, "//w:drawing/wp:anchor/wp:docPr/a:hlinkClick", 1); // VML @@ -668,7 +668,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146171_invalid_change_date) // reload("writer8", "tdf146171.odt"); reload("Office Open XML Text", "tdf146171.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This was 0 assertXPath(pXmlDoc, "//w:ins", 5); // This was 0 @@ -697,7 +697,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf149198, "tdf149198.docx") CPPUNIT_TEST_FIXTURE(Test, testFooterMarginLost) { loadAndSave("footer-margin-lost.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Without the accompanying fix in place, this test would have failed with: // - Expected: 709 // - Actual : 0 @@ -738,7 +738,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRtlGutter) reload(mpFilter, "rtl-gutter.docx"); // Then make sure the section's gutter is still RTL: - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Without the accompanying fix in place, this test would have failed as the XML element was // missing. assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:rtlGutter", 1); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index f4278a90448f..550246983796 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -605,7 +605,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCellBtlr) * w:val="btLr"/> token was completely missing in the output. */ - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:textDirection", "val", "btLr"); } @@ -961,7 +961,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageBorderSpacingExportCase2) // The exporter ALWAYS exported 'w:offsetFrom="text"' even when the spacing values where too large // for Word to handle (larger than 31 points) - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Assert the XPath expression - page borders assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgBorders", "offsetFrom", "page"); @@ -990,7 +990,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGrabBag) { loadAndSave("grabbag.docx"); // w:mirrorIndents was lost on roundtrip, now should be handled as a grab bag property - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:mirrorIndents"); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 9ae2eb7db31f..f0c7703f6503 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -514,7 +514,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMultiColumnLineSeparator) { loadAndSave("multi-column-line-separator-SAVED.docx"); // Check for the Column Separator value.It should be FALSE as the document does not contain separator line. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:sectPr/w:cols","sep","false"); } @@ -563,7 +563,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69644) // The problem was that the exporter exported the table definition // with only 3 columns, instead of 5 columns. // Check that the table grid is exported with 5 columns - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol", 5); } @@ -576,7 +576,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70812, "fdo70812.docx") CPPUNIT_TEST_FIXTURE(Test, testPgMargin) { loadAndSave("testPgMargin.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgMar", "left", "1440"); } @@ -692,7 +692,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCellGridSpan) // The problem was during export gridSpan value for 1st & 2nd cells for test document // used to get set wrongly to 5 and 65532 respectively which was the reason for crash during save operation // Verifying gridSpan element is not present in RoundTripped Document (As it's Default value is 1). - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:tcPr/w:gridSpan",0); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:gridSpan",0); } @@ -712,7 +712,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo71646, "fdo71646.docx") CPPUNIT_TEST_FIXTURE(Test, testParaAutoSpacing) { loadAndSave("para-auto-spacing.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "beforeAutospacing","1"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "afterAutospacing","1"); @@ -942,7 +942,7 @@ CPPUNIT_TEST_FIXTURE(Test, testcantSplit) // if Split table value is true for a table then during export do not write <w:cantSplit w:val="false"/> // in table row property,As default row prop is allow row to break across page. // writing <w:cantSplit w:val="false"/> during export was causing problem that all the cell data used to come on same page - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:cantSplit",0); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr/w:trPr/w:cantSplit","val","true"); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index e4e90ba86655..9138703f501b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -275,7 +275,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo69656) // After changes for fdo76741 the fixed width is exported as "dxa" for DOCX // Check for the width type of table and its cells. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW","type","dxa"); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 301a814a04ef..d282675b07ad 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -1093,7 +1093,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo83048) CPPUNIT_TEST_FIXTURE(Test, testSdt2Run) { loadAndSave("sdt-2-run.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // The problem was that <w:sdt> was closed after "first", not after "second", so the second assert failed. assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "firstsecond"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx index 8483ca27ae91..f80526a74e9b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx @@ -469,7 +469,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableFloatingMargins, "table-floating-margins.docx" if (!isExported()) return; // Paragraph bottom margin wasn't 0 in the A1 cell of the floating table. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0"); } @@ -477,7 +477,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127814) { loadAndSave("tdf127814.docx"); // Paragraph top margin was 0 in a table started on a new page - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "before", "0"); } @@ -485,14 +485,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128752) { loadAndSave("tdf128752.docx"); // Paragraph bottom margin was 200, docDefault instead of table style setting - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "after", "0"); } CPPUNIT_TEST_FIXTURE(Test, testTdf119054) { loadAndSave("tdf119054.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Don't overwrite before and after spacing of Heading2 by table style. // Heading2 overrides table style's values from DocDefaults. assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "before", "0"); @@ -504,7 +504,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119054) CPPUNIT_TEST_FIXTURE(Test, testTdf131258) { loadAndSave("tdf131258.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Use table style based bottom margin instead of the docDefaults in empty tables, too assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0"); } @@ -512,7 +512,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131258) CPPUNIT_TEST_FIXTURE(Test, testTdf132514) { loadAndSave("tdf132514.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Keep table style setting, when the footer also contain a table assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p[2]/w:pPr/w:spacing", "before", "0"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p[2]/w:pPr/w:spacing", "after", "0"); @@ -526,7 +526,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69636) * importer, regarding the btLr text frame direction: the * mso-layout-flow-alt property was completely missing in the output. */ - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // VML CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox", "style").match("mso-layout-flow-alt:bottom-to-top")); // drawingML @@ -876,7 +876,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO73546) CPPUNIT_TEST_FIXTURE(Test, testFdo69616) { loadAndSave("fdo69616.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // VML // FIXME: VML needs correction, because DrawingML WPG shapes from now imported as // shape+textframe pairs. VML implementation still missing. @@ -983,7 +983,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOuterShdw) CPPUNIT_TEST_FIXTURE(Test, testExtentValue) { loadAndSave("fdo74605.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); sal_Int32 nX = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent", "cx").toInt32(); // This was negative. CPPUNIT_ASSERT(nX >= 0); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 8515be9d50c4..26a7e7167667 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -1127,7 +1127,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121670_columnsInSectionsOnly, "tdf121670_columns CPPUNIT_TEST_FIXTURE(Test, testTdf106492) { loadAndSave("tdf106492.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This was 4: an additional sectPr was added to the document. assertXPath(pXmlDoc, "//w:sectPr", 3); } @@ -1336,7 +1336,7 @@ CPPUNIT_TEST_FIXTURE(Test, testActiveXControlAlign) CPPUNIT_ASSERT_EQUAL(sal_Int32(-1085), xShape->getPosition().Y); // Also check the specific OOXML elements - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXmlDoc); // For inline controls use w:object as parent element and pictureFrame shapetype assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:object", 1); diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index fec46ba0bfaa..235a7166dd21 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -64,7 +64,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBnc834035) CPPUNIT_ASSERT_EQUAL(3, getPages()); // Illustration index had wrong hyperlinks: anchor was using Writer's // <seqname>!<index>|sequence syntax, not a bookmark name. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This was Figure!1|sequence. assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:hyperlink", "anchor", "_Toc363553908"); } @@ -102,7 +102,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFieldFlagO) { loadAndReload("TOC_field_f.docx"); // This test case is to verify \o flag should come once. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed // not to insert an empty paragraph before TOC. @@ -118,7 +118,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTOCFlag_f) // \o \h \n used to come after RoundTrip. // This test case is to verify even if there is no \f flag in original doc, \h flag is getting // preserved after RT. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed // not to insert an empty paragraph before TOC. @@ -145,7 +145,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFieldFlagB) { loadAndReload("TOC_field_b.docx"); // This test case is to verify \b flag. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed // not to insert an empty paragraph before TOC. @@ -203,7 +203,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCaption1) // fdo#74431 : This test case is to verify the Captions are coming properly // earlier it was coming as "SEQ "scientific"\*ROMAN now it is SEQ scientific\* ROMAN" - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:instrText", " SEQ scientific \\* ROMAN "); } @@ -213,7 +213,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCaption2) loadAndReload("EquationWithAboveAndBelowCaption.docx"); // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip // This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[3]/w:instrText", " SEQ Equation \\* ARABIC "); } @@ -223,7 +223,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCaption3) loadAndReload("FigureAsLabelPicture.docx"); // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip // This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:instrText", " SEQ picture \\* ARABIC "); } @@ -233,7 +233,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCaption4) loadAndReload("TableWithAboveCaptions.docx"); // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip // This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:instrText", " SEQ Table \\* ARABIC "); } @@ -277,7 +277,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageref) loadAndReload("testPageref.docx"); // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip // This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:hyperlink/w:r[3]/w:instrText", "PAGEREF _Toc355095261 \\h"); } @@ -316,7 +316,7 @@ CPPUNIT_TEST_FIXTURE(Test, testIndexFieldFlagF) CPPUNIT_TEST_FIXTURE(Test, testBibliography) { loadAndReload("FDO75133.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " BIBLIOGRAPHY "); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartGallery", "val", "Bibliographies"); @@ -328,7 +328,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGenericTextField) loadAndReload("Unsupportedtextfields.docx"); // fdo#75158 : This test case is to verify the unsupported textfields are exported properly. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc,"/w:document/w:body/w:p[2]/w:r[2]/w:instrText"); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; @@ -350,7 +350,7 @@ CPPUNIT_TEST_FIXTURE(Test, test_FieldType) CPPUNIT_TEST_FIXTURE(Test, testCitation) { loadAndReload("FDO74775.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtContent/w:r[2]/w:instrText", " CITATION Kra06 \\l 1033 "); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtContent/w:r[4]/w:t", "(Kramer & Chen, 2006)"); } @@ -439,7 +439,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtCitationRun) { loadAndReload("sdt-citation-run.docx"); // The problem was that the SDT was around the whole paragraph, not only around the citation field. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:t", "Before sdt."); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:instrText", " CITATION BBC11 \\l 1033 "); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:t", "After sdt."); @@ -449,7 +449,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphSdt) { loadAndReload("paragraph-sdt.docx"); // The problem was that the SDT was around the run only, not the whole paragraph. - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // The path to w:sdt contained a w:p. assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:sdt"); } @@ -457,7 +457,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphSdt) CPPUNIT_TEST_FIXTURE(Test, testSdt2Run) { loadAndReload("sdt-2-para.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // The problem was that <w:sdt> was closed after "first", not after "second", so the second assert failed. assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r/w:t", "first"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r/w:t", "second"); @@ -468,7 +468,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdt2Run) CPPUNIT_TEST_FIXTURE(Test, test2Id) { loadAndReload("2-id.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This was 2, but only one w:id is allowed. assertXPath(pXmlDoc, "//w:sdtPr/w:id", 1); } @@ -476,7 +476,7 @@ CPPUNIT_TEST_FIXTURE(Test, test2Id) CPPUNIT_TEST_FIXTURE(Test, testTableStart2Sdt) { loadAndReload("table-start-2-sdt.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // w:docPartGallery should be a child of <w:docPartObj>, make sure it's not a child of w:text. assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:text/w:docPartGallery", 0); } @@ -485,7 +485,7 @@ DECLARE_OOXMLEXPORT_TEST(testSdtDateDuplicate, "sdt-date-duplicate.docx") { if (isExported()) { - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Single <w:sdt> was exported as 2 <w:sdt> elements. assertXPath(pXmlDoc, "//w:sdt", 1); uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -531,7 +531,7 @@ DECLARE_OOXMLEXPORT_TEST(testSdtDateDuplicate, "sdt-date-duplicate.docx") CPPUNIT_TEST_FIXTURE(Test, testFdo81492) { loadAndReload("fdo81492.docx"); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:instrText", "ADDIN EN.CITE.DATA"); } @@ -661,7 +661,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO34469) { loadAndReload("ooo34469-1.odt"); CPPUNIT_ASSERT_EQUAL(1, getPages()); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "2.9.2.Creating_New_files|outline"); } @@ -669,7 +669,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO39845) { loadAndReload("ooo39845-7.odt"); CPPUNIT_ASSERT_EQUAL(1, getPages()); - xmlDocUniquePtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "Figure4|graphic"); } diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx index c8d5e0006b1a..dbd601002ddb 100644 --- a/sw/qa/inc/swmodeltestbase.hxx +++ b/sw/qa/inc/swmodeltestbase.hxx @@ -362,7 +362,7 @@ protected: * xml stream, and asserting an XPath expression. This method returns the * xml stream, so that you can do the asserting. */ - xmlDocUniquePtr parseExport(const OUString& rStreamName = OUString("word/document.xml")); + xmlDocUniquePtr parseExport(const OUString& rStreamName); /** * Returns an xml stream of an exported file.