diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-05 19:10:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-07 09:52:27 +0200 |
commit | ec6eaa58addf0d8823f8c56d4ec168ff389da8c5 (patch) | |
tree | adb44639fc6bdecad5f576aa5e1aa90f3c9d64b3 /sw/qa/extras | |
parent | c437948f6c0d602bb200fc92e80cb73ae8ae5109 (diff) |
fix memory leak of xmlDoc objects
in unit tests
Change-Id: Id16731bbbe2f1b0e3642722d77aba04fc98db4cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93508
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/qa/extras')
28 files changed, 710 insertions, 710 deletions
diff --git a/sw/qa/extras/docbookexport/docbookexport.cxx b/sw/qa/extras/docbookexport/docbookexport.cxx index 98edee213018..74241d353d33 100644 --- a/sw/qa/extras/docbookexport/docbookexport.cxx +++ b/sw/qa/extras/docbookexport/docbookexport.cxx @@ -21,7 +21,7 @@ public: DECLARE_DOCBOOKEXPORT_TEST(testsimple, "simple.docx") { - xmlDocPtr pDoc = parseXml(maTempFile); + xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPathContent(pDoc, "/article/para", "aaaa"); @@ -30,7 +30,7 @@ DECLARE_DOCBOOKEXPORT_TEST(testsimple, "simple.docx") /* the test actually should crash with this file */ DECLARE_DOCBOOKEXPORT_TEST(testtdf91095, "tdf91095.docx") { - xmlDocPtr pDoc = parseXml(maTempFile); + xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); } diff --git a/sw/qa/extras/fodfexport/fodfexport.cxx b/sw/qa/extras/fodfexport/fodfexport.cxx index c79d0f35b420..f46003ab6e10 100644 --- a/sw/qa/extras/fodfexport/fodfexport.cxx +++ b/sw/qa/extras/fodfexport/fodfexport.cxx @@ -31,7 +31,7 @@ DECLARE_FODFEXPORT_TEST(testTdf113696, "tdf113696.odt") { // Test that an image which is written in svm format (image/x-vclgraphic) // is accompanied by a png fallback graphic. - if (xmlDocPtr pXmlDoc = parseExportedFile()) + if (xmlDocUniquePtr pXmlDoc = parseExportedFile()) { assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/" "draw:image[@loext:mime-type='image/x-vclgraphic']"); @@ -44,7 +44,7 @@ DECLARE_FODFEXPORT_TEST(testTdf113696WriterImage, "tdf113696-writerimage.odt") { // Same as testTdf113696, but with a writer image instead of a draw image // (they use different code paths). - if (xmlDocPtr pXmlDoc = parseExportedFile()) + if (xmlDocUniquePtr pXmlDoc = parseExportedFile()) { assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/" "draw:image[@loext:mime-type='image/x-vclgraphic']"); diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index d05da8ad4943..29d1ced8db80 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -181,7 +181,7 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testCharacterBorder, "charborder.odt") DECLARE_HTMLEXPORT_TEST(testExportOfImages, "textAndImage.docx") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/html/body", 1); @@ -190,7 +190,7 @@ DECLARE_HTMLEXPORT_TEST(testExportOfImages, "textAndImage.docx") DECLARE_HTMLEXPORT_TEST(testExportOfImagesWithSkipImagesEnabled, "textAndImage.docx") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/html/body", 1); @@ -201,7 +201,7 @@ DECLARE_HTMLEXPORT_TEST(testSkipImagesEmbedded, "skipimage-embedded.doc") { // Embedded spreadsheet was exported as image, so content was lost. Make // sure it's exported as HTML instead. - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); // This was 0. @@ -216,7 +216,7 @@ DECLARE_HTMLEXPORT_TEST(testSkipImagesEmbeddedDocument, "skipimage-embedded-docu { // Similar to testSkipImagesEmbedded, but with an embedded Writer object, // not a Calc one, and this time OOXML, not WW8. - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); // This was 2, the HTML header was in the document two times. @@ -227,7 +227,7 @@ DECLARE_HTMLEXPORT_TEST(testSkipImagesEmbeddedDocument, "skipimage-embedded-docu DECLARE_HTMLEXPORT_TEST(testExportImageProperties, "HTMLImage.odt") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/html/body", 1); @@ -267,7 +267,7 @@ DECLARE_HTMLEXPORT_TEST(testExportImageProperties, "HTMLImage.odt") DECLARE_HTMLEXPORT_TEST(testExportCheckboxRadioButtonState, "checkbox-radiobutton.doc") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/html/body", 1); @@ -287,7 +287,7 @@ DECLARE_HTMLEXPORT_TEST(testExportCheckboxRadioButtonState, "checkbox-radiobutto DECLARE_HTMLEXPORT_TEST(testExportUrlEncoding, "tdf76291.odt") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); // Test URI encoded hyperlink with Chinese characters @@ -296,7 +296,7 @@ DECLARE_HTMLEXPORT_TEST(testExportUrlEncoding, "tdf76291.odt") DECLARE_HTMLEXPORT_TEST(testExportInternalUrl, "tdf90905.odt") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); // Internal url should be valid @@ -306,7 +306,7 @@ DECLARE_HTMLEXPORT_TEST(testExportInternalUrl, "tdf90905.odt") DECLARE_HTMLEXPORT_TEST(testExportImageBulletList, "tdf66822.odt") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); // Encoded base64 SVG bullet should match and render on browser @@ -316,7 +316,7 @@ DECLARE_HTMLEXPORT_TEST(testExportImageBulletList, "tdf66822.odt") DECLARE_HTMLEXPORT_TEST(testTdf83890, "tdf83890.odt") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/html/body/ol[2]/ol", "start", "2"); @@ -337,7 +337,7 @@ DECLARE_HTMLEXPORT_TEST(testExtbChars, "extb.html") DECLARE_HTMLEXPORT_TEST(testNormalImageExport, "textAndImage.docx") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/html/body", 1); @@ -347,7 +347,7 @@ DECLARE_HTMLEXPORT_TEST(testNormalImageExport, "textAndImage.docx") DECLARE_HTMLEXPORT_TEST(testEmbedImagesEnabled, "textAndImage.docx") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/html/body", 1); @@ -363,7 +363,7 @@ DECLARE_HTMLEXPORT_TEST(testXHTML, "hello.html") // This was HTML, not XHTML. CPPUNIT_ASSERT_EQUAL(aExpected, aActual); - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); // This was lang, not xml:lang. assertXPath(pDoc, "/html/body", "xml:lang", "en-US"); @@ -505,7 +505,7 @@ DECLARE_HTMLEXPORT_TEST(testReqIfJpgImg, "reqif-jpg-img.xhtml") DECLARE_HTMLEXPORT_TEST(testReqIfTable, "reqif-table.xhtml") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); // <div> was missing, so the XHTML fragment wasn't a valid @@ -582,7 +582,7 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOle2, "reqif-ole2.xhtml") // Check that the replacement graphic is exported at RTF level. SvMemoryStream aStream; wrapFragment(maTempFile, aStream); - xmlDocPtr pDoc = parseXmlStream(&aStream); + xmlDocUniquePtr pDoc = parseXmlStream(&aStream); CPPUNIT_ASSERT(pDoc); // Get the path of the RTF data. OUString aOlePath = getXPath( @@ -632,7 +632,7 @@ DECLARE_HTMLEXPORT_TEST(testList, "list.html") DECLARE_HTMLEXPORT_TEST(testTransparentImage, "transparent-image.odt") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); OUString aSource = getXPath(pDoc, "/html/body/p/img", "src"); @@ -645,7 +645,7 @@ DECLARE_HTMLEXPORT_TEST(testTransparentImageReqIf, "transparent-image.odt") { SvMemoryStream aStream; wrapFragment(maTempFile, aStream); - xmlDocPtr pDoc = parseXmlStream(&aStream); + xmlDocUniquePtr pDoc = parseXmlStream(&aStream); CPPUNIT_ASSERT(pDoc); OUString aSource = getXPath( @@ -662,7 +662,7 @@ DECLARE_HTMLEXPORT_TEST(testOleNodataReqIf, "reqif-ole-nodata.odt") // This failed, io::IOException was thrown during the filter() call. SvMemoryStream aStream; wrapFragment(maTempFile, aStream); - xmlDocPtr pDoc = parseXmlStream(&aStream); + xmlDocUniquePtr pDoc = parseXmlStream(&aStream); CPPUNIT_ASSERT(pDoc); // Make sure the native <object> element has the required data attribute. @@ -677,7 +677,7 @@ DECLARE_HTMLEXPORT_TEST(testNoLangReqIf, "reqif-no-lang.odt") { SvMemoryStream aStream; wrapFragment(maTempFile, aStream); - xmlDocPtr pDoc = parseXmlStream(&aStream); + xmlDocUniquePtr pDoc = parseXmlStream(&aStream); CPPUNIT_ASSERT(pDoc); // Make sure that xml:lang is not written in ReqIF mode. @@ -686,7 +686,7 @@ DECLARE_HTMLEXPORT_TEST(testNoLangReqIf, "reqif-no-lang.odt") DECLARE_HTMLEXPORT_TEST(testFieldShade, "field-shade.odt") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); // Without the accompanying fix in place, this test would have failed with 'Expected: 1; Actual: @@ -702,7 +702,7 @@ DECLARE_HTMLEXPORT_TEST(testFieldShade, "field-shade.odt") DECLARE_HTMLEXPORT_TEST(testFieldShadeReqIf, "field-shade-reqif.odt") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); // Without the accompanying fix in place, this test would have failed with: @@ -729,7 +729,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testBlockQuoteReqIf) xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); SvMemoryStream aStream; HtmlExportTest::wrapFragment(maTempFile, aStream); - xmlDocPtr pDoc = parseXmlStream(&aStream); + xmlDocUniquePtr pDoc = parseXmlStream(&aStream); CPPUNIT_ASSERT(pDoc); // Without the accompanying fix in place, this test would have failed with: @@ -760,7 +760,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testRTFOLEMimeType) xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties); SvMemoryStream aStream; HtmlExportTest::wrapFragment(maTempFile, aStream); - xmlDocPtr pDoc = parseXmlStream(&aStream); + xmlDocUniquePtr pDoc = parseXmlStream(&aStream); CPPUNIT_ASSERT(pDoc); // Without the accompanying fix in place, this test would have failed with: @@ -792,7 +792,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testChinese) xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties); SvMemoryStream aStream; HtmlExportTest::wrapFragment(maTempFile, aStream); - xmlDocPtr pDoc = parseXmlStream(&aStream); + xmlDocUniquePtr pDoc = parseXmlStream(&aStream); // Without the accompanying fix in place, this test would have failed as the output was not // well-formed. @@ -820,7 +820,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifComment) xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties); SvMemoryStream aStream; HtmlExportTest::wrapFragment(maTempFile, aStream); - xmlDocPtr pDoc = parseXmlStream(&aStream); + xmlDocUniquePtr pDoc = parseXmlStream(&aStream); // Without the accompanying fix in place, this test would have failed as the output was not // well-formed. @@ -849,7 +849,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifFontNameSize) xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties); SvMemoryStream aStream; HtmlExportTest::wrapFragment(maTempFile, aStream); - xmlDocPtr pDoc = parseXmlStream(&aStream); + xmlDocUniquePtr pDoc = parseXmlStream(&aStream); // Make sure the output is well-formed. CPPUNIT_ASSERT(pDoc); @@ -877,7 +877,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifParagraphAlignment) xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties); SvMemoryStream aStream; HtmlExportTest::wrapFragment(maTempFile, aStream); - xmlDocPtr pDoc = parseXmlStream(&aStream); + xmlDocUniquePtr pDoc = parseXmlStream(&aStream); // Make sure the output is well-formed. CPPUNIT_ASSERT(pDoc); @@ -976,7 +976,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PDF) // Get the .ole path. SvMemoryStream aStream; HtmlExportTest::wrapFragment(maTempFile, aStream); - xmlDocPtr pDoc = parseXmlStream(&aStream); + xmlDocUniquePtr pDoc = parseXmlStream(&aStream); CPPUNIT_ASSERT(pDoc); OUString aOlePath = getXPath( pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object", "data"); diff --git a/sw/qa/extras/htmlexport/xhtmlexport.cxx b/sw/qa/extras/htmlexport/xhtmlexport.cxx index 1fdb1fd2cfee..85adfa2b7b49 100644 --- a/sw/qa/extras/htmlexport/xhtmlexport.cxx +++ b/sw/qa/extras/htmlexport/xhtmlexport.cxx @@ -33,7 +33,7 @@ private: DECLARE_HTMLEXPORT_TEST(testImageEmbedding, "image-mimetype.odt") { - htmlDocPtr pDoc = parseHtml(maTempFile); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/html/body", 1); diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index b05edef7ee4d..ea6ac4089a0b 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -65,7 +65,7 @@ SwDoc* SwLayoutWriter::createDoc(const char* pName) void SwLayoutWriter::CheckRedlineFootnotesHidden() { discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "24"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", "1"); @@ -104,7 +104,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFootnotes) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // show: nothing is merged xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//merged"); @@ -243,7 +243,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "14"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); @@ -319,7 +319,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "14"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); @@ -395,7 +395,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "14"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); @@ -513,7 +513,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nLength", "0"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged", "paraPropsNodeIndex", "6"); @@ -593,7 +593,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // now the frame has no Text portion? not sure why it's a 0-length one first and now none? // assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); // assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nLength", "0"); @@ -674,7 +674,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nLength", "0"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged", "paraPropsNodeIndex", "6"); @@ -816,7 +816,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "25"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "PortionType::Footnote"); @@ -921,7 +921,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "25"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", @@ -1029,7 +1029,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "25"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "PortionType::Footnote"); @@ -1195,7 +1195,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "19"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged", "paraPropsNodeIndex", "6"); @@ -1337,7 +1337,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "19"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); @@ -1464,7 +1464,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "19"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged", "paraPropsNodeIndex", "6"); @@ -1644,7 +1644,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys) dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "19"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged", "paraPropsNodeIndex", "6"); @@ -1842,7 +1842,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys) void SwLayoutWriter::CheckRedlineSectionsHidden() { discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "12"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "folah"); @@ -1869,7 +1869,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections) // why is this needed explicitly? pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout(); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // show: nothing is merged xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//merged"); @@ -1931,7 +1931,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables) // verify after load discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "12"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foar"); @@ -1988,7 +1988,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables) void SwLayoutWriter::CheckRedlineCharAttributesHidden() { discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "9"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foobaz"); @@ -2057,7 +2057,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineCharAttributes) // why is this needed explicitly? pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout(); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // show: nothing is merged xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//merged"); @@ -2158,7 +2158,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineShowHideFootnotePagination) SwRootFrame* pLayout(pDoc->getIDocumentLayoutAccess().GetCurrentLayout()); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // check footnotes assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn", 6); @@ -2203,7 +2203,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineNumberInNumbering) std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Assert the tracked deletion of the number of joined list item and @@ -2220,7 +2220,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125300) std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Keep line spacing before bottom cell border (it was 1892) @@ -2242,7 +2242,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116830) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Assert that the yellow rectangle (cell background) is painted after the @@ -2269,7 +2269,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf114163) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent( @@ -2282,7 +2282,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf114163) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf131707) { createDoc("tdf131707_flyWrap.doc"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "//body/tab/row[3]/cell[2]/txt/infos/bounds", "top", "2185"); // the image should be inside of the cell boundary - so the same top or higher @@ -2297,7 +2297,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125335) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent( @@ -2315,7 +2315,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf75659) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent( @@ -2337,7 +2337,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123268) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Without the accompanying fix in place, this test would have failed with: // - Expected: 41 @@ -2355,7 +2355,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf115630) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Test wide of inner chart area. @@ -2380,7 +2380,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf108021) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); assertXPath( @@ -2398,7 +2398,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125334) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); assertXPath( @@ -2416,7 +2416,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122800) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); assertXPath( @@ -2434,7 +2434,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTruncatedAxisLabel) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // test the X axis label visibility @@ -2458,7 +2458,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128996) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent(pXmlDoc, @@ -2474,7 +2474,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf126244) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Test the first level of vertical category axis labels orientation. The first level orientation should be horizontal. assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/font[1]", "orientation", @@ -2500,7 +2500,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf127304) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Test the first level of horizontal category axis labels orientation. The first level orientation should be vertical. sal_Int32 nRotation @@ -2524,7 +2524,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testHorizontal_multilevel) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Test the Y position of horizontal category axis label. sal_Int32 nYposition @@ -2541,7 +2541,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124796) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // This failed, if the minimum value of Y axis is not -10. @@ -2565,7 +2565,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf130969) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // This failed, if the minimum value of Y axis is not 0.35781 @@ -2581,7 +2581,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf129054) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Test the size of diameter of Pie chart. @@ -2607,7 +2607,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf129173) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Check the first data label of area chart. @@ -2623,7 +2623,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf130031) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); sal_Int32 nY = getXPath(pXmlDoc, "//textarray[11]", "y").toInt32(); // Without the accompanying fix in place, this test would have failed with: @@ -2642,7 +2642,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf130242) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); sal_Int32 nY = getXPath(pXmlDoc, "//textarray[11]", "y").toInt32(); // Without the accompanying fix in place, this test would have failed with: @@ -2669,7 +2669,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf130380) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); sal_Int32 nY = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[1]/polypolygon/" @@ -2692,7 +2692,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf129095) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // check the inner chart area visibility with testing the X axis label @@ -2708,7 +2708,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116925) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent(pXmlDoc, @@ -2728,7 +2728,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117028) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // The only polypolygon in the rendering result was the white background we @@ -2750,7 +2750,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf106390) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); sal_Int32 nBottom = getXPath(pXmlDoc, "//sectrectclipregion", "bottom").toInt32(); @@ -2768,7 +2768,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTableExtrusion1) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); sal_Int32 nRight = getXPath(pXmlDoc, "//sectrectclipregion", "right").toInt32(); sal_Int32 nLeft = static_cast<sal_Int32>(nRight * 0.95); @@ -2788,7 +2788,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTableExtrusion2) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // End point position of the outer table. sal_Int32 nX = getXPath(pXmlDoc, "(//polyline[1]/point)[2]", "x").toInt32(); @@ -2809,7 +2809,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116848) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117245) { createDoc("tdf117245.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 2, TabOverMargin did not use a single line when there was // enough space for the text. assertXPath(pXmlDoc, "/root/page/body/txt[1]/LineBreak", 1); @@ -2821,7 +2821,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117245) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118672) { createDoc("tdf118672.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Check if we have hyphenation support, otherwise can't test SwHyphPortion. uno::Reference<linguistic2::XHyphenator> xHyphenator = LinguMgr::GetHyphenator(); @@ -2848,7 +2848,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117923) CPPUNIT_ASSERT(pViewShell); pViewShell->Reformat(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Check that we actually test the line we need assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]", "GHI GHI GHI GHI"); @@ -2870,7 +2870,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf127606) CPPUNIT_ASSERT(pViewShell); pViewShell->Reformat(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Check that we actually test the line we need assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]", "GHI GHI GHI GHI"); @@ -2893,7 +2893,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf127606) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf109077) { createDoc("tdf109077.docx"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nShapeTop = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "top").toInt32(); sal_Int32 nTextBoxTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "top").toInt32(); @@ -2917,7 +2917,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testUserFieldTypeLanguage) SwDoc* pDoc = createDoc("user-field-type-language.fodt"); SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); pViewShell->UpdateFields(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was "123,456.00", via a buggy 1234.56 -> 1234,56 -> 123456 -> // 123,456.00 transform chain. assertXPath(pXmlDoc, "/root/page/body/txt/Special[@nType='PortionType::Field']", "rText", @@ -2935,7 +2935,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf109137) })); xStorable->storeToURL(aTempFile.GetURL(), aDescriptor); loadURL(aTempFile.GetURL(), "tdf109137.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 0, the blue rectangle moved from the 1st to the 2nd page. assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly/notxt", /*nNumberOfNodes=*/1); @@ -2966,7 +2966,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118058) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128611) { createDoc("tdf128611.fodt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 @@ -2987,7 +2987,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117188) })); xStorable->storeToURL(aTempFile.GetURL(), aDescriptor); loadURL(aTempFile.GetURL(), "tdf117188.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); OUString sWidth = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "width"); OUString sHeight = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "height"); // The text box must have zero border distances @@ -3000,7 +3000,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117188) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117187) { createDoc("tdf117187.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // there should be no fly portions assertXPath(pXmlDoc, "/root/page/body/txt/Special[@nType='PortionType::Fly']", 0); @@ -3009,7 +3009,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117187) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf119875) { createDoc("tdf119875.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nFirstTop = getXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds", "top").toInt32(); sal_Int32 nSecondTop @@ -3022,7 +3022,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf119875) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf120287) { createDoc("tdf120287.fodt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 2, TabOverMargin Word-specific compat flag did not imply // default-in-Word printer-independent layout, resulting in an additional // line break. @@ -3032,7 +3032,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf120287) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf120287b) { createDoc("tdf120287b.fodt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 1418, TabOverMargin did the right split of the paragraph to two // lines, but then calculated a too large tab portion size on the first // line. @@ -3043,7 +3043,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf120287b) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf120287c) { createDoc("tdf120287c.fodt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 2, the second line was not broken into a 2nd and a 3rd one, // rendering text outside the paragraph frame. assertXPath(pXmlDoc, "/root/page/body/txt[1]/LineBreak", 3); @@ -3052,7 +3052,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf120287c) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122878) { createDoc("tdf122878.docx"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // FIXME: the XPath should be adjusted when the proper floating table would be imported const sal_Int32 nTblTop = getXPath(pXmlDoc, "/root/page[1]/footer/txt/anchored/fly/tab/infos/bounds", "top") @@ -3074,7 +3074,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122878) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf115094) { createDoc("tdf115094.docx"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nTopOfD1 = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/tab/row[1]/cell[4]/infos/bounds", @@ -3101,7 +3101,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf115094) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122607) { createDoc("tdf122607.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/txt[1]/anchored/fly/tab/row[2]/cell/txt[7]/anchored/" "fly/txt/Text[1]", @@ -3148,7 +3148,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122607_regression) uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); xStorable->storeToURL(aTempFile.GetURL(), props); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // somehow these 2 rows overlapped in the PDF unless CalcLayout() runs assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds", "mbFixSize", "false"); @@ -3171,7 +3171,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Without the accompanying fix in place, this test would have failed, as @@ -3332,7 +3332,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123898) // Make sure spellchecker has done its job already Scheduler::ProcessEventsToIdle(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Make sure that the arrow on the left is not there (there are 43 children if it's there) assertXPathChildren(pXmlDoc, "/root/page/body/txt/anchored/fly/txt", 42); } @@ -3340,7 +3340,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123898) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123651) { createDoc("tdf123651.docx"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Without the accompanying fix in place, this test would have failed with 'Expected: 7639; // Actual: 12926'. The shape was below the second "Lorem ipsum" text, not above it. assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "top", "7639"); @@ -3377,7 +3377,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118719) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTabOverMargin) { createDoc("tab-over-margin.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // 2nd paragraph has a tab over the right margin, and with the TabOverMargin compat option, // there is enough space to have all content in a single line. @@ -3423,7 +3423,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testImageComment) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf64222) { createDoc("tdf64222.docx"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page/body/txt[2]/Special", "nHeight", "560"); } @@ -3435,7 +3435,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf113014) // Dump the rendering of the first page as an XML file. std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // This failed, if numbering of cell A1 is missing @@ -3562,7 +3562,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testShapeAllowOverlapWrap) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124600) { createDoc("tdf124600.docx"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 @@ -3578,7 +3578,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124601) // The document has 2 pages, the endnote anchor is on the first page. // The endnote should be on the 2nd page together with the last page content. createDoc("tdf124601.doc"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Without the accompanying fix in place, this test would have failed with: // - Expected: 2 @@ -3597,7 +3597,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124601b) // Also the horizontal position should be in the last column, even if the anchor is in the // last-but-one column. createDoc("tdf124601b.doc"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nFlyTop = getXPath(pXmlDoc, "//fly/infos/bounds", "top").toInt32(); sal_Int32 nFlyLeft = getXPath(pXmlDoc, "//fly/infos/bounds", "left").toInt32(); @@ -3659,7 +3659,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124770) // Insert the text. pWrtShell->Insert2("HHH"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 // - Actual : 2 @@ -3684,7 +3684,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testContinuousEndnotesInsertPageAtStart) pWrtShell->InsertPageBreak(); // Make sure that the endnote is moved from the 2nd page to the 3rd one. - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page", 3); // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 @@ -3710,7 +3710,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testContinuousEndnotesDeletePageAtStart) pWrtShell->DelRight(); // Make sure that the endnote is moved from the 2nd page to the 1st one. - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 // - Actual : 2 @@ -3749,7 +3749,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128399) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf105481) { createDoc("tdf105481.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); // Without the accompanying fix in place, this test would have failed @@ -3815,7 +3815,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117982) SwDocShell* pShell = pDocument->GetDocShell(); std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[1]/text", "FOO AAA"); //The first cell must be "FOO AAA". If not, this means the first cell content not visible in //the source document. @@ -3827,7 +3827,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128959) SwDoc* pDocument = createDoc("tdf128959.docx"); CPPUNIT_ASSERT(pDocument); discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // first two lines of the paragraph in the split table cell on the first page // (these lines were completely lost) @@ -3849,7 +3849,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf121658) return; createDoc("tdf121658.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Only 2 hyphenated words should appear in the document (in the lowercase words). // Uppercase words should not be hyphenated. @@ -3859,7 +3859,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf121658) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testWriterImageNoCapture) { createDoc("writer-image-no-capture.docx"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); sal_Int32 nPageLeft = getXPath(pXmlDoc, "//page/infos/bounds", "left").toInt32(); sal_Int32 nImageLeft = getXPath(pXmlDoc, "//fly/infos/bounds", "left").toInt32(); diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 40d32634ad9a..223646303cb3 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -224,7 +224,7 @@ public: /** * Like parseExport(), but for given mail merge document. */ - xmlDocPtr parseMailMergeExport(const OUString& rStreamName) + xmlDocUniquePtr parseMailMergeExport(const OUString& rStreamName) { if (mnCurOutputType != text::MailMergeType::FILE) return nullptr; @@ -409,7 +409,7 @@ DECLARE_FILE_MAILMERGE_TEST(testMissingDefaultLineColor, "missing-default-line-c // And the default value is black (wasn't copied properly by mailmerge). CPPUNIT_ASSERT_EQUAL( COL_BLACK, lineColor ); // And check that the resulting file has the proper default. - xmlDocPtr pXmlDoc = parseMailMergeExport( "styles.xml" ); + xmlDocUniquePtr pXmlDoc = parseMailMergeExport( "styles.xml" ); CPPUNIT_ASSERT_EQUAL( OUString( "graphic" ), getXPath(pXmlDoc, "/office:document-styles/office:styles/style:default-style[1]", "family")); CPPUNIT_ASSERT_EQUAL( OUString( "#000000" ), getXPath(pXmlDoc, "/office:document-styles/office:styles/style:default-style[1]/style:graphic-properties", "stroke-color")); } diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 1b8bc8a57728..6614e1642efc 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -257,7 +257,7 @@ DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt") DECLARE_ODFEXPORT_TEST(testUserFieldDecl, "user-field-decl.odt") { - if (xmlDocPtr pXmlDoc = parseExport("styles.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("styles.xml")) // Without the accompanying fix in place, this test would have failed with 'Expected: 2; // Actual: 1', i.e. the in-table field had no declaration (in the header), while the // outside-table one had the declaration. @@ -266,7 +266,7 @@ DECLARE_ODFEXPORT_TEST(testUserFieldDecl, "user-field-decl.odt") DECLARE_ODFEXPORT_TEST(testUserFieldDeclFly, "user-field-decl-fly.odt") { - if (xmlDocPtr pXmlDoc = parseExport("styles.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("styles.xml")) // Without the accompanying fix in place, this test would have failed with 'Expected: 2; // Actual: 1', i.e. the in-textframe field had no declaration (in the header), while the // outside-textframe one had the declaration. @@ -387,7 +387,7 @@ DECLARE_ODFEXPORT_TEST(testFramebackgrounds, "framebackgrounds.odt") aGradientxTextFrame = getProperty<awt::Gradient>(xTextFrame, "FillTransparenceGradient"); CPPUNIT_ASSERT_EQUAL(css::awt::GradientStyle_LINEAR, aGradientxTextFrame.Style); - if (xmlDocPtr pXmlDoc = parseExport("content.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml")) { // check that there are 3 background-image elements assertXPath(pXmlDoc, "//style:style[@style:parent-style-name='Frame' and @style:family='graphic']/style:graphic-properties[@draw:fill='bitmap']/style:background-image[@style:repeat='stretch']", 3); @@ -535,7 +535,7 @@ DECLARE_ODFEXPORT_TEST(testTdf92379, "tdf92379.fodt") // CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xFrameStyle2, "FillColor")); // CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xFrameStyle2, "FillTransparence")); - if (xmlDocPtr pXmlDoc = parseExport("styles.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("styles.xml")) { // check that fo:background-color attribute is exported properly assertXPath(pXmlDoc, "//style:style[@style:family='graphic' and @style:name='encarts']/style:graphic-properties[@fo:background-color='#ffcc99']", 1); @@ -583,7 +583,7 @@ DECLARE_ODFEXPORT_TEST(testTdf92379, "tdf92379.fodt") // CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xStyle32, "FillTransparence")); CPPUNIT_ASSERT_EQUAL(sal_Int32(0x461900), getProperty<sal_Int32>(xStyle32, "CharColor")); - if (xmlDocPtr pXmlDoc = parseExport("styles.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("styles.xml")) { // check that fo:background-color attribute is exported properly assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='Titre Avis expert']/style:paragraph-properties[@fo:background-color='#661900']", 1); @@ -948,7 +948,7 @@ DECLARE_ODFEXPORT_TEST(testProtectionKey, "protection-key.fodt") // we can't assume that the user entered the password; check that we // round-trip the password as-is - if (xmlDocPtr pXmlDoc = parseExport("content.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml")) { assertXPath(pXmlDoc, "//text:section[@text:name='Section0' and @text:protected='true' and @text:protection-key='vbnhxyBKtPHCA1wB21zG1Oha8ZA=']"); assertXPath(pXmlDoc, "//text:section[@text:name='Section1' and @text:protected='true' and @text:protection-key='nLHas0RIwepGDaH4c2hpyIUvIS8=']"); @@ -1143,7 +1143,7 @@ DECLARE_ODFEXPORT_TEST(testTextboxRoundedCorners, "textbox-rounded-corners.odt") CPPUNIT_ASSERT_EQUAL(OUString("a"), xCell->getString()); // Table inside a textbox should be in the extension namespace. - if (xmlDocPtr pXmlDoc = parseExport("content.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml")) // This failed, as draw:custom-shape had a table:table child. assertXPath(pXmlDoc, "//draw:custom-shape/loext:table", "name", "Table1"); } @@ -1561,7 +1561,7 @@ DECLARE_ODFEXPORT_TEST(testTdf118393, "tdf118393.odt") // First page has no header/footer { - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // check first page xmlXPathObjectPtr pXmlPage1Header = getXPathNode(pXmlDoc, "/root/page[1]/header"); @@ -1932,7 +1932,7 @@ DECLARE_ODFEXPORT_TEST(testTableStyles2, "table_styles_2.odt") DECLARE_ODFEXPORT_TEST(testTableStyles3, "table_styles_3.odt") { // This test checks if default valued attributes aren't exported. - xmlDocPtr pXmlDoc = parseExport("styles.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("styles.xml"); if (!pXmlDoc) return; @@ -2006,7 +2006,7 @@ DECLARE_ODFIMPORT_TEST(testTableStyles4, "table_styles_4.odt") DECLARE_ODFEXPORT_TEST(testTableStyles5, "table_styles_5.odt") { // Test if cell styles doesn't have a style:parent-style-name attribute. - xmlDocPtr pXmlDoc = parseExport("styles.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("styles.xml"); if (!pXmlDoc) return; @@ -2055,7 +2055,7 @@ DECLARE_ODFEXPORT_TEST(testTdf129568ui, "tdf129568-ui.fodt") DECLARE_ODFEXPORT_TEST(testImageMimetype, "image-mimetype.odt") { // Test that the loext:mimetype attribute is written for exported images, tdf#109202 - if (xmlDocPtr pXmlDoc = parseExport("content.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml")) { // Original image (svg) assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p/draw:frame/draw:image[@loext:mime-type='image/svg+xml']"); @@ -2067,7 +2067,7 @@ DECLARE_ODFEXPORT_TEST(testEmbeddedFontProps, "embedded-font-props.odt") #if !defined(MACOSX) // Test that font style/weight of embedded fonts is exposed. // Test file is a normal ODT, except EmbedFonts is set to true in settings.xml. - if (xmlDocPtr pXmlDoc = parseExport("content.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml")) { // These failed, the attributes were missing. assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[1]", "font-style", "normal"); @@ -2105,7 +2105,7 @@ DECLARE_ODFEXPORT_TEST(testTdf100492, "tdf100492.odt") // Reason of such behavior unclear. So XPATH assert fails. // Parse resulting SVG as XML file. - // xmlDocPtr pXmlDoc = parseXmlStream(&aStream); + // xmlDocUniquePtr pXmlDoc = parseXmlStream(&aStream); // Check amount of paths required to draw an arrow. // Since there are still some empty paths in output test can fail later. There are just two @@ -2156,7 +2156,7 @@ DECLARE_ODFEXPORT_TEST(testReferenceLanguage, "referencelanguage.odt") DECLARE_ODFEXPORT_TEST(testRubyPosition, "ruby-position.odt") { - if (xmlDocPtr pXmlDoc = parseExport("content.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml")) { assertXPath(pXmlDoc, "//style:style[@style:family='ruby']/style:ruby-properties[@loext:ruby-position='inter-character']", 1); assertXPath(pXmlDoc, "//style:style[@style:family='ruby']/style:ruby-properties[@style:ruby-position='below']", 1); @@ -2335,13 +2335,13 @@ DECLARE_ODFEXPORT_TEST(tdf118502, "tdf118502.odt") DECLARE_ODFEXPORT_TEST(tdf99631, "tdf99631.docx") { // check import of VisualArea settings of the embedded XLSX OLE objects - xmlDocPtr pXmlDoc = parseExport("Object 1/settings.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/settings.xml"); if (!pXmlDoc) return; assertXPathContent(pXmlDoc, "//config:config-item[@config:name='VisibleAreaWidth']", "4515"); assertXPathContent(pXmlDoc, "//config:config-item[@config:name='VisibleAreaHeight']", "903"); - xmlDocPtr pXmlDoc2 = parseExport("Object 2/settings.xml"); + xmlDocUniquePtr pXmlDoc2 = parseExport("Object 2/settings.xml"); if (!pXmlDoc2) return; assertXPathContent(pXmlDoc2, "//config:config-item[@config:name='VisibleAreaWidth']", "4515"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 65036bbbc3bc..ac1c714348d9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -58,13 +58,13 @@ protected: DECLARE_OOXMLEXPORT_TEST(testfdo81381, "fdo81381.docx") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:object[1]/o:OLEObject[1]", "DrawAspect", "Icon"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtAlias, "sdt-alias.docx") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // <w:alias> was completely missing. assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:alias", "val", "Subtitle"); @@ -72,7 +72,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtAlias, "sdt-alias.docx") DECLARE_OOXMLEXPORT_TEST(testFooterBodyDistance, "footer-body-distance.docx") { - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) // Page break was exported as section break, this was 0 assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); } @@ -86,7 +86,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf118393, "tdf118393.odt") // First page has no header/footer { - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // check first page xmlXPathObjectPtr pXmlPage1Header = getXPathNode(pXmlDoc, "/root/page[1]/header"); @@ -141,7 +141,7 @@ DECLARE_OOXMLEXPORT_TEST(testfdo81031, "fdo81031.docx") DECLARE_OOXMLEXPORT_TEST(testPlausableBorder, "plausable-border.docx") { // sw::util::IsPlausableSingleWordSection() did not merge two page styles due to borders. - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) // Page break was exported as section break, this was 0 assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); @@ -150,14 +150,14 @@ DECLARE_OOXMLEXPORT_TEST(testPlausableBorder, "plausable-border.docx") DECLARE_OOXMLEXPORT_TEST(testUnwantedSectionBreak, "unwanted-section-break.docx") { - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) // This was 2: an additional sectPr was added to the document. assertXPath(pXmlDoc, "//w:sectPr", 1); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80897 , "fdo80897.docx") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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"); } @@ -172,7 +172,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo80997, "fdo80997.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo80902, "fdo80902.docx") { // The problem was that the docGrid type was set as default so fix it for other grid type - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:docGrid", "type", "lines"); } @@ -180,7 +180,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo80902, "fdo80902.docx") DECLARE_OOXMLEXPORT_TEST(testParaShading, "para-shading.docx") { // Make sure the themeColor attribute is not written when it would be empty. - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:shd", "themeColor"); } @@ -209,7 +209,7 @@ DECLARE_OOXMLEXPORT_TEST(testFirstHeaderFooter, "first-header-footer.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO83044, "fdo83044.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:text", 1); } @@ -224,7 +224,7 @@ DECLARE_OOXMLEXPORT_TEST(testfdo83428, "fdo83428.docx") DECLARE_OOXMLEXPORT_TEST(testShapeInFloattable, "shape-in-floattable.docx") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { // No nested drawingML w:txbxContent. assertXPath(pXmlDoc, "//mc:Choice//w:txbxContent//w:txbxContent", 0); @@ -246,7 +246,7 @@ DECLARE_OOXMLEXPORT_TEST(testEmptyAnnotationMark, "empty-annotation-mark.docx") xStorable->store(); // Then inspect the OOXML markup of the modified document model. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // There were two commentReference nodes. assertXPath(pXmlDoc, "//w:commentReference", "id", "0"); // Empty comment range was not ignored on export, this was 1. @@ -283,7 +283,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableAlignment, "table-alignment.docx") DECLARE_OOXMLEXPORT_TEST(testSdtIgnoredFooter, "sdt-ignored-footer.docx") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { // This was 1, make sure no w:sdt sneaks into the main document from the footer. assertXPath(pXmlDoc, "//w:sdt", 0); @@ -293,7 +293,7 @@ DECLARE_OOXMLEXPORT_TEST(testSdtIgnoredFooter, "sdt-ignored-footer.docx") DECLARE_OOXMLEXPORT_TEST(testSdtRunPicture, "sdt-run-picture.docx") { // SDT around run was exported as SDT around paragraph - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { // This was 1: there was an SDT around w:p. assertXPath(pXmlDoc, "//w:body/w:sdt", 0); @@ -310,7 +310,7 @@ DECLARE_OOXMLEXPORT_TEST(testChartDupe, "chart-dupe.docx") // This was 2, on second import we got a duplicated chart copy. CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xEmbeddedObjects->getCount()); - xmlDocPtr pXmlDocCT = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); if (!pXmlDocCT) return; // initial import @@ -322,13 +322,13 @@ DECLARE_OOXMLEXPORT_TEST(testChartDupe, "chart-dupe.docx") assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/Microsoft_Excel_Worksheet1.xlsx']", "ContentType", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/charts/_rels/chart1.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/charts/_rels/chart1.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='../embeddings/Microsoft_Excel_Worksheet1.xlsx']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); // check the content too - xmlDocPtr pXmlDocChart1 = parseExport("word/charts/chart1.xml"); + xmlDocUniquePtr pXmlDocChart1 = parseExport("word/charts/chart1.xml"); assertXPath(pXmlDocChart1, "/c:chartSpace/c:externalData", "id", @@ -379,7 +379,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf106541_noinheritChapterNumbering, "tdf106541_noi OUString sPara3NumberingStyle = getProperty<OUString>(getParagraph(3), "NumberingStyleName"); CPPUNIT_ASSERT_EQUAL(sPara3NumberingStyle, getProperty<OUString>(getParagraph(4), "NumberingStyleName")); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "//body/txt/Special", 3); //three of the four paragraphs have numbering assertXPath(pXmlDoc, "//body/txt[1]/Special", "rText", "1"); assertXPath(pXmlDoc, "//body/txt[2]/Special", 0); //second paragraph style disables numbering @@ -409,14 +409,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104713_undefinedStyles, "tdf104713_undefinedStyl DECLARE_OOXMLEXPORT_TEST(testDrawingmlFlipv, "drawingml-flipv.docx") { // The problem was that the shape had vertical flip only, but then we added rotation as well on export. - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "rot"); } DECLARE_OOXMLEXPORT_TEST(testRot90Fliph, "rot90-fliph.docx") { // The problem was that a shape rotation of 90° got turned into 270° after roundtrip. - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { assertXPath(pXmlDoc, "//a:xfrm", "flipH", "1"); // This was 16200000 (270 * 60000). @@ -427,7 +427,7 @@ DECLARE_OOXMLEXPORT_TEST(testRot90Fliph, "rot90-fliph.docx") DECLARE_OOXMLEXPORT_TEST(testRot180Flipv, "rot180-flipv.docx") { // 180° rotation got lost after roundtrip. - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { assertXPath(pXmlDoc, "//a:xfrm", "flipV", "1"); // This attribute was completely missing. @@ -438,7 +438,7 @@ DECLARE_OOXMLEXPORT_TEST(testRot180Flipv, "rot180-flipv.docx") DECLARE_OOXMLEXPORT_TEST(testRot270Flipv, "rot270-flipv.docx") { // 270° rotation got turned into 90° after roundtrip. - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { assertXPath(pXmlDoc, "//a:xfrm", "flipV", "1"); // This was 5400000. @@ -448,7 +448,7 @@ DECLARE_OOXMLEXPORT_TEST(testRot270Flipv, "rot270-flipv.docx") DECLARE_OOXMLEXPORT_TEST(testMsoPosition, "bnc884615-mso-position.docx") { - if(xmlDocPtr doc = parseExport("word/footer1.xml")) + if(xmlDocUniquePtr doc = parseExport("word/footer1.xml")) { // We write the frames out in different order than they were read, so check it's the correct // textbox first by checking width. These tests may need reordering if that gets fixed. @@ -467,7 +467,7 @@ DECLARE_OOXMLEXPORT_TEST(testMsoPosition, "bnc884615-mso-position.docx") CPPUNIT_ASSERT( style3.indexOf( ";mso-position-vertical-relative:text" ) >= 0 ); } - xmlDocPtr doc = parseExport("word/header1.xml"); + xmlDocUniquePtr doc = parseExport("word/header1.xml"); if(!doc) return; @@ -565,7 +565,7 @@ DECLARE_OOXMLEXPORT_TEST(testCropPixel, "crop-pixel.docx") { // 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. - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { // This is 17667 in the original document, was 504666 (so the image // become invisible), now is around 19072. @@ -577,7 +577,7 @@ DECLARE_OOXMLEXPORT_TEST(testEffectExtent, "effect-extent.docx") { // The problem was that in case there were no shadows on the picture, we // wrote a <wp:effectExtent> full or zeros. - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) // E.g. this was 0. assertXPath(pXmlDoc, "//wp:effectExtent", "l", "114300"); } @@ -586,7 +586,7 @@ DECLARE_OOXMLEXPORT_TEST(testEffectExtentInline, "effect-extent-inline.docx") { // The problem was that in case there was inline rotated picture, we // wrote a <wp:effectExtent> full or zeros. - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { // E.g. this was 0. assertXPath(pXmlDoc, "//wp:effectExtent", "l", "609600"); @@ -634,7 +634,7 @@ DECLARE_OOXMLEXPORT_TEST(testParagraphMark, "paragraph-mark.docx") DECLARE_OOXMLEXPORT_TEST(testParagraphMarkNonempty, "paragraph-mark-nonempty.odt") { - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) // 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"); } @@ -710,21 +710,21 @@ DECLARE_OOXMLEXPORT_TEST(testOoxmlSymbolChicagoList, "symbol_chicago_list.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOoxmlNumListZHTW, "numlist-zhtw.odt") { - xmlDocPtr pXmlDoc = parseExport("word/numbering.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt","val","taiwaneseCountingThousand" ); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOoxmlNumListZHCN, "numlist-zhcn.odt") { - xmlDocPtr pXmlDoc = parseExport("word/numbering.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt","val","chineseCountingThousand" ); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOOxmlOutlineNumberTypes, "outline-number-types.odt") { - xmlDocPtr pXmlDoc = parseExport("word/numbering.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pStyle", "val", "Heading1"); assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt", "val", "none"); @@ -946,7 +946,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf106953, "tdf106953.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf115094v3, "tdf115094v3.docx") { // floating table is now exported directly without surrounding frame - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpX", "1996"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpY", "1064"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index d8eafc1d60b1..4ba57fabc25f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -172,7 +172,7 @@ DECLARE_OOXMLEXPORT_TEST(testWpgNested, "wpg-nested.docx") // This failed, the right edge of the shape was outside the page // boundaries. - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nPageLeft = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "left").toInt32(); sal_Int32 nPageWidth = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "width").toInt32(); sal_Int32 nShapeLeft @@ -215,7 +215,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120412_400PercentSubscript, "tdf120412_400Percen DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFontEsc, "test_tdf120412.docx") { - xmlDocPtr pXmlDoc =parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc =parseExport("word/document.xml"); // don't lose the run with superscript formatting assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r", 2); // Superscript should be raised by 100% (11pt). Was 110% (12pt) @@ -373,7 +373,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73389,"fdo73389.docx") // 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. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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"); @@ -382,7 +382,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73389,"fdo73389.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf59274, "tdf59274.docx") { // Table with "auto" table width and incomplete grid: 11 columns, but only 4 gridCol elements. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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. @@ -608,7 +608,7 @@ DECLARE_OOXMLEXPORT_TEST(testGridBefore, "gridbefore.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf116194, "tdf116194.docx") { // The problem was that the importer lost consecutive tables with w:gridBefore - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl", 2); } @@ -993,7 +993,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf95377, "tdf95377.docx") CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent")); //default style has numbering enabled. Styles inherit numbering unless specifically disabled - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "//body/txt/Special", 3); //first three paragraphs have numbering assertXPath(pXmlDoc, "//body/txt[1]/Special", "rText", "a."); assertXPath(pXmlDoc, "//body/txt[2]/Special", "rText", "b."); @@ -1181,7 +1181,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableMarginAdjustment, "table.fodt") // since LO is exporting in the NEW way now instead of the OLD way. // This was 55 when using 2007's compatibilityMode of 12 (old) - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//w:tbl[1]/w:tblPr[1]/w:tblInd[1]", "type", "dxa"); assertXPath(pXmlDoc, "//w:tbl[1]/w:tblPr[1]/w:tblInd[1]", "w", "0"); @@ -1191,7 +1191,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119760_tableInTablePosition, "tdf119760_tableInT { if ( mbExported ) { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tblPr[1]/w:tblInd[1]", "type", "dxa"); assertXPath(pXmlDoc, "//w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]//w:tblPr[1]/w:tblInd[1]", "w", "0"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 51395c0f1b54..1e9e55da8958 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -154,7 +154,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121456_tabsOffset, "tdf121456_tabsOffset.odt") // tdf#121561: make sure w:sdt/w:sdtContent around TOC is written during ODT->DOCX conversion DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121561_tocTitle, "tdf121456_tabsOffset.odt") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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"); @@ -163,7 +163,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121561_tocTitle, "tdf121456_tabsOffse DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf129525, "tdf129525.rtf") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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"); @@ -182,7 +182,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124106, "tdf121456.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121561_tocTitleDocx, "tdf121456_tabsOffset.odt") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // get TOC node uno::Reference<text::XDocumentIndexesSupplier> xIndexSupplier(mxComponent, uno::UNO_QUERY); @@ -238,7 +238,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82065_Ind_start_strict, "tdf82065_Ind_start_stri DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf76683_negativeTwipsMeasure, "tdf76683_negativeTwipsMeasure.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); 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(); sal_uInt32 nColumn2 = getXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[2]", "w").toUInt32(); @@ -361,7 +361,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf94801, "tdf94801.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testParagraphSplitOnSectionBorder, "parasplit-on-section-border.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Test document has only two paragraphs. After splitting, it should contain // three of them. @@ -371,7 +371,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testParagraphSplitOnSectionBorder, "paraspli DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf44832_testSectionWithDifferentHeader, "tdf44832_section_new_header.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:headerReference", 1); } @@ -430,7 +430,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf113183, "tdf113183.docx") { // The horizontal positioning of the star shape affected the positioning of // the triangle one, so the triangle was outside the page frame. - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nPageLeft = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "left").toInt32(); sal_Int32 nPageWidth = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "width").toInt32(); sal_Int32 nShapeLeft @@ -530,7 +530,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf113258_noBeforeAutospacing, "tdf113258_noBeforeA DECLARE_OOXMLEXPORT_TEST(testTdf120511_eatenSection, "tdf120511_eatenSection.docx") { - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nHeight = getXPath(pXmlDoc, "/root/page[1]/infos/prtBounds", "height").toInt32(); sal_Int32 nWidth = getXPath(pXmlDoc, "/root/page[1]/infos/prtBounds", "width").toInt32(); CPPUNIT_ASSERT_MESSAGE( "Page1 is portrait", nWidth < nHeight ); @@ -564,7 +564,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104354_firstParaInSection, "tdf104354_firstParaI DECLARE_OOXMLEXPORT_TEST(testPageBreak_after, "pageBreak_after.odt") { // The problem was that the page breakAfter put the empty page BEFORE the table - xmlDocPtr pDump = parseLayoutDump(); + xmlDocUniquePtr pDump = parseLayoutDump(); assertXPath(pDump, "/root/page[1]/body/tab", 1); // There should be two pages actually - a blank page after a page break. CPPUNIT_ASSERT_EQUAL_MESSAGE("Did you fix?? Table should be on page one of two", 1, getPages()); @@ -863,7 +863,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testChart_BorderLine_Style, "Chart_BorderLin /* DOCX containing Chart with BorderLine Style as Dash Type should get preserved * inside an XML tag <a:prstDash> with value "dash", "sysDot, "lgDot", etc. */ - xmlDocPtr pXmlDoc = parseExport("word/charts/chart1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:spPr/a:ln/a:prstDash", "val", "sysDot"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:spPr/a:ln/a:prstDash", "val", "sysDash"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:spPr/a:ln/a:prstDash", "val", "dash"); @@ -874,7 +874,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testChart_Plot_BorderLine_Style, "Chart_Plot /* 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. */ - xmlDocPtr pXmlDoc = parseExport("word/charts/chart1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:ln/a:prstDash", "val", "lgDashDot"); assertXPath(pXmlDoc, "/c:chartSpace/c:spPr/a:ln/a:prstDash", "val", "sysDash"); @@ -882,20 +882,20 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testChart_Plot_BorderLine_Style, "Chart_Plot DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesDeletedEmptyParagraph, "testTrackChangesDeletedEmptyParagraph.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:rPr/w:del"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesEmptyParagraphsInADeletion, "testTrackChangesEmptyParagraphsInADeletion.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); for (int i = 1; i < 12; ++i) assertXPath(pXmlDoc, "/w:document/w:body/w:p[" + OString::number(i) + "]/w:pPr/w:rPr/w:del"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf70234, "tdf70234.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // import field with tracked deletion assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:del/w:r[1]/w:fldChar"); @@ -908,28 +908,28 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf70234, "tdf70234.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf115212, "tdf115212.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // export field with tracked deletion assertXPath(pXmlDoc, "//w:p[2]/w:del[1]/w:r[1]/w:fldChar"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf126243, "tdf120338.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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", "Heading3"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf126245, "tdf126245.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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", "1"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf124491, "tdf124491.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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"); // empty line without format change @@ -939,14 +939,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf124491, "tdf124491.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf105485, "tdf105485.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // import change tracking of deleted comments assertXPath(pXmlDoc, "//w:del/w:r/w:commentReference"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125894, "tdf125894.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // import change tracking in frames assertXPath(pXmlDoc, "//w:del", 2); assertXPath(pXmlDoc, "//w:ins"); @@ -954,21 +954,21 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125894, "tdf125894.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128156, "tdf128156.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // import change tracking in frames assertXPath(pXmlDoc, "//w:ins"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125546, "tdf125546.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // compress redlines (it was 15) assertXPath(pXmlDoc, "//w:rPrChange", 2); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLabelWidthAndPosition_Left_FirstLineIndent, "Hau_min_list2.fodt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // list is LABEL_WIDTH_AND_POSITION with SvxAdjust::Left // I) LTR // a) all LTR cases with no number text look good in Word @@ -1070,14 +1070,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLabelWidthAndPosition_Left_FirstLineInde DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf124604, "tdf124604.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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", "0"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf95374, "tdf95374.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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", "0"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "start", "1136"); @@ -1085,7 +1085,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf95374, "tdf95374.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf108493, "tdf108493.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // set in the paragraph assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "start", "709"); // set in the numbering style (this was 0) @@ -1108,7 +1108,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf64264, "tdf64264.docx") { // DOCX table rows with tblHeader setting mustn't modify the count of the // repeated table header rows, when there is rows before them without tblHeader settings. - xmlDocPtr pDump = parseLayoutDump(); + xmlDocUniquePtr pDump = parseLayoutDump(); CPPUNIT_ASSERT_EQUAL(2, getPages()); // table starts on page 1 and finished on page 2 @@ -1125,7 +1125,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf58944RepeatingTableHeader, "tdf58944-repeating-t { // DOCX tables with more than 10 repeating header lines imported without repeating header lines // as a workaround for MSO's limitation of header line repetition - xmlDocPtr pDump = parseLayoutDump(); + xmlDocUniquePtr pDump = parseLayoutDump(); CPPUNIT_ASSERT_EQUAL(2, getPages()); // table starts on page 1 and finished on page 2 @@ -1140,12 +1140,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf58944RepeatingTableHeader, "tdf58944-repeating-t DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf81100, "tdf81100.docx") { - xmlDocPtr pXmlDoc = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); CPPUNIT_ASSERT(pXmlDoc); // keep "repeat table header" setting of table styles assertXPath(pXmlDoc, "/w:styles/w:style/w:tblStylePr/w:trPr/w:tblHeader", 4); - xmlDocPtr pDump = parseLayoutDump(); + xmlDocUniquePtr pDump = parseLayoutDump(); CPPUNIT_ASSERT_EQUAL(3, getPages()); // table starts on page 1 and finished on page 2 @@ -1174,7 +1174,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf77417, "tdf77417.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf130494, "tdf130494.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight", "val", "yellow"); // keep direct formatting of table cell paragraph with removed highlighting assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r/w:rPr/w:highlight", 0); @@ -1182,7 +1182,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf130494, "tdf130494.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf130690, "tdf130690.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight", "val", "yellow"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[1]/w:rPr/w:highlight", 1); // keep direct formatting of table cell paragraph with removed highlighting @@ -1191,7 +1191,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf130690, "tdf130690.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf105215, "tdf105215.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:rPr/w:rFonts", "ascii", "Linux Libertine G"); // These were "Linux Libertine G" @@ -1205,7 +1205,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf105215, "tdf105215.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121597TrackedDeletionOfMultipleParagraphs, "tdf121597.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // check paragraphs with removed paragraph mark assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index bdaac7d64ad6..a8a55bd56e6c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -676,7 +676,7 @@ DECLARE_OOXMLEXPORT_TEST(testObjectCrossReference, "object_cross_reference.odt") DECLARE_OOXMLEXPORT_TEST(testTdf112202, "090716_Studentische_Arbeit_VWS.docx") { - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // page 1 header: 1 paragraph, 2 flys, 1 draw object assertXPath(pXmlDoc, "/root/page[1]/header/txt", 1); @@ -855,7 +855,7 @@ DECLARE_OOXMLEXPORT_TEST(testWatermarkTrim, "tdf114308.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf73547, "tdf73547-dash.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); double nD = getXPath(pXmlDoc, "//a:custDash/a:ds[1]", "d").toDouble(); CPPUNIT_ASSERT_DOUBLES_EQUAL(105000.0, nD, 5000.0); // was 100000 double nSp = getXPath(pXmlDoc, "//a:custDash/a:ds[1]", "sp").toDouble(); @@ -884,7 +884,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119143, "tdf119143.docx") DECLARE_OOXMLEXPORT_TEST(testTdf105444, "tdf105444.docx") { - xmlDocPtr pXmlComm = parseExport("word/comments.xml"); + xmlDocUniquePtr pXmlComm = parseExport("word/comments.xml"); if (!pXmlComm) return; // there is no extra paragraph on Win32, only a single one. @@ -909,7 +909,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf117137, "tdf117137.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf99631, "tdf99631.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//w:object", 2); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object", 2); @@ -923,7 +923,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf99631, "tdf99631.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf122563, "tdf122563.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object", 1); // Size of the embedded OLE spreadsheet was the bad "width:28.35pt;height:28.35pt" @@ -992,7 +992,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf122594, "tdf122594.docx") DECLARE_OOXMLEXPORT_TEST(testLanguageInGroupShape, "tdf131922_LanguageInGroupShape.docx") { // tdf#131922: Check if good language is used in shape group texts - xmlDocPtr pXml = parseExport("word/document.xml"); + xmlDocUniquePtr pXml = parseExport("word/document.xml"); if (!pXml) return; assertXPath(pXml, diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index f3ae46531c2b..d7102f0631ee 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -388,7 +388,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123636_newlinePageBreak3, "tdf123636_newlinePage CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Paragraphs", 5, getParagraphs() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 2, getPages() ); - xmlDocPtr pDump = parseLayoutDump(); + xmlDocUniquePtr pDump = parseLayoutDump(); assertXPath(pDump, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "Last line on page 1"); } @@ -399,7 +399,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123636_newlinePageBreak4, "tdf123636_newlinePage CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Paragraphs", 3, getParagraphs() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 2, getPages() ); - xmlDocPtr pDump = parseLayoutDump(); + xmlDocUniquePtr pDump = parseLayoutDump(); assertXPath(pDump, "/root/page[2]/body/txt[1]/Text", 0); } @@ -593,7 +593,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116371, "tdf116371.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFrameSizeExport, "floating-tables-anchor.docx") { // Make sure the table width is 4000 - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tblPr/w:tblW", "w", "4000"); } @@ -613,7 +613,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119201, "tdf119201.docx") DECLARE_OOXMLEXPORT_TEST(testTdf124594, "tdf124594.docx") { - xmlDocPtr pDump = parseLayoutDump(); + xmlDocUniquePtr pDump = parseLayoutDump(); // Without the accompanying fix in place, this test would have failed, as the portion text was // only "Er horte leise Schritte hinter", which means the 1st line of the 2nd paragraph was // split into two by a Special portion, i.e. the top margin of the shape was too large. @@ -623,7 +623,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124594, "tdf124594.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTextInput, "textinput.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // test the exported DOCX @@ -714,7 +714,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf123460, "tdf123460.docx") //tdf#125298: fix charlimit restrictions in bookmarknames and field references if they contain non-ascii characters DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125298, "tdf125298_crossreflink_nonascii_charlimit.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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"); CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8("\u00e1rv\u00edzt\u0171r\u0151_t\u00fck\u00f6rf\u00far\u00f3g\u00e9p"), bookmarkName1); @@ -771,7 +771,7 @@ DECLARE_OOXMLEXPORT_TEST(testTbrlFrameVml, "tbrl-frame-vml.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf119037, "tdf119037.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:top", "val", "single"); @@ -827,7 +827,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf119037, "tdf119037.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125657, "tdf125657.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXmlDoc); auto checkAttrIsInt = [&](const OString& sAttrName) { OUString sAttr = getXPath(pXmlDoc, @@ -853,14 +853,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125657, "tdf125657.docx") DECLARE_OOXMLEXPORT_TEST(testTdf125324, "tdf125324.docx") { discardDumpedLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/tab/infos/bounds", "top", "4193"); } DECLARE_OOXMLEXPORT_TEST(testTdf78657, "tdf78657_picture_hyperlink.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - xmlDocPtr pXmlRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels"); if (!pXmlDoc || !pXmlRels) return; assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/wp:docPr/a:hlinkClick", 1); @@ -880,7 +880,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBtlrFrame, "btlr-frame.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125518, "tdf125518.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // First diagram is anchored @@ -919,14 +919,14 @@ DECLARE_OOXMLEXPORT_TEST(testImageCommentAtChar, "image-comment-at-char.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131594, "tdf131594.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // lnNumType should not be exported if w:countBy="0" assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:lnNumType", 0); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121663, "tdf121663.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // auto distance of line numbering is 0.5 cm assertXPath(pXmlDoc, "//w:lnNumType", "distance", "283"); } @@ -1037,7 +1037,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf118169, "tdf118169.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127116, "tdf127116.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:bookmarkStart", "name"); @@ -1047,7 +1047,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127116, "tdf127116.odt") DECLARE_OOXMLEXPORT_TEST(testTdf127339, "tdf127339.docx") { - xmlDocPtr pXmlRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels"); if (!pXmlRels) return; @@ -1056,9 +1056,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127339, "tdf127339.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127362, "tdf127362.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); - xmlDocPtr pXmlRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels"); if (!pXmlRels) return; @@ -1069,7 +1069,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127362, "tdf127362.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127605, "tdf127605.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart", "name"); OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor"); @@ -1078,7 +1078,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127605, "tdf127605.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127732, "internal_hyperlink_frame.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:bookmarkStart", "name"); OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor"); @@ -1087,7 +1087,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127732, "internal_hyperlink_frame.odt DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127733, "internal_hyperlink_ole.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:bookmarkStart", "name"); @@ -1097,7 +1097,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127733, "internal_hyperlink_ole.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127734, "internal_hyperlink_region.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart", "name"); OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor"); @@ -1106,7 +1106,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127734, "internal_hyperlink_region.od DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127735, "internal_hyperlink_table.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:bookmarkStart", "name"); OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor"); @@ -1115,9 +1115,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127735, "internal_hyperlink_table.odt DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123628, "tdf123628.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); - xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); if (!pXmlStyles) return; @@ -1137,7 +1137,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127741, "tdf127741.docx") DECLARE_OOXMLEXPORT_TEST(testTdf127925, "tdf127925.odt") { - xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); if (!pXmlStyles) return; @@ -1146,7 +1146,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127925, "tdf127925.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127579, "tdf127579.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle", "val", "InternetLink"); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index d751393800ec..9bceb4c32cbe 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -84,7 +84,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf78749, "tdf78749.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128207, "tdf128207.docx") { //There was the charts on each other, because their horizontal and vertical position was 0! - xmlDocPtr p_XmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(p_XmlDoc); assertXPathContent(p_XmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor/wp:positionH/wp:posOffset", "4445"); } @@ -92,7 +92,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128207, "tdf128207.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123873, "tdf123873.docx") { //OLE Object were overlapped due to missing wrap import - xmlDocPtr p_XmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(p_XmlDoc); assertXPath( p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:drawing/wp:anchor/wp:wrapTopAndBottom"); @@ -109,7 +109,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf130814model, "tdf130814.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf107020, "tdf107020.docx") { - xmlDocPtr p_XmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(p_XmlDoc); assertXPath( p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect", "l", "4910"); @@ -123,7 +123,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf107020, "tdf107020.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf130814ooxml, "tdf130814.docx") { - xmlDocPtr p_XmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(p_XmlDoc); assertXPath( p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:rFonts", "eastAsia", "Arial Unicode MS"); @@ -172,7 +172,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf129888dml, "tdf129888dml.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf130120, "tdf130120.docx") { //Text for exporting the allowincell attribute: - xmlDocPtr p_XmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); assertXPath(p_XmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/mc:AlternateContent/" "mc:Choice/w:drawing/wp:anchor", "layoutInCell", "0"); } @@ -261,7 +261,7 @@ CPPUNIT_TEST_FIXTURE(Test, testArabicZeroNumberingFootnote) reload("Office Open XML Text", ""); - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Without the accompanying fix in place, this test would have failed with: // XPath '/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt' number of nodes is incorrect // because the exporter had no idea what markup to use for ARABIC_ZERO. @@ -289,7 +289,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChicagoNumberingFootnote) reload("Office Open XML Text", ""); - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Without the accompanying fix in place, this test would have failed with: // XPath '/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt' number of nodes is incorrect // because the exporter had no idea what markup to use for SYMBOL_CHICAGO. @@ -326,7 +326,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf130610, "tdf130610_bold_in_2_styles.ott") // check inline text properties { - xmlDocPtr pXmlDoc =parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc =parseExport("word/document.xml"); if (pXmlDoc) { assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:rPr/w:b"); @@ -336,7 +336,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf130610, "tdf130610_bold_in_2_styles.ott") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121045, "tdf121045.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); 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", "20"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:szCs", "val", "20"); @@ -357,7 +357,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121045, "tdf121045.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf92472, "tdf92472.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:sz", "val", "20"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:szCs", "val", "20"); @@ -525,7 +525,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf125038c, "tdf125038c.docx") DECLARE_OOXMLEXPORT_TEST(testTdf121661, "tdf121661.docx") { - xmlDocPtr pXmlSettings = parseExport("word/settings.xml"); + xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); if (!pXmlSettings) return; assertXPath(pXmlSettings, "/w:settings/w:hyphenationZone", "val", "851"); @@ -533,7 +533,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121661, "tdf121661.docx") DECLARE_OOXMLEXPORT_TEST(testTdf121658, "tdf121658.docx") { - xmlDocPtr pXmlSettings = parseExport("word/settings.xml"); + xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); if (!pXmlSettings) return; assertXPath(pXmlSettings, "/w:settings/w:doNotHyphenateCaps"); @@ -552,7 +552,7 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testTableStyleConfNested) xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); validate(maTempFile.GetFileName(), test::OOXML); mbExported = true; - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXmlDoc); // Without the accompanying fix in place, this test would have failed, as the custom table cell // border properties were lost, so the outer A2 cell started to have borders, not present in the @@ -576,7 +576,7 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testZeroLineSpacing) aMediaDescriptor["FilterName"] <<= OUString("Office Open XML Text"); xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); mbExported = true; - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXmlDoc); // Without the accompanying fix in place, this test would have failed with: @@ -607,7 +607,7 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testSemiTransparentText) aMediaDescriptor["FilterName"] <<= OUString("Office Open XML Text"); xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); mbExported = true; - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXmlDoc); OString aXPath = "/w:document/w:body/w:p/w:r/w:rPr/w14:textFill/w14:solidFill/w14:srgbClr/w14:alpha"; @@ -642,7 +642,7 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testUserField) xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); validate(maTempFile.GetFileName(), test::OOXML); mbExported = true; - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXmlDoc); // Without the accompanying fix in place, this test would have failed, the user field was @@ -675,7 +675,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128820, "tdf128820.fodt") { // Import of exported DOCX failed because of wrong namespace used for wsp element // Now test the exported XML, in case we stop failing opening invalid files - xmlDocPtr pXml = parseExport("word/document.xml"); + xmlDocUniquePtr pXml = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXml); // The parent wpg:wgp element has three children: wpg:cNvGrpSpPr, wpg:grpSpPr, and wpg:wsp // (if we start legitimately exporting additional children, this needs to be adjusted to check @@ -698,7 +698,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128820, "tdf128820.fodt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128889, "tdf128889.fodt") { - xmlDocPtr pXml = parseExport("word/document.xml"); + xmlDocUniquePtr pXml = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXml); // There was an w:r (with w:br) as an invalid child of first paragraph's w:pPr assertXPath(pXml, "/w:document/w:body/w:p[1]/w:pPr/w:r", 0); @@ -736,7 +736,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf129353, "tdf129353.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf77796, "tdf77796.docx") { - xmlDocPtr pXml = parseExport("word/document.xml"); + xmlDocUniquePtr pXml = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXml); // cell paddings from table style assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:start", "w", "5"); @@ -748,14 +748,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf77796, "tdf77796.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128290, "tdf128290.odt") { - xmlDocPtr pXml = parseExport("word/document.xml"); + xmlDocUniquePtr pXml = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXml); assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblLayout", "type", "fixed"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123757, "tdf123757.docx") { - xmlDocPtr pXml = parseExport("word/document.xml"); + xmlDocUniquePtr pXml = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXml); assertXPath(pXml, "/w:document/w:body/w:tbl", 2); } @@ -793,7 +793,7 @@ DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header- // Additional problem: top margin on page 3 was wrong. if (mbExported) { - xmlDocPtr pXml = parseExport("word/document.xml"); + xmlDocUniquePtr pXml = parseExport("word/document.xml"); // Without the accompanying fix in place, this test would have failed with: // - Expected: 2200 // - Actual : 2574 @@ -806,17 +806,17 @@ DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header- DECLARE_OOXMLEXPORT_TEST(testHyphenationAuto, "hyphenation.odt") { // Explicitly set hyphenation=auto on document level - xmlDocPtr pXmlSettings = parseExport("word/settings.xml"); + xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); CPPUNIT_ASSERT(pXmlSettings); assertXPath(pXmlSettings, "/w:settings/w:autoHyphenation", "val", "true"); // Second paragraph has explicitly enabled hyphenation - xmlDocPtr pXml = parseExport("word/document.xml"); + xmlDocUniquePtr pXml = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXml); assertXPath(pXml, "/w:document/w:body/w:p[2]/w:pPr/w:suppressAutoHyphens", "val", "false"); // Default paragraph style explicitly disables hyphens - xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); CPPUNIT_ASSERT(pXmlStyles); assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:pPrDefault/w:pPr/w:suppressAutoHyphens", "val", "true"); } @@ -824,7 +824,7 @@ DECLARE_OOXMLEXPORT_TEST(testHyphenationAuto, "hyphenation.odt") DECLARE_OOXMLEXPORT_TEST(testStrikeoutGroupShapeText, "tdf131776_StrikeoutGroupShapeText.docx") { // tdf#131776: Check if strikeout is used in shape group texts - xmlDocPtr pXml = parseExport("word/document.xml"); + xmlDocUniquePtr pXml = parseExport("word/document.xml"); if (!pXml) return; @@ -864,7 +864,7 @@ DECLARE_OOXMLEXPORT_TEST(testStrikeoutGroupShapeText, "tdf131776_StrikeoutGroupS DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131539, "tdf131539.odt") { //The positions of OLE objects were not exported, check if now it is exported correctly - xmlDocPtr p_XmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(p_XmlDoc); OUString aXmlVal = getXPath(p_XmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:object/v:shape", "style"); // This data was missing diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index ef9ae951edeb..49012edce050 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -87,7 +87,7 @@ DECLARE_OOXMLEXPORT_TEST(testZoom, "zoom.docx") CPPUNIT_ASSERT_EQUAL(sal_Int16(42), nValue); // Validation test: order of elements were wrong. - xmlDocPtr pXmlDoc = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); if (!pXmlDoc) return; // Order was: rsid, next. @@ -324,7 +324,7 @@ DECLARE_OOXMLEXPORT_TEST(testMathVerticalStacks, "math-vertical_stacks.docx") DECLARE_OOXMLEXPORT_TEST(testTable, "table.odt") { // Make sure we write qFormat for well-known style names. - xmlDocPtr pXmlDocCT = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlDocCT = parseExport("word/styles.xml"); CPPUNIT_ASSERT(pXmlDocCT); assertXPath(pXmlDocCT, "//w:style[@w:styleId='Normal']/w:qFormat", 1); } @@ -411,7 +411,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo51550, "fdo51550.odt") uno::Reference<container::XIndexAccess> xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xEmbeddedObjects->getCount()); - xmlDocPtr pXmlDocCT = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); if (!pXmlDocCT) return; // initial import @@ -419,13 +419,13 @@ DECLARE_OOXMLEXPORT_TEST(testFdo51550, "fdo51550.odt") assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.xlsx']", "ContentType", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsx']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); // check the content too - xmlDocPtr pXmlDocContent = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); assertXPath(pXmlDocContent, "/w:document/w:body/w:p/w:r/w:object/o:OLEObject", "ProgID", @@ -516,7 +516,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCellBtlr, "cell-btlr.docx") * w:val="btLr"/> token was completely missing in the output. */ - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:textDirection", "val", "btLr"); } @@ -586,7 +586,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo64826, "fdo64826.docx") // 'Track-Changes' (Track Revisions) wasn't exported. CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(mxComponent, "RecordChanges")); // 'Show-Changes' should not be exported - default is true. - if (xmlDocPtr pXmlSettings = parseExport("word/settings.xml")) + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) { assertXPath(pXmlSettings, "/w:settings/w:revisionView", 0); } @@ -862,7 +862,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageBorderSpacingExportCase2, "page-bord // The exporter ALWAYS exported 'w:offsetFrom="text"' even when the spacing values where too large // for Word to handle (larger than 31 points) - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // Assert the XPath expression - page borders assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgBorders", "offsetFrom", "page"); @@ -890,7 +890,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66145, "fdo66145.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testGrabBag, "grabbag.docx") { // w:mirrorIndents was lost on roundtrip, now should be handled as a grab bag property - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:mirrorIndents"); } @@ -1075,7 +1075,7 @@ DECLARE_OOXMLEXPORT_TEST(testTransparentShadow, "transparent-shadow.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(NoFillAttrInImagedata, "NoFillAttrInImagedata.docx") { //problem was that type and color2 which are v:fill attributes were written in 'v:imagedata' - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect/v:imagedata", "type"); assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect/v:imagedata", "color2"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 447bbb1236e8..a1e572fed89f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -139,7 +139,7 @@ DECLARE_OOXMLEXPORT_TEST(testCharacterBorder, "charborder.odt") CPPUNIT_ASSERT_EQUAL(sal_Int16(318), aShadow.ShadowWidth); } - if (xmlDocPtr pXmlStyles = parseExport("word/styles.xml")) + if (xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml")) { // Make sure we write qFormat for custom style names. assertXPath(pXmlStyles, "//w:style[@w:styleId='Heading']/w:qFormat", 1); @@ -149,7 +149,7 @@ DECLARE_OOXMLEXPORT_TEST(testCharacterBorder, "charborder.odt") DECLARE_OOXMLEXPORT_TEST(testStyleInheritance, "style-inheritance.docx") { // Check that now styleId's are more like what MSO produces - xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); if (!pXmlStyles) return; // the 1st style always must be Normal @@ -249,7 +249,7 @@ DECLARE_OOXMLEXPORT_TEST(testStyleInheritance, "style-inheritance.docx") DECLARE_OOXMLEXPORT_TEST(testCalendar1, "calendar1.docx") { // Document has a non-trivial table style, test the roundtrip of it. - xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); if (!pXmlStyles) return; assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:basedOn", "val", "TableNormal"); @@ -270,7 +270,7 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar1, "calendar1.docx") assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='band2Horz']/w:tcPr/w:tcBorders/w:top", "themeColor", "text1"); // w:tblLook element and its attributes were missing. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "firstRow", "1"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "lastRow", "0"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "lastColumn", "0"); @@ -294,7 +294,7 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar2, "calendar2.docx") CPPUNIT_ASSERT_EQUAL(14.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharHeight")); // This paragraph property was missing in table style. - xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); if (!pXmlStyles) return; assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:pPr/w:jc", "val", "center"); @@ -354,7 +354,7 @@ DECLARE_OOXMLEXPORT_TEST(testTcBorders, "testTcBorders.docx") { //fdo#76635 : Table borders are not getting preserved. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -371,7 +371,7 @@ DECLARE_OOXMLEXPORT_TEST(testTcBorders, "testTcBorders.docx") DECLARE_OOXMLEXPORT_TEST(testQuicktables, "quicktables.docx") { - xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); if (!pXmlStyles) return; @@ -401,7 +401,7 @@ DECLARE_OOXMLEXPORT_TEST(testQuicktables, "quicktables.docx") DECLARE_OOXMLEXPORT_TEST(testFdo71302, "fdo71302.docx") { - xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); if (!pXmlStyles) return; @@ -496,7 +496,7 @@ DECLARE_OOXMLEXPORT_TEST(testFontNameIsEmpty, "font-name-is-empty.docx") // Check no empty font name is exported // This test does not fail, if the document contains a font with empty name. - xmlDocPtr pXmlFontTable = parseExport("word/fontTable.xml"); + xmlDocUniquePtr pXmlFontTable = parseExport("word/fontTable.xml"); if (!pXmlFontTable) return; xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlFontTable, "/w:fonts/w:font"); @@ -515,7 +515,7 @@ DECLARE_OOXMLEXPORT_TEST(testFontNameIsEmpty, "font-name-is-empty.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testMultiColumnLineSeparator, "multi-column-line-separator-SAVED.docx") { // Check for the Column Separator value.It should be FALSE as the document does not contain separator line. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:sectPr/w:cols","sep","false"); } @@ -550,7 +550,7 @@ DECLARE_OOXMLEXPORT_TEST(testCustomXmlGrabBag, "customxml.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCustomXmlRelationships, "customxml.docx") { - xmlDocPtr pXmlDoc = parseExport("customXml/_rels/item1.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("customXml/_rels/item1.xml.rels"); // Check there is a relation to itemProps1.xml. assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship", 1); @@ -562,7 +562,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo69644, "fdo69644.docx") // 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 - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol", 5); } @@ -574,7 +574,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70812, "fdo70812.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPgMargin, "testPgMargin.docx") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgMar", "left", "1440"); } @@ -691,7 +691,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCellGridSpan, "cell-grid-span.docx") // 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). - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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); } @@ -710,7 +710,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo71646, "fdo71646.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testParaAutoSpacing, "para-auto-spacing.docx") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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"); @@ -786,7 +786,7 @@ DECLARE_OOXMLEXPORT_TEST(testFootnoteParagraphTag, "testFootnote.docx") /* In footnotes.xml, the paragraph tag inside <w:footnote w:id="2"> was getting written into document.xml. * Check for, paragraph tag is correctly written into footnotes.xml. */ - xmlDocPtr pXmlFootnotes = parseExport("word/footnotes.xml"); + xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml"); if (!pXmlFootnotes) return; assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]","id","2"); @@ -795,13 +795,13 @@ DECLARE_OOXMLEXPORT_TEST(testFootnoteParagraphTag, "testFootnote.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSpacingLineRule,"table_lineRule.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + 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", "lineRule", "auto"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableLineSpacing, "table_atleast.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:spacing", "line", "320"); } @@ -821,7 +821,7 @@ DECLARE_OOXMLEXPORT_TEST(testMce, "mce.docx") DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx") { // check default font theme values have been preserved - xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); if (!pXmlStyles) return; assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "asciiTheme", "minorHAnsi"); @@ -835,7 +835,7 @@ DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx") assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Custom1']/w:rPr/w:color", "themeTint", "99"); // check direct format font theme values have been preserved - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:r[1]/w:rPr/w:rFonts", "hAnsiTheme", "majorHAnsi"); @@ -847,7 +847,7 @@ DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(0xbf), sThemeShade.toInt32(16)); // check the themeFontLang values in settings file - xmlDocPtr pXmlSettings = parseExport("word/settings.xml"); + xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); if (!pXmlSettings) return; assertXPath(pXmlSettings, "/w:settings/w:themeFontLang", "val", "en-US"); @@ -878,7 +878,7 @@ DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx") DECLARE_OOXMLEXPORT_TEST(testTableThemePreservation, "table-theme-preservation.docx") { - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -935,7 +935,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testcantSplit, "2_table_doc.docx") // 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 - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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"); } @@ -970,13 +970,13 @@ DECLARE_OOXMLEXPORT_TEST(testExtraSectionBreak, "1_page.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testcolumnbreak, "columnbreak.docx") { CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(5, "This is first line after col brk."), "BreakType")); - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[1]/w:br", "type", "column"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testGlossary, "testGlossary.docx") { - xmlDocPtr pXmlDoc = parseExport("word/glossary/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/glossary/document.xml"); assertXPath(pXmlDoc, "/w:glossaryDocument", "Ignorable", "w14 wp14"); } @@ -987,14 +987,14 @@ DECLARE_OOXMLEXPORT_TEST(testFdo71785, "fdo71785.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCrashWhileSave, "testCrashWhileSave.docx") { - xmlDocPtr pXmlDoc = parseExport("word/footer1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/footer1.xml"); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:ftr/w:tbl/w:tr/w:tc[1]/w:p[1]/w:pPr/w:pStyle", "val").match("Normal")); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFileOpenInputOutputError,"floatingtbl_with_formula.docx") { // Docx containing Floating table with formula was giving "General input/output error" while opening in LibreOffice - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle", "val", "Normal"); // let's also assert that the formula was exported properly @@ -1005,7 +1005,7 @@ DECLARE_OOXMLEXPORT_TEST(testSingleCellTableBorders, "tdf124399_SingleCellTableB { // tdf#124399: Extra borders on single cell tables fixed. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:top [@w:val = 'nil']", 1); @@ -1016,7 +1016,7 @@ DECLARE_OOXMLEXPORT_TEST(testInsideBorders, "tdf129242_InsideBorders.docx") { // tdf#129242: Don't remove inside borders if the table has more than one cells. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -1028,7 +1028,7 @@ DECLARE_OOXMLEXPORT_TEST(testRightBorder, "tdf129442_RightBorder.docx") { // tdf#129442: Right border of a one column table was missing. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -1040,7 +1040,7 @@ DECLARE_OOXMLEXPORT_TEST(testBottomBorder, "tdf129450_BottomBorder.docx") { // tdf#129450: Missing bottom border in one row table. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -1053,7 +1053,7 @@ DECLARE_OOXMLEXPORT_TEST(testBottomBorders, "tdf129452_BottomBorders.docx") // tdf#129452: Do not omit bottom borders when a column in a table is vertically merged and // the inside borders are turned off. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -1066,13 +1066,13 @@ DECLARE_OOXMLEXPORT_TEST(testFontTypes, "tdf120344_FontTypes.docx") // tdf#120344: Font type of numbering symbols can be different than the font type of the text. // Check the font type of the text, should be Consolas. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/w:rPr/w:rFonts [@w:ascii='Consolas']", 1); // Now the font type of the numbering symbols, should be Arial Black. - xmlDocPtr qXmlDocument = parseExport("word/numbering.xml"); + xmlDocUniquePtr qXmlDocument = parseExport("word/numbering.xml"); if (!qXmlDocument) return; assertXPath(qXmlDocument, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:rPr/w:rFonts [@w:ascii='Arial Black']", 1); @@ -1080,7 +1080,7 @@ DECLARE_OOXMLEXPORT_TEST(testFontTypes, "tdf120344_FontTypes.docx") DECLARE_OOXMLEXPORT_TEST(testNumberingLevels, "tdf95495.docx") { - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -1092,7 +1092,7 @@ DECLARE_OOXMLEXPORT_TEST(testVerticalBorders, "calendar3.docx") { // tdf#130799: Inside vertical borders of a table should not be missing. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; // Left and right borders. @@ -1103,7 +1103,7 @@ DECLARE_OOXMLEXPORT_TEST(testArrowFlipXY, "tdf100751_arrowBothFlip.docx") { // tdf#100751: Both x and y flip should happen. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -1114,7 +1114,7 @@ DECLARE_OOXMLEXPORT_TEST(testArrowFlipXY, "tdf100751_arrowBothFlip.docx") DECLARE_OOXMLEXPORT_TEST(testArrowPosition, "tdf104565_ArrowPosition.docx") { // tdf#104565: Test correct position. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -1127,7 +1127,7 @@ DECLARE_OOXMLEXPORT_TEST(testArrowMarker, "tdf123346_ArrowMarker.docx") { // tdf#123346: Check arrow marker. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index a6352c767335..9e0e23b3c723 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -100,37 +100,37 @@ DECLARE_OOXMLEXPORT_TEST(testAutofit, "autofit.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesDeletedParagraphMark, "testTrackChangesDeletedParagraphMark.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesInsertedParagraphMark, "testTrackChangesInsertedParagraphMark.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:ins"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesDeletedTableRow, "testTrackChangesDeletedTableRow.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:del"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesInsertedTableRow, "testTrackChangesInsertedTableRow.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:ins"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesDeletedTableCell, "testTrackChangesDeletedTableCell.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:tcPr/w:cellDel"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesInsertedTableCell, "testTrackChangesInsertedTableCell.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:tcPr/w:cellIns"); } @@ -151,19 +151,19 @@ DECLARE_OOXMLEXPORT_TEST(testTextBoxPictureFill, "textbox_picturefill.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO73034, "FDO73034.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:u", "val").match("single")); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO71834, "fdo71834.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[2]/w:tc[1]/w:tcPr[1]/w:tcW[1]","type", "dxa"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesParagraphProperties, "testTrackChangesParagraphProperties.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange", 0); } @@ -184,7 +184,7 @@ DECLARE_OOXMLEXPORT_TEST(testMsoSpt180, "mso-spt180.docx") DECLARE_OOXMLEXPORT_TEST(testFdo73550, "fdo73550.docx") { - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; // This was wrap="none". @@ -234,7 +234,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73556,"fdo73556.docx") * the table width was calculated as 2820 from cells instead * of 3751 from the Grid. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol", 3); sal_Int32 tableWidth = 0; tableWidth += getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[1]", "w").toInt32(); @@ -246,7 +246,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73556,"fdo73556.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSegFaultWhileSave, "test_segfault_while_save.docx") { // fdo#74499 - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6137), getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").toInt32()); // tdf#106572 - preventative test matching danger conditions, but imported OK anyway @@ -263,7 +263,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(fdo69656, "Table_cell_auto_width_fdo69656.do // After changes for fdo76741 the fixed width is exported as "dxa" for DOCX // Check for the width type of table and its cells. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW","type","dxa"); } @@ -274,7 +274,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76741, "fdo76741.docx") // - the table alignment in saved file is "left" instead of "center" // - the table width type in properties is "auto" instead of "dxa" - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//w:jc", "val", "center"); assertXPath(pXmlDoc, "//w:tblW", "w", "10081"); @@ -285,25 +285,25 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73541,"fdo73541.docx") { // fdo#73541: The mirrored margins were not imported and mapped correctly in Page Layout // Hence <w:mirrorMargins /> tag was not exported back in settings.xml - xmlDocPtr pXmlDoc = parseExport("word/settings.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); assertXPath(pXmlDoc, "/w:settings/w:mirrorMargins"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo106029,"fdo106029.docx") { - xmlDocPtr pXmlDoc = parseExport("word/settings.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); assertXPath(pXmlDoc, "/w:settings/w:compat/w:doNotExpandShiftReturn"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO74106, "FDO74106.docx") { - xmlDocPtr pXmlDoc = parseExport("word/numbering.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt", "val","hebrew1"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO74215, "FDO74215.docx") { - xmlDocPtr pXmlDoc = parseExport("word/numbering.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); // tdf#106849 NumPicBullet xShape should not be resized. // This is dependent on the running system: see MSWordExportBase::BulletDefinitions @@ -339,7 +339,7 @@ DECLARE_OOXMLEXPORT_TEST(testColumnBreak_ColumnCountIsZero,"fdo74153.docx") /* fdo73545: Column Break with Column_count = 0 was not getting preserved. * The <w:br w:type="column" /> was missing after roundtrip */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); if (pXmlDoc) assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:br","type","column"); @@ -368,7 +368,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testIndentation, "test_indentation.docx") // fdo#74141 :There was a problem that in style.xml and document.xml in <w:ind> tag "right" & "left" margin // attributes gets added(w:right=0 & w:left=0) if these attributes are not set in original document. // This test is to verify <w:ind> does not contain w:right attribute. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:ind", "end"); } @@ -377,7 +377,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testChartInFooter, "chart-in-footer.docx") // fdo#73872: document contains chart in footer. // The problem was that footer1.xml.rels files for footer1.xml // files were missing from docx file after roundtrip. - xmlDocPtr pXmlDoc = parseExport("word/_rels/footer1.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/footer1.xml.rels"); // Check footer1.xml.rels contains in doc after roundtrip. // Check Id = rId1 in footer1.xml.rels @@ -387,14 +387,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testChartInFooter, "chart-in-footer.docx") "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"); - xmlDocPtr pXmlDocCT = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@PartName='/word/charts/chart1.xml']", "ContentType", "application/vnd.openxmlformats-officedocument.drawingml.chart+xml"); // check the content too - xmlDocPtr pXmlDocFooter1 = parseExport("word/footer1.xml"); + xmlDocUniquePtr pXmlDocFooter1 = parseExport("word/footer1.xml"); assertXPath(pXmlDocFooter1, "/w:ftr/w:p[1]/w:r/w:drawing/wp:inline/a:graphic/a:graphicData", "uri", @@ -448,7 +448,7 @@ DECLARE_OOXMLEXPORT_TEST(testFloatingTablePosition, "floating-table-position.doc DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAbi11739, "abi11739.docx") { // Validation test: order of elements were wrong. - xmlDocPtr pXmlDoc = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); // Order was: uiPriority, link, basedOn. CPPUNIT_ASSERT(getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "basedOn") < getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "link")); CPPUNIT_ASSERT(getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "link") < getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "uiPriority")); @@ -466,7 +466,7 @@ DECLARE_OOXMLEXPORT_TEST(testEmbeddedXlsx, "embedded-xlsx.docx") CPPUNIT_ASSERT_EQUAL(OUString("FrameShape"), getShape(2)->getShapeType()); // check the objects are present in the exported document.xml - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/w:object", 2); @@ -494,7 +494,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNumberedLists_StartingWithZero, "FDO7410 * the Numbered list should start from 0. * Problem was LO was writing <w:start> for all levels 0-8 with default value "1". */ - xmlDocPtr pXmlDoc = parseExport("word/numbering.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); // Check that we do _not_ export w:start for <w:lvl w:ilvl="0">. assertXPath(pXmlDoc, "w:numbering/w:abstractNum[1]/w:lvl[1]/w:start", 0); @@ -507,7 +507,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageBreak,"fdo74566.docx") * Now after fix , LO writes Page Break as the new paragraph and also * preserves the xml tag <w:br>. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); uno::Reference<text::XTextRange> xParagraph2 = getParagraph(2); uno::Reference<text::XTextRange> xParagraph4 = getParagraph(4); @@ -519,7 +519,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageBreak,"fdo74566.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOleObject, "test_ole_object.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape/v:imagedata", "o:title"); @@ -530,13 +530,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOleObject, "test_ole_object.docx") // TODO: ProgID="Package" - what is this? Zip with 10k extra header? // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.bin']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"); // check the media type too - xmlDocPtr pXmlDocCT = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.bin']", "ContentType", @@ -551,7 +551,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo74792, "fdo74792.docx") * were not preserved on exporting to DOCX format * Added support to grabbag the rels, with associated images. */ - xmlDocPtr pXmlDoc = parseExport("word/diagrams/_rels/data1.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/diagrams/_rels/data1.xml.rels"); if(!pXmlDoc) return; assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship", 4); @@ -570,11 +570,11 @@ DECLARE_OOXMLEXPORT_TEST(testFdo77718, "fdo77718.docx") //repeated and thereby causing a data loss as the binary stream was //getting over written. This test case ensures that unique names are //given for images in different smart arts. - xmlDocPtr pXmlDataRels1 = parseExport("word/diagrams/_rels/data1.xml.rels"); + xmlDocUniquePtr pXmlDataRels1 = parseExport("word/diagrams/_rels/data1.xml.rels"); if( !pXmlDataRels1 ) return; - xmlDocPtr pXmlDataRels2 = parseExport("word/diagrams/_rels/data2.xml.rels"); + xmlDocUniquePtr pXmlDataRels2 = parseExport("word/diagrams/_rels/data2.xml.rels"); if( !pXmlDataRels2 ) return; @@ -598,7 +598,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo77718, "fdo77718.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableCurruption, "tableCurrupt.docx") { - xmlDocPtr pXmlDoc = parseExport("word/header2.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml"); CPPUNIT_ASSERT(pXmlDoc) ; assertXPath(pXmlDoc, "/w:hdr/w:tbl[1]/w:tr[1]/w:tc[1]",1); @@ -611,7 +611,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableCurruption, "tableCurrupt.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDateControl, "date-control.docx") { // check XML - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date", "fullDate", "2014-03-05T00:00:00Z"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:dateFormat", "val", "dddd, dd' de 'MMMM' de 'yyyy"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:lid", "val", "es-ES"); @@ -620,7 +620,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDateControl, "date-control.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_Tdf115030, "tdf115030.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); sal_Unicode aDot = {0x02D9}; sal_Unicode aDobleDot = {0x00A8}; assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:acc/m:accPr/m:chr", "val", OUString(aDot)); @@ -630,14 +630,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_Tdf115030, "tdf115030.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_OpeningBrace, "2120112713_OpenBrace.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Checking for OpeningBrace tag assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:d[1]/m:dPr[1]/m:begChr[1]","val",""); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_Tdf132305, "tdf132305.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:bar/m:barPr/m:pos","val","top"); } @@ -678,7 +678,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_Tdf132305, "tdf132305.docx") // See, tdf#38778 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf38778, "tdf38778_properties_in_run_for_field.doc") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); const OUString psz("20"); const OUString pszCs("20"); @@ -712,7 +712,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf38778, "tdf38778_properties_in_run_fo DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76312, "FDO76312.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]"); } @@ -720,7 +720,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76312, "FDO76312.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testComboBoxControl, "combobox-control.docx") { // check XML - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]", "value", "manolo"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]", "value", "pepito"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "Manolo"); @@ -739,7 +739,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testComboBoxControl, "combobox-control.docx" DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCheckBoxControl, "checkbox-control.docx") { // check XML - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:checked", "val", "1"); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:checkedState", "val", "2612"); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:uncheckedState", "val", "2610"); @@ -753,8 +753,8 @@ DECLARE_OOXMLEXPORT_TEST(testParagraphWithComments, "paragraphWithComments.docx" which was causing a mismatch in the relationship for comment id's in document.xml and comment.xml */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - xmlDocPtr pXmlComm = parseExport("word/comments.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlComm = parseExport("word/comments.xml"); if(!pXmlDoc) return; @@ -783,11 +783,11 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOLEObjectinHeader, "2129393649.docx") // Problem was relationship entry for oleobject from header was // exported into document.xml.rels file because of this rels file // for headers were missing from document/word/rels. - xmlDocPtr pXmlDoc = parseExport("word/_rels/header1.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/header1.xml.rels"); assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship[1]","Id","rId1"); - xmlDocPtr pXmlDocCT = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); // check the media type too assertXPath(pXmlDocCT, @@ -796,12 +796,12 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOLEObjectinHeader, "2129393649.docx") "application/vnd.openxmlformats-officedocument.oleObject"); // check the content too - xmlDocPtr pXmlDocHeader1 = parseExport("word/header1.xml"); + xmlDocUniquePtr pXmlDocHeader1 = parseExport("word/header1.xml"); assertXPath(pXmlDocHeader1, "/w:hdr/w:tbl/w:tr[1]/w:tc[2]/w:p[1]/w:r/w:object/o:OLEObject", "ProgID", "Word.Picture.8"); - xmlDocPtr pXmlDocHeader2 = parseExport("word/header2.xml"); + xmlDocUniquePtr pXmlDocHeader2 = parseExport("word/header2.xml"); assertXPath(pXmlDocHeader2, "/w:hdr/w:tbl/w:tr[1]/w:tc[2]/w:p[1]/w:r/w:object/o:OLEObject", "ProgID", @@ -810,20 +810,20 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOLEObjectinHeader, "2129393649.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_ClosingBrace, "2120112713.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Checking for ClosingBrace tag assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:d[2]/m:dPr[1]/m:endChr[1]","val",""); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testlvlPicBulletId, "lvlPicBulletId.docx") { - xmlDocPtr pXmlDoc = parseExport("word/numbering.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPath(pXmlDoc, "/w:numbering[1]/w:abstractNum[1]/w:lvl[1]/w:lvlPicBulletId[1]", 0); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtContent, "SdtContent.docx") { - xmlDocPtr pXmlDoc = parseExport("word/header1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); assertXPath(pXmlDoc, "/w:hdr[1]/w:sdt[1]/w:sdtContent[1]/w:p[1]/w:del[1]"); } @@ -834,7 +834,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtContent, "SdtContent.docx") DECLARE_OOXMLEXPORT_TEST(testFdo76016, "fdo76016.docx") { // check XML - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); if (!pXmlDoc) return; assertXPath(pXmlDoc, "//a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]", "name", "adj1"); @@ -848,7 +848,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFileWithInvalidImageLink, "FileWithInval invalid, then the RT file used to result in corruption since the exported image would be an empty image. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:drawing[1]/wp:inline[1]/" @@ -858,20 +858,20 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFileWithInvalidImageLink, "FileWithInval DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeDOCX, "fdo80410.docx") { - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.docx']", "ContentType", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.docx']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); // check the content too - xmlDocPtr pXmlDocContent = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); assertXPath(pXmlDocContent, "/w:document/w:body/w:p[6]/w:r/w:object/o:OLEObject", "ProgID", @@ -880,18 +880,18 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeDOCX, "fdo80410.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeXLSM, "fdo76098.docx") { - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/Microsoft_Excel_Macro-Enabled_Worksheet1.xlsm']", "ContentType", "application/vnd.ms-excel.sheet.macroEnabled.12"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/charts/_rels/chart1.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/charts/_rels/chart1.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='../embeddings/Microsoft_Excel_Macro-Enabled_Worksheet1.xlsm']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); // check the content too - xmlDocPtr pXmlDocChart1 = parseExport("word/charts/chart1.xml"); + xmlDocUniquePtr pXmlDocChart1 = parseExport("word/charts/chart1.xml"); assertXPath(pXmlDocChart1, "/c:chartSpace/c:externalData", "id", @@ -900,7 +900,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeXLSM, "fdo76098.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test76108, "test76108.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); //docx file after RT is getting corrupted. assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:fldChar[1]", "fldCharType", "begin"); } @@ -910,7 +910,7 @@ DECLARE_OOXMLEXPORT_TEST(testTCTagMisMatch, "TCTagMisMatch.docx") // TCTagMisMatch.docx : This document contains an empty table with borders. // there was a TC tag mismatch which resulted into a crash. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); if(!pXmlDoc) return; assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]",0); @@ -920,13 +920,13 @@ DECLARE_OOXMLEXPORT_TEST(testTCTagMisMatch, "TCTagMisMatch.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78292, "FDO78292.docx") { //text node is a leaf node, it should not have any children - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc,"/w:document/w:body/w:p[14]/w:sdt[3]/w:sdtPr[1]/w:text/w14:checked",0); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSimpleSdts, "simple-sdts.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:text", 1); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:id", 3); @@ -937,7 +937,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSimpleSdts, "simple-sdts.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testEmbeddedExcelChart, "EmbeddedExcelChart.docx") { - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.xls']", @@ -945,14 +945,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testEmbeddedExcelChart, "EmbeddedExcelChart. "application/vnd.ms-excel"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xls']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"); // check the content too - xmlDocPtr pXmlDocContent = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); assertXPath(pXmlDocContent, "/w:document/w:body/w:p/w:r/w:object/o:OLEObject", "ProgID", @@ -986,7 +986,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf103001, "tdf103001.docx") DECLARE_OOXMLEXPORT_TEST(testTdf92521, "tdf92521.odt") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) // There should be a section break that's in the middle of the document: right after the table. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr", 1); } @@ -996,7 +996,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf102466, "tdf102466.docx") // the problem was: file is truncated: the first page is missing. // More precisely, the table in the first page was clipped. { - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nFlyPrtHeight = getXPath(pXmlDoc, "(/root/page[1]//fly)[1]/infos/prtBounds", "height").toInt32(); sal_Int32 nTableHeight = getXPath(pXmlDoc, "(/root/page[1]//fly)[1]/tab/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_MESSAGE("The table is clipped in a fly frame.", nFlyPrtHeight >= nTableHeight); @@ -1032,7 +1032,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf102466, "tdf102466.docx") DECLARE_OOXMLEXPORT_TEST(testTdf99090_pgbrkAfterTable, "tdf99090_pgbrkAfterTable.docx") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) // There should be a regular page break that's in the middle of the document: right after the table. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); } @@ -1137,7 +1137,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf81345_045Original,"tdf81345.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDocxTablePosition, "floating-table-position.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // the exported positions were wrong due to some missing shifting in the export code assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpX", "3494"); @@ -1147,7 +1147,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDocxTablePosition, "floating-table-posit DECLARE_OOXMLEXPORT_TEST(testUnderlineGroupShapeText, "tdf123351_UnderlineGroupSapeText.docx") { // tdf#123351: Check if correct underline is used. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -1201,7 +1201,7 @@ DECLARE_OOXMLEXPORT_TEST(testUnderlineGroupShapeText, "tdf123351_UnderlineGroupS DECLARE_OOXMLEXPORT_TEST(testUnderlineColorGroupedShapes, "tdf132491_UnderlineColorGroupedShapes.docx") { // tdf#132491 : Check if correct color is used for underline. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 534eb7f34f0f..a8e4f3d5fc5b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -47,7 +47,7 @@ protected: DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76248, "FDO76248.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // In two cases the a:graphicData elements had no children, which is invalid. assertXPath(pXmlDoc, "//a:graphicData[not(*)]", 0); } @@ -98,7 +98,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo76589 , "fdo76589.docx") * w:val of w:lvlText was empty. * It should be <w:lvlText w:val="%1" /> */ - xmlDocPtr pXmlDoc = parseExport("word/numbering.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val","%1" ); } @@ -106,7 +106,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo76589 , "fdo76589.docx") DECLARE_OOXMLEXPORT_TEST(testDecimalNumberingNoLeveltext, "decimal-numbering-no-leveltext.docx") { // This was "%1", not empty: we turned a kind-of-none numbering into a decimal one. - if (xmlDocPtr pXmlDoc = parseExport("word/numbering.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml")) assertXPath (pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val", ""); } @@ -131,7 +131,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79008, "fdo79008.docx") DECLARE_OOXMLEXPORT_TEST(testTdf120852_readOnlyProtection, "tdf120852_readOnlyProtection.docx") { - if (xmlDocPtr pXmlSettings = parseExport("word/settings.xml")) + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) { assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "1"); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "readOnly"); @@ -164,7 +164,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120852_readOnlyUnProtected, "tdf120852_readOnlyU else { CPPUNIT_ASSERT_MESSAGE("Section is protected", getProperty<bool>(xSect, "IsProtected")); - xmlDocPtr pXmlSettings = parseExport("word/settings.xml"); + xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "forms"); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "true"); } @@ -172,7 +172,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120852_readOnlyUnProtected, "tdf120852_readOnlyU DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAuthorPropertySdt, "author-property.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns1:coreProperties[1]/ns0:creator[1]"); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:dataBinding", "storeItemID","{6C3C8BC8-F283-45AE-878A-BAB7291924A1}"); @@ -188,7 +188,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76586, "fdo76586.docx") * while there are two cells in a table row. * So the table was not imported with the correct cell widths */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // there is only one table in the test file assertXPath(pXmlDoc, "//w:tblGrid/w:gridCol[1]", "w", "1601"); @@ -197,7 +197,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76586, "fdo76586.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76587 , "fdo76587.docx") { - xmlDocPtr pXmlDoc = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); assertXPath(pXmlDoc, "/w:styles/w:style[8]/w:pPr/w:spacing", "line", "240"); assertXPath(pXmlDoc, "/w:styles/w:style[8]/w:pPr/w:spacing", "lineRule", "auto"); } @@ -209,14 +209,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77890 , "fdo77890.docx") if the different first page is set for the pages in the document. For additional comments please refer to https://www.libreoffice.org/bugzilla/show_bug.cgi?id=77890#c2 */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:br", "type", "page"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNumberedList,"NumberedList.docx") { //fdo74150:In document.xml, for pStyle = "NumberedList1", iLvl and numId was not preserved - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + 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[1]/w:pStyle", "val", "NumberedList1"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:numPr/w:ilvl","val", "0"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:numPr/w:numId","val", "0"); @@ -229,7 +229,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNumberedList,"NumberedList.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131819, "NumberedList.docx") { // keep width of fixed size cells in the nested table - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // These were 4030 and 4249. assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblGrid/w:gridCol[1]", "w", "3841"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblGrid/w:gridCol[2]", "w", "4049"); @@ -238,7 +238,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131819, "NumberedList.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131959, "NumberedList.docx") { // import tblInd from table style - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // These were 0. assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblInd", "w", "360"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblInd", "w", "360"); @@ -247,14 +247,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131959, "NumberedList.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76597, "fdo76597.docx") { // check XML - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "before", "96"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "after", "120"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeTIF, "fdo77476.docx") { - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='image/tiff']", "PartName", "/word/media/image1.tif"); } @@ -269,7 +269,7 @@ DECLARE_OOXMLEXPORT_TEST(testFDO77117, "fdo77117.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFloatingTable, "fdo77887.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "horzAnchor", "margin"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "leftFromText", "141"); @@ -284,7 +284,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFloatingTable, "fdo77887.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeRight, "tdf90681-1.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:tcPr/w:vMerge", "val", "restart"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:vMerge", "val", "continue"); @@ -294,7 +294,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeRight, "tdf90681-1.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeleft, "tdf90681-2.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:vMerge", "val", "restart"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:vMerge", "val", "continue"); @@ -312,7 +312,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testHyperlinkContainingPlaceholderField, "hy DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTablePreferredWidth, "tablePreferredWidth.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Problem :If the table preferred width is in percent, then after RT it changes to 0 & width type changes // to 'auto' instead of 'pct'. @@ -322,7 +322,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTablePreferredWidth, "tablePreferredWidt DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO75431, "fdo75431.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//w:tbl", 2); assertXPath(pXmlDoc, "//w:p/w:pPr/w:sectPr/w:type", "val", "nextPage"); @@ -330,7 +330,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO75431, "fdo75431.docx") DECLARE_OOXMLEXPORT_TEST(testFDO77725, "fdo77725.docx") { - xmlDocPtr pXmlFootnotes = parseExport("word/footnotes.xml"); + xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml"); if (!pXmlFootnotes) return; @@ -353,7 +353,7 @@ DECLARE_OOXMLEXPORT_TEST(testFieldRotation, "field-rotated.fodt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFootnoteSeparator, "footnotesep.fodt") { // footnote separator definitions - taken from default page style - xmlDocPtr pXmlFootnotes = parseExport("word/footnotes.xml"); + xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml"); assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]", "id", "0"); assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]", "type", "separator"); assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]/w:p[1]/w:r[1]/w:separator", 0); @@ -364,19 +364,19 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFootnoteSeparator, "footnotesep.fodt") assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]/w:p[1]/w:r[1]/w:continuationSeparator", 0); assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]/w:p[1]/w:pPr[1]/w:rPr[1]/w:sz", "val", "12"); - xmlDocPtr pXmlSettings = parseExport("word/settings.xml"); + xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); assertXPath(pXmlSettings, "/w:settings[1]/w:footnotePr[1]/w:footnote[1]", "id", "0"); assertXPath(pXmlSettings, "/w:settings[1]/w:footnotePr[1]/w:footnote[2]", "id", "1"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121441, "tdf121441.docx") { - xmlDocPtr pXmlFootnotes = parseExport("word/footnotes.xml"); + xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml"); assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[1]/w:rPr/w:rStyle", 1); assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[2]/w:rPr/w:rStyle", 0); assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[2]/w:rPr/w:rFonts", 0); - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts", "eastAsia", "Symbol"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts", "cs", "Symbol"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts", "ascii", "Symbol"); @@ -388,7 +388,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77812, "fdo77812.docx") /* Additional sectPr was getting inserted and hence Column properties * were getting added into this additional sectPr instead of Default setPr. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Check no additional section break is inserted. assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:sectPr", 0); @@ -401,7 +401,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77812, "fdo77812.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeOLE, "fdo77759.docx") { - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']", @@ -409,13 +409,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeOLE, "fdo77759.docx") "/word/embeddings/oleObject1.xlsx"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsx']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); // check the content too - xmlDocPtr pXmlDocContent = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID", @@ -424,12 +424,12 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeOLE, "fdo77759.docx") DECLARE_OOXMLEXPORT_TEST(testfdo78420, "fdo78420.docx") { - xmlDocPtr pXmlHeader = parseExport("word/header2.xml"); + xmlDocUniquePtr pXmlHeader = parseExport("word/header2.xml"); if (!pXmlHeader) return; - xmlDocPtr pXmlHeaderRels = parseExport("word/_rels/header2.xml.rels"); + xmlDocUniquePtr pXmlHeaderRels = parseExport("word/_rels/header2.xml.rels"); if(!pXmlHeaderRels) return; @@ -442,14 +442,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageBreakInFirstPara,"fdo77727.docx") /* Break to next page was not exported if it is in first paragraph of the section. * Now after fix , LO writes Next Page Break and also preserves <w:br> tag. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br","type","page"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78284, "fdo78284.docx") { - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc,"/ContentType:Types/ContentType:Override[@PartName='/word/media/OOXDiagramDataRels1_0.png']", "ContentType", "image/png"); @@ -457,13 +457,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78284, "fdo78284.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78384,"fdo78384.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts","ascii","Wingdings"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78469, "fdo78469.docx") { - xmlDocPtr pXmlDoc = parseExport("word/header1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); // make sure dataBinding & text tags not present in sdtcontent assertXPath(pXmlDoc, "/w:hdr[1]/w:tbl[1]/w:tr[1]/w:tc[2]/w:p[1]/w:sdt[2]/w:sdtPr[1]/w:dataBinding[1]",0); assertXPath(pXmlDoc, "/w:hdr[1]/w:tbl[1]/w:tr[1]/w:tc[2]/w:p[1]/w:sdt[2]/w:sdtPr[1]/w:text[1]",0); @@ -471,7 +471,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78469, "fdo78469.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78887, "fdo78887.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:br[1]", 1); assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:t[1]", "Lyrics: "); @@ -480,7 +480,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78887, "fdo78887.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78887b, "missing_newline.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[2]/w:br[1]", 1); assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:t[1]", "Tab and line break"); @@ -490,14 +490,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78887b, "missing_newline.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo78651, "fdo78651.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // ensure that there are only two tables assertXPath(pXmlDoc, "//w:tbl", 2); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78882, "fdo78882.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Ensure that Section Break is getting written inside second paragraph assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[2]/w:pPr[1]/w:sectPr[1]",1); @@ -512,7 +512,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo76934, "fdo76934.docx") * preserve it. */ - xmlDocPtr pXmlDoc = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); // Ensure that after fix LO is preserving AutoSpacing property in styles.xml assertXPath ( pXmlDoc, "/w:styles[1]/w:style[@w:styleId='Title']/w:pPr[1]/w:spacing[1]", "beforeAutospacing", "1" ); @@ -525,7 +525,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79540, "fdo79540.docx") * MS Office does not allow nesting of drawing tags. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Ensure that two separate w:drawing tags are written and they are not nested. assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing", 1); @@ -534,12 +534,12 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79540, "fdo79540.docx") DECLARE_OOXMLEXPORT_TEST(testFDO79062, "fdo79062.docx") { - xmlDocPtr pXmlFootNotes = parseExport("word/footnotes.xml"); + xmlDocUniquePtr pXmlFootNotes = parseExport("word/footnotes.xml"); if (!pXmlFootNotes) return; assertXPath(pXmlFootNotes, "/w:footnotes", "Ignorable", "w14 wp14"); - xmlDocPtr pXmlEndNotes = parseExport("word/endnotes.xml"); + xmlDocUniquePtr pXmlEndNotes = parseExport("word/endnotes.xml"); if (!pXmlEndNotes) return; assertXPath(pXmlEndNotes, "/w:endnotes", "Ignorable", "w14 wp14"); @@ -581,7 +581,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79668,"fdo79668.docx") { // fdo#79668: Document was Crashing on DebugUtil build while Saving // because of repeated attribute value in same element. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // w:pPr's w:shd attributes were getting added to w:pPrChange/w:pPr's w:shd hence checking // w:fill for both shd elements assertXPath ( pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:shd", "fill", "FFFFFF" ); @@ -590,10 +590,10 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79668,"fdo79668.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78907,"fdo78907.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", "page" ); - xmlDocPtr pXmlDoc1 = parseExport("word/footer1.xml"); + xmlDocUniquePtr pXmlDoc1 = parseExport("word/footer1.xml"); if (!pXmlDoc1) return; assertXPath ( pXmlDoc1, "/w:ftr[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl", 0 ); @@ -601,7 +601,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78907,"fdo78907.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(tdf118702,"tdf118702.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:type", "val", "nextPage" ); assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:pgSz", "orient", "landscape" ); } @@ -616,14 +616,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79822, "fdo79822.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO79915, "fdo79915.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[10]/w:t", "How much buoyancy does the water provide?"); } DECLARE_OOXMLEXPORT_TEST(testfdo79817, "fdo79817.docx") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "storeItemID", "{9222E47B-A68B-4AEB-9855-21C912B9D3D2}"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns0:properties[1]/documentManagement[1]/ns2:Responsible_x0020_Officer_x0020_Title[1]"); @@ -634,7 +634,7 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79817, "fdo79817.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79968_sldx, "fdo79968.docx") { // This UT for DOCX embedded with powerpoint slide - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.presentationml.slide']", @@ -642,13 +642,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79968_sldx, "fdo79968.docx") "/word/embeddings/oleObject1.sldx"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.sldx']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); // check the content too - xmlDocPtr pXmlDocContent = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID", @@ -658,7 +658,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79968_sldx, "fdo79968.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79969_xlsb, "fdo79969_xlsb.docx") { // This UT for DOCX embedded with binary excel work sheet. - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-excel.sheet.binary.macroEnabled.12']", @@ -666,13 +666,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79969_xlsb, "fdo79969_xlsb.docx") "/word/embeddings/oleObject1.xlsb"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsb']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); // check the content too - xmlDocPtr pXmlDocContent = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID", @@ -683,7 +683,7 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80097, "fdo80097.docx") { //fdo#76635 : Table borders are not getting preserved. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -706,7 +706,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf95033, "tdf95033.docx") { //tdf#95033 : Table borders defined by row-level tblPrEx are not getting preserved. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -722,7 +722,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf95033, "tdf95033.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128646, "tdf128646.docx") { // The problem was that not hidden shapes anchored to empty hidden paragraphs were imported as hidden. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc,"/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:pPr/w:rPr/w:vanish", 1); if (!mbExported) @@ -737,7 +737,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf119800, "tdf119800.docx") { // 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) - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc,"/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:vanish", 1); if (!mbExported) @@ -751,7 +751,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf119800, "tdf119800.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo77129, "fdo77129.docx") { // The problem was that text after TOC field was missing if footer reference comes in field. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Data was lost from this paragraph. assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:t", "Abstract"); @@ -787,7 +787,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf129402, "fdo77129.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79969_xlsm, "fdo79969_xlsm.docx") { // This UT for DOCX embedded with excel work sheet. - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-excel.sheet.macroEnabled.12']", @@ -795,13 +795,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79969_xlsm, "fdo79969_xlsm.docx") "/word/embeddings/oleObject1.xlsm"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsm']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); // check the content too - xmlDocPtr pXmlDocContent = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID", @@ -810,7 +810,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79969_xlsm, "fdo79969_xlsm.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80522,"fdo80522.docx") { - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-word.document.macroEnabled.12']", @@ -818,13 +818,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80522,"fdo80522.docx") "/word/embeddings/oleObject1.docm"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.docm']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); // check the content too - xmlDocPtr pXmlDocContent = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID", @@ -833,7 +833,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80522,"fdo80522.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80523_pptm,"fdo80523_pptm.docx") { - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-powerpoint.presentation.macroEnabled.12']", @@ -841,13 +841,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80523_pptm,"fdo80523_pptm.docx") "/word/embeddings/oleObject1.pptm"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.pptm']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); // check the content too - xmlDocPtr pXmlDocContent = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID", @@ -856,7 +856,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80523_pptm,"fdo80523_pptm.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80523_sldm,"fdo80523_sldm.docx") { - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.ms-powerpoint.slide.macroEnabled.12']", @@ -864,13 +864,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80523_sldm,"fdo80523_sldm.docx") "/word/embeddings/oleObject1.sldm"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.sldm']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); // check the content too - xmlDocPtr pXmlDocContent = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID", @@ -880,7 +880,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80523_sldm,"fdo80523_sldm.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80898, "fdo80898.docx") { // This UT for DOCX embedded with binary excel work sheet. - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='application/msword']", @@ -888,13 +888,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80898, "fdo80898.docx") "/word/embeddings/oleObject1.doc"); // check the rels too - xmlDocPtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.doc']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"); // check the content too - xmlDocPtr pXmlDocContent = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID", @@ -905,7 +905,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableCellWithDirectFormatting, "fdo80800 { // Issue was Direct Formatting for non-first Table cells was not getting preserved. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Ensure that for Third Table cell Direct Formatting is preserved. // In file, Direct Formatting used for Third Table cell is Line Spacing="1.5 lines" @@ -981,7 +981,7 @@ DECLARE_OOXMLEXPORT_TEST(test2colHeader, "2col-header.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo83048, "fdo83048.docx") { // Issue was wrong SDT properties were getting exported for Date SDT - xmlDocPtr pXmlDoc = parseExport("word/footer1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/footer1.xml"); // Make sure Date is inside SDT tag. // This will happen only if right SDT properties are exported. @@ -991,7 +991,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo83048, "fdo83048.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdt2Run, "sdt-2-run.docx") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // 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[1]/w:t", "first"); @@ -1002,7 +1002,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdt2Run, "sdt-2-run.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFD083057, "fdo83057.docx") { - xmlDocPtr pXmlDoc = parseExport("word/header1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); // A fly frame was attached to a para which started with a hint (run) containing an SDT. // This SDT was handled while exporting the FLYFRAME and also the text of the run. @@ -1016,7 +1016,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFD083057, "fdo83057.docx") DECLARE_OOXMLEXPORT_TEST(testHeaderBorder, "header-border.docx") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { // This was 0, as header margin was lost during import. assertXPath(pXmlDoc, "//w:pgMar", "header", "720"); @@ -1043,20 +1043,20 @@ DECLARE_OOXMLEXPORT_TEST(testImageNoborder, "image-noborder.docx") DECLARE_OOXMLEXPORT_TEST(testTdf89774, "tdf89774.fodt") { - if (xmlDocPtr pXmlDoc = parseExport("docProps/app.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("docProps/app.xml")) // This was 65, as unit was seconds instead of minutes. assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:TotalTime", "1"); } DECLARE_OOXMLEXPORT_TEST(testSectionProtection, "sectionprot.odt") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr/w:formProt", "val", "true"); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:formProt", "val", "false"); } - if (xmlDocPtr pXmlSettings = parseExport("word/settings.xml")) + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) { assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "true"); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "forms"); @@ -1072,7 +1072,7 @@ DECLARE_OOXMLEXPORT_TEST(testSectionProtection, "sectionprot.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSectionProtection2, "sectionprot2.odt") { - if (xmlDocPtr pXmlSettings = parseExport("word/settings.xml")) + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) { assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "true"); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "forms"); @@ -1087,7 +1087,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSectionProtection2, "sectionprot2.odt") DECLARE_OOXMLEXPORT_TEST(tdf66398_permissions, "tdf66398_permissions.docx") { // check document permission settings for the whole document - if (xmlDocPtr pXmlSettings = parseExport("word/settings.xml")) + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) { assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "readOnly"); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "1"); @@ -1114,7 +1114,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf66398_permissions, "tdf66398_permissions.docx") DECLARE_OOXMLEXPORT_TEST(tdf106843, "tdf106843.fodt") { // check Track Changes permission set in Writer/OpenDocument (password: "test", encoded by default encoding of Writer) - if (xmlDocPtr pXmlSettings = parseExport("word/settings.xml")) + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) { assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "trackedChanges"); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "1"); @@ -1130,7 +1130,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf106843, "tdf106843.fodt") DECLARE_OOXMLEXPORT_TEST(tdf89991_revisionView, "tdf89991.docx") { // check revisionView (Show Changes) import and export - if (xmlDocPtr pXmlSettings = parseExport("word/settings.xml")) + if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) { assertXPath(pXmlSettings, "/w:settings/w:revisionView", "insDel", "0"); assertXPath(pXmlSettings, "/w:settings/w:revisionView", "formatting", "0"); @@ -1167,7 +1167,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf122201_editUnprotectedText, "tdf122201_editUnprotect DECLARE_OOXMLEXPORT_TEST(testSectionHeader, "sectionprot.odt") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { // this test must not be zero assertXPath(pXmlDoc, "//w:headerReference", 2); @@ -1176,13 +1176,13 @@ DECLARE_OOXMLEXPORT_TEST(testSectionHeader, "sectionprot.odt") DECLARE_OOXMLEXPORT_TEST(testOO47778_1, "ooo47778-3.odt") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPathContent(pXmlDoc, "(//w:t)[3]", "c"); } DECLARE_OOXMLEXPORT_TEST(testOO47778_2, "ooo47778-4.odt") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPathContent(pXmlDoc, "(//w:t)[4]", "c"); // tdf116436: The problem was that the table background was undefined, not white. @@ -1195,25 +1195,25 @@ DECLARE_OOXMLEXPORT_TEST(testOO47778_2, "ooo47778-4.odt") DECLARE_OOXMLEXPORT_TEST(testOO67471, "ooo67471-2.odt") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPathContent(pXmlDoc, "(//w:t)[2]", "B"); } DECLARE_OOXMLEXPORT_TEST(testKDE302504, "kde302504-1.odt") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPath(pXmlDoc, "//v:shape", "ID", "KoPathShape"); } DECLARE_OOXMLEXPORT_TEST(testKDE216114, "kde216114-1.odt") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPath(pXmlDoc, "//w:pict", 1); } DECLARE_OOXMLEXPORT_TEST(testOO72950, "ooo72950-1.odt") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPath(pXmlDoc, "//w:tbl", 1); } @@ -1222,7 +1222,7 @@ DECLARE_OOXMLEXPORT_TEST(testOO72950, "ooo72950-1.odt") //considered the same table DECLARE_OOXMLEXPORT_TEST(fdo60957, "fdo60957-2.docx") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPath(pXmlDoc, "//w:tbl", 2); } @@ -1230,7 +1230,7 @@ DECLARE_OOXMLEXPORT_TEST(fdo60957, "fdo60957-2.docx") //number of cell start and ends DECLARE_OOXMLEXPORT_TEST(testOO106020, "ooo106020-1.odt") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPath(pXmlDoc, "//w:tbl", 1); } @@ -1247,7 +1247,7 @@ DECLARE_OOXMLEXPORT_TEST(testSpacingGroupShapeText, "tdf131775_SpacingGroupShape { // tdf#131775: Check if correct spacing. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx index e262303d1dee..4bfa75ed28eb 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx @@ -49,14 +49,14 @@ DECLARE_OOXMLEXPORT_TEST(testDmlShapeTitle, "dml-shape-title.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDmlZorder, "dml-zorder.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This was "0": causing that in Word, the second shape was on top, while in the original odt the first shape is on top. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor", "relativeHeight", "2"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDmlShapeRelsize, "dml-shape-relsize.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Relative size wasn't exported all, then relativeFrom was "page", not "margin". assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH", "relativeFrom", "margin"); } @@ -74,7 +74,7 @@ DECLARE_OOXMLEXPORT_TEST(testDmlPictureInTextframe, "dml-picture-in-textframe.do DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDmlGroupshapeRelsize, "dml-groupshape-relsize.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Relative size wasn't imported. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH", "relativeFrom", "margin"); } @@ -89,7 +89,7 @@ DECLARE_OOXMLEXPORT_TEST(testDmlTextshape, "dml-textshape.docx") // This was drawing::LineStyle_NONE. CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, getProperty<drawing::LineStyle>(xShape, "LineStyle")); - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; // This was wrap="none". @@ -110,7 +110,7 @@ DECLARE_OOXMLEXPORT_TEST(testDmlTextshape, "dml-textshape.docx") DECLARE_OOXMLEXPORT_TEST(testDmlTextshapeB, "dml-textshapeB.docx") { uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -349,7 +349,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDMLGradientFillTheme, "dml-gradientfill- // not just the theme was written out but the explicit values too // Besides the duplication of values it causes problems with writing out // <a:schemeClr val="phClr"> into document.xml, while phClr can be used just for theme definitions. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // check no explicit gradFill has been exported assertXPath(pXmlDoc, @@ -438,27 +438,27 @@ DECLARE_OOXMLEXPORT_TEST(testTableFloatingMargins, "table-floating-margins.docx" if (!mbExported) return; // Paragraph bottom margin wasn't 0 in the A1 cell of the floating table. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127814, "tdf127814.docx") { // Paragraph top margin was 0 in a table started on a new page - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "before", "0"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128752, "tdf128752.docx") { // Paragraph bottom margin was 200, docDefault instead of table style setting - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "after", "0"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf119054, "tdf119054.docx") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // 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"); @@ -469,14 +469,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf119054, "tdf119054.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131258, "tdf131258.docx") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // 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"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132514, "tdf132514.docx") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // 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"); @@ -489,7 +489,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo69636, "fdo69636.docx") * importer, regarding the btLr text frame direction: the * mso-layout-flow-alt property was completely missing in the output. */ - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // 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 @@ -500,7 +500,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testVMLData, "TestVMLData.docx") { // The problem was exporter was exporting vml data for shape in w:rPr element. // vml data should not come under w:rPr element. - xmlDocPtr pXmlDoc = parseExport("word/header2.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml"); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape", "stroked").match("f")); } @@ -508,7 +508,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testImageData, "image_data.docx") { // The problem was exporter was exporting v:imagedata data for shape in w:pict as v:fill w element. - xmlDocPtr pXmlDoc = parseExport("word/header2.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml"); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape/v:imagedata", "detectmouseclick").match("t")); } @@ -517,7 +517,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70838, "fdo70838.docx") // The problem was that VMLExport::Commit didn't save the correct width and height, // and ImplEESdrWriter::ImplFlipBoundingBox made a mistake calculating the position - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -640,7 +640,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70838, "fdo70838.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73215, "fdo73215.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 'rect' was 'pictureFrame', which isn't valid. assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:prstGeom", "prst", "rect"); @@ -651,7 +651,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73215, "fdo73215.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBehinddoc, "behinddoc.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This was "0", shape was in the foreground. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor", "behindDoc", "1"); } @@ -665,7 +665,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSmartArtAnchoredInline, "fdo73227.docx") * all 3 DrawingML objects in a document. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[1]/wp:anchor/wp:docPr","id","1"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[1]/wp:anchor/wp:docPr","name","Diagram1"); @@ -679,13 +679,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSmartArtAnchoredInline, "fdo73227.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo65833, "fdo65833.docx") { // The "editas" attribute for vml group shape was not preserved. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:group", "editas", "canvas"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73247, "fdo73247.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm", "rot", "1969200"); @@ -693,7 +693,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73247, "fdo73247.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo70942, "fdo70942.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom", "prst", "ellipse"); } @@ -701,7 +701,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo70942, "fdo70942.docx") DECLARE_OOXMLEXPORT_TEST(testDrawinglayerPicPos, "drawinglayer-pic-pos.docx") { // The problem was that the position of the picture was incorrect, it was shifted towards the bottom right corner. - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -714,7 +714,7 @@ DECLARE_OOXMLEXPORT_TEST(testDrawinglayerPicPos, "drawinglayer-pic-pos.docx") DECLARE_OOXMLEXPORT_TEST(testShapeThemePreservation, "shape-theme-preservation.docx") { - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -825,13 +825,13 @@ DECLARE_OOXMLEXPORT_TEST(testShapeThemePreservation, "shape-theme-preservation.d DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO73546, "FDO73546.docx") { - xmlDocPtr pXmlDoc = parseExport("word/header1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); assertXPath(pXmlDoc, "/w:hdr/w:p[1]/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor", "distL","0"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo69616, "fdo69616.docx") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // VML CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[1]/mc:AlternateContent/mc:Fallback/w:pict/v:group", "coordorigin").match("696,725")); } @@ -840,7 +840,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAlignForShape,"Shape.docx") { //fdo73545:Shape Horizontal and vertical orientation is wrong //The wp:align tag is missing after roundtrip - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/" "wp:anchor/wp:positionH/wp:align"); } @@ -850,7 +850,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLineStyle_DashType, "LineStyle_DashType. /* DOCX contatining Shape with LineStyle as Dash Type should get preserved inside * an XML tag <a:prstDash> with value "dash", "sysDot", "lgDot", etc. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[7]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "lgDashDotDot"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[6]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "lgDashDot"); @@ -863,7 +863,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLineStyle_DashType, "LineStyle_DashType. DECLARE_OOXMLEXPORT_TEST(testGradientFillPreservation, "gradient-fill-preservation.docx") { - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; @@ -905,7 +905,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLineStyle_DashType_VML, "LineStyle_DashT /* DOCX contatining "Shape with text inside" having Line Style as "Dash Type" should get * preserved inside an XML tag <v:stroke> with attribute dashstyle having value "dash". */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:stroke", "dashstyle", "dash"); } @@ -917,7 +917,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo74110,"fdo74110.docx") The actual shape type(s) has/have adjustment value(s) where as rect does not have adjustment value. Hence the following test case. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]", "prst", "rect"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]/a:avLst[1]/a:gd[1]",0); @@ -925,13 +925,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo74110,"fdo74110.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOuterShdw,"testOuterShdw.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:effectLst[1]/a:outerShdw[1]", "dist", "1041400"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testExtentValue, "fdo74605.docx") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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); @@ -945,7 +945,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testExtentValue, "fdo74605.docx") // other dimension. DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSyncedRelativePercent, "tdf93676-1.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // check no explicit pctHeight has been exported, all we care // about at this point is that it's not 255000 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx index 5de79ca5ddfa..e52e250046a4 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -41,7 +41,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST( testChildNodesOfCubicBezierTo, "FDO74774.do The test case ensures that there are 3 child nodes of type "pt" for cubicBexTo */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath( pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent[1]/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wpg:wgp[1]/wps:wsp[3]/wps:spPr[1]/a:custGeom[1]/a:pathLst[1]/a:path[1]/a:cubicBezTo[2]/a:pt[3]"); @@ -50,7 +50,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST( testChildNodesOfCubicBezierTo, "FDO74774.do DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testMSwordHang,"test_msword_hang.docx") { // fdo#74771: - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r[2]/w:drawing/wp:inline", "distT", "0"); } @@ -66,7 +66,7 @@ DECLARE_OOXMLEXPORT_TEST(testGroupshapeThemeFont, "groupshape-theme-font.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAnchorIdForWP14AndW14, "AnchorId.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing/wp:inline", "anchorId", "78735EFD"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "anchorId", "78735EFD"); @@ -88,7 +88,7 @@ DECLARE_OOXMLEXPORT_TEST(testTextWatermark, "textWatermark.docx") //The problem was that the watermark ID was not preserved, //and Word uses the object ID to identify if it is a watermark. //It has to have the 'PowerPlusWaterMarkObject' string in it - xmlDocPtr pXmlHeader1 = parseExport("word/header1.xml"); + xmlDocUniquePtr pXmlHeader1 = parseExport("word/header1.xml"); if (!pXmlHeader1) return; @@ -105,7 +105,7 @@ DECLARE_OOXMLEXPORT_TEST(testPictureWatermark, "pictureWatermark.docx") //and Word uses the object ID to identify if it is a watermark. //It has to have the 'WordPictureWaterMarkObject' string in it - xmlDocPtr pXmlHeader1 = parseExport("word/header1.xml"); + xmlDocUniquePtr pXmlHeader1 = parseExport("word/header1.xml"); if (!pXmlHeader1) return; @@ -122,21 +122,21 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76249, "fdo76249.docx") * as a Locked Canvas inside a text-box for the RT file to work in MS Word, as drawing elements * are not allowed inside the textboxes. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/lc:lockedCanvas[1]",1); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76979, "fdo76979.docx") { // The problem was that black was exported as "auto" fill color, resulting in well-formed, but invalid XML. - xmlDocPtr pXmlDoc = parseExport("word/header2.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml"); // This was "auto", not "FFFFFF". assertXPath(pXmlDoc, "//wps:spPr/a:solidFill/a:srgbClr", "val", "FFFFFF"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf104539, "tdf104539.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/" "wp:inline/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", "dir", "13500000"); @@ -144,7 +144,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf104539, "tdf104539.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShapeEffectPreservation, "shape-effect-preservation.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // first shape with outer shadow, rgb color assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" @@ -275,7 +275,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShapeEffectPreservation, "shape-effect-p DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShape3DEffectPreservation, "shape-3d-effect-preservation.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // first shape: extrusion and shift on z, rotated camera with zoom, rotated light rig assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" @@ -384,7 +384,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShape3DEffectPreservation, "shape-3d-eff DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureEffectPreservation, "picture-effects-preservation.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:scene3d/a:camera", @@ -424,8 +424,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureEffectPreservation, "picture-effe DECLARE_OOXMLEXPORT_TEST(testPictureArtisticEffectPreservation, "picture-artistic-effects-preservation.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - xmlDocPtr pRelsDoc = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pRelsDoc = parseExport("word/_rels/document.xml.rels"); if (!pXmlDoc || !pRelsDoc) return; @@ -523,13 +523,13 @@ DECLARE_OOXMLEXPORT_TEST(testPictureArtisticEffectPreservation, "picture-artisti DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(fdo77719, "fdo77719.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:custGeom[1]", 1); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNestedAlternateContent, "nestedAlternateContent.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // We check alternateContent could not contains alternateContent (i.e. nested alternateContent) assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wpg:wgp[1]/wps:wsp[2]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]",0); } @@ -540,7 +540,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNestedAlternateContent, "nestedAlternate DECLARE_OOXMLEXPORT_TEST(test76317, "test76317.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); if (!pXmlDoc) return; assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]", "prst", "hexagon"); } @@ -549,19 +549,19 @@ DECLARE_OOXMLEXPORT_TEST(test76317, "test76317.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(fdo76591, "fdo76591.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]", "relativeHeight", "3"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test76317_2K10, "test76317_2K10.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]/a:avLst[1]/a:gd[1]", "name", "adj"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77122, "LinkedTextBoxes.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); //ensure that the text box links are preserved. assertXPath(pXmlDoc, "//wps:txbx[1]", "id", "1"); assertXPath(pXmlDoc, "//wps:linkedTxbx[1]", "id", "1"); @@ -569,13 +569,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77122, "LinkedTextBoxes.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test76734_2K7, "test76734_2K7.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]", "Requires", "wps"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test77219, "test77219.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[6]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]", "behindDoc", "1"); } @@ -613,7 +613,7 @@ DECLARE_OOXMLEXPORT_TEST(testPresetShape, "preset-shape.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76101, "fdo76101.docx") { - xmlDocPtr pXmlDoc = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/w:styles/w:style"); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; CPPUNIT_ASSERT(4091 >= xmlXPathNodeSetGetLength(pXmlNodes)); @@ -622,33 +622,33 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76101, "fdo76101.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtAndShapeOverlapping,"ShapeOverlappingWithSdt.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/mc:AlternateContent"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent[1]/w:r[1]/w:t[1]"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLockedCanvas, "fdo78658.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Checking for lockedCanvas tag assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/lc:lockedCanvas", 1); } DECLARE_OOXMLEXPORT_TEST(fdo78474, "fdo78474.docx") { - xmlDocPtr pXmlDoc1 = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc1 = parseExport("word/document.xml"); if (!pXmlDoc1) return; //docx file after RT is getting corrupted. assertXPath(pXmlDoc1, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]", "embed", "rId2"); - xmlDocPtr pXmlDoc2 = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDoc2 = parseExport("word/_rels/document.xml.rels"); if (!pXmlDoc2) return; assertXPath(pXmlDoc2,"/rels:Relationships/rels:Relationship[2]","Id","rId2"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAbsolutePositionOffsetValue,"fdo78432.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); xmlXPathObjectPtr pXmlObjs[6]; pXmlObjs[0] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionH[1]/wp:posOffset[1]"); @@ -677,7 +677,7 @@ DECLARE_OOXMLEXPORT_TEST(testRubyHyperlink, "rubyhyperlink.fodt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78300,"fdo78300.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:r[1]/w:drawing[1]", 0); @@ -694,7 +694,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testWordArtWithinDraingtool, "testWordArtWit * Expected : as there is nesting of a 2007 Word Art within a drawing tool, then can be separated in two different runs. * */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + 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:txbx/w:txbxContent",1); assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:r/w:pict/v:shape",1); // Make sure that the shape inside a shape is exported as VML-only, no embedded mc:AlternateContent before w:pict. @@ -714,7 +714,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78663, "fdo78663.docx") * We shouldn't repeat it again in <shapetype><shape> <textbox><txbxContent> * */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + 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:txbx/w:txbxContent/w:p/w:r/w:pict/v:shape/v:path",1); assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:r/w:pict/v:shape/v:path",1); // Make sure that the shape inside a shape is exported as VML-only, no embedded mc:AlternateContent before w:pict. @@ -723,7 +723,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78663, "fdo78663.docx") DECLARE_OOXMLEXPORT_TEST(testFdo78957, "fdo78957.docx") { - xmlDocPtr pXmlHeader = parseExport("word/header2.xml"); + xmlDocUniquePtr pXmlHeader = parseExport("word/header2.xml"); if(!pXmlHeader) return; @@ -742,7 +742,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79256, "fdo79256.docx") /* corruption issue also solved by fixing tdf#108064: * since that LO keeps MSO preset dash styles during OOXML export */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln/a:prstDash", "val", "lgDash"); } @@ -753,7 +753,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDashedLine_CustDash1000thOfPercent, "das * This test-file has a CUSTOM dash-line that is defined as '1000th of a percent'. * This should be imported by LO as-is, and exported back with the same values. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]", "d" , "800000"); assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]", "sp", "300000"); @@ -772,7 +772,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDashedLine_CustDashPercentage, "dashed_l * This should be imported by LO as '1000th of a percent', and exported back * as '1000th of a percent'. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]", "d" , "800000"); assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]", "sp", "300000"); @@ -786,7 +786,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDashedLine_CustDashPercentage, "dashed_l DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCommentInitials, "comment_initials.odt") { - xmlDocPtr pXmlDoc = parseExport("word/comments.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/comments.xml"); assertXPath(pXmlDoc,"/w:comments/w:comment[1]", "initials", "initials"); } @@ -813,7 +813,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79591, "fdo79591.docx") * and hence was showing RT document as corrupt with error * message "invalid character" */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr", "name", ""); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape", "ID", ""); @@ -827,7 +827,7 @@ DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo80894, "TextFrameRotation.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Rotation value was not roundtripped for textframe. assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm", @@ -846,7 +846,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80895, "fdo80895.docx") // resultant shape was with <a:noFill/> prop in <wps:spPr> hence was not visible. // Checking there is a shape in header without <a:noFill/> element. - xmlDocPtr pXmlDoc = parseExport("word/header1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:noFill",0); assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:noFill",0); @@ -858,7 +858,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80895, "fdo80895.docx") DECLARE_OOXMLEXPORT_TEST(testWrapTightThrough, "wrap-tight-through.docx") { // These were wrapSquare without a wrap polygon before. - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { // The first shape should be wrapThrough with a wrap polygon (was wrapSquare). assertXPath(pXmlDoc, "//w:drawing/wp:anchor[1]/wp:wrapThrough/wp:wrapPolygon/wp:start", "x", "-1104"); @@ -881,21 +881,21 @@ DECLARE_OOXMLEXPORT_TEST(testPictureWrapPolygon, "picture-wrap-polygon.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeGrayscale, "picture_colormode_grayscale.docx") { // The problem was that the grayscale was not exported - xmlDocPtr pXmlDoc = parseExport ("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport ("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:grayscl", 1); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeBlackWhite, "picture_colormode_black_white.odt") { - xmlDocPtr pXmlDoc = parseExport ("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport ("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:biLevel", "thresh", "50000"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeWatermark, "picture_colormode_watermark.odt") { - xmlDocPtr pXmlDoc = parseExport ("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport ("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:lum", "bright", "70000"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:lum", "contrast", "-70000"); } @@ -904,7 +904,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeWatermark, "picture_colo DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testExportShadow, "bnc637947.odt") { // The problem was that shadows of shapes from non-OOXML origin were not exported to DrawingML - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + 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/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw", "dist" , "109865"); assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw", "dir" , "634411"); @@ -914,7 +914,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testExportShadow, "bnc637947.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testExportAdjustmentValue, "tdf91429.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd", "fmla", "val 50000"); } @@ -1011,7 +1011,7 @@ DECLARE_OOXMLEXPORT_TEST(testTDF87348, "tdf87348_linkedTextboxes.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTDF93675, "no-numlevel-but-indented.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//w:ind", "start", "1418"); } @@ -1019,7 +1019,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTDF93675, "no-numlevel-but-indented.odt" DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFlipAndRotateCustomShape, "flip_and_rotate.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // there should be no flipH and flipV attributes in this case assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "flipH"); assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "flipV"); @@ -1043,7 +1043,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFlipAndRotateCustomShape, "flip_and_rota DECLARE_OOXMLEXPORT_TEST(testTdf92335, "tdf92335.docx") { // Don't export redundant ListLabel character styles - xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); if (!pXmlStyles) return; diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 1baabd612269..4227765975de 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -73,7 +73,7 @@ DECLARE_OOXMLEXPORT_TEST(testDocm, "hello.docm") // Make sure that we check the name of the export filter. // This was application/vnd.ms-word.document.macroEnabled.main+xml when the // name of the import filter was checked. - if (xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml")) assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']", "ContentType", @@ -82,7 +82,7 @@ DECLARE_OOXMLEXPORT_TEST(testDocm, "hello.docm") DECLARE_OOXMLEXPORT_TEST(testDefaultContentTypes, "fdo55381.docx") { - if (xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml")) { assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Default[@Extension='xml']", @@ -111,7 +111,7 @@ DECLARE_SW_ROUNDTRIP_TEST(testDocmSave, "hello.docm", nullptr, DocmTest) // This was // application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml, // we used the wrong content type for .docm files. - if (xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml")) assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']", "ContentType", @@ -257,7 +257,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf129575_docDefault, "tdf129575-docDefault.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf118812, "tdf118812_tableStyles-comprehensive.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // cell A1 assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:pStyle", "val", "Normal"); assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing", "lineRule"); @@ -333,7 +333,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf118812, "tdf118812_tableStyles-compre DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf107626, "tdf107626.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This was 2 (missing trailing cell in merged cell range) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc", 3); } @@ -353,7 +353,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf79272_strictDxa, "tdf79272_strictDxa.docx") uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(4318), getProperty<sal_Int32>(xTables->getByIndex(0), "Width")); - xmlDocPtr pXmlDoc = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); if (!pXmlDoc) return; // Validation test: order of elements was wrong. Order was: insideH, end, insideV. @@ -664,7 +664,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112352_nextPageColumns, "tdf112352_nextPageColum DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf109310_endnoteStyleForMSO, "tdf109310_endnoteStyleForMSO.docx") { - xmlDocPtr pXmlDoc = parseExport("word/endnotes.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/endnotes.xml"); // Check w:rStyle element has w:val attribute - note that w: is not specified for attribute assertXPath(pXmlDoc, "/w:endnotes/w:endnote[@w:id='2']/w:p/w:r[1]/w:rPr/w:rStyle", "val", "EndnoteCharacters"); @@ -672,7 +672,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf109310_endnoteStyleForMSO, "tdf109310 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103389, "tdf103389.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // No geometry was exported for the second canvas // Check both canvases' geometry assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp/wps:spPr/a:prstGeom", "prst", "rect"); @@ -762,7 +762,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf79329, "tdf79329.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103982, "tdf103982.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); sal_Int32 nDistB = getXPath(pXmlDoc, "//wp:anchor", "distB").toInt32(); // This was -260350, which is not a valid value for an unsigned type. CPPUNIT_ASSERT(nDistB >= 0); @@ -774,7 +774,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103982, "tdf103982.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf104115, "tdf104115.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This found 0 nodes: the custom geometry was not written for the Bezier // curve -> Word refused to open the document. assertXPath(pXmlDoc, "//a:custGeom", 1); @@ -798,7 +798,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf99227, "tdf99227.docx") // After that, importing after export failed with // SAXParseException: '[word/document.xml line 2]: Extra content at the end of the document', Stream 'word / document.xml', // and before commit ebf767eeb2a169ba533e1b2ffccf16f41d95df35, the drawing was silently lost. - xmlDocPtr pXmlDoc = parseExport("word/footnotes.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/footnotes.xml"); assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1); } @@ -813,7 +813,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf37153, "tdf37153_considerWrapOnObjPos.docx") CPPUNIT_ASSERT_EQUAL(text::VertOrientation::BOTTOM, getProperty<sal_Int16>(xTable->getCellByName("A1"), "VertOrient")); //For MSO compatibility, the textbox should be at the top of the cell, not at the bottom - despite VertOrientation::BOTTOM - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nFlyTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt/anchored/fly/infos/bounds", "top").toInt32(); CPPUNIT_ASSERT_MESSAGE("FlyTop should be 2865, not 5649", nFlyTop < sal_Int32(3000)); sal_Int32 nTextTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt[1]/infos/bounds", "top").toInt32(); @@ -970,7 +970,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf106001_2, "tdf106001-2.odt") { // In test ODT CharScaleWidth = 900, this was not changed upon OOXML export to stay in [1..600], now it's clamped to 600 // Note: we disregard what's set in pPr / rPr and only care about r / rPr - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:w","val","600"); } @@ -1043,7 +1043,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121670_columnsInSectionsOnly, "tdf121670_columns DECLARE_OOXMLEXPORT_TEST(testTdf106492, "tdf106492.docx") { - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) // This was 4: an additional sectPr was added to the document. assertXPath(pXmlDoc, "//w:sectPr", 3); } @@ -1083,7 +1083,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf107837, "tdf107837.odt") DECLARE_OOXMLEXPORT_TEST(testTdf107684, "tdf107684.odt") { - if (xmlDocPtr pXmlDoc = parseExport("word/styles.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml")) // This was 1, <w:outlineLvl> was duplicated for Heading1. assertXPath(pXmlDoc, "//w:style[@w:styleId='Heading1']/w:pPr/w:outlineLvl", 1); } @@ -1244,7 +1244,7 @@ DECLARE_OOXMLEXPORT_TEST(testActiveXControlAlign, "activex_control_align.odt") CPPUNIT_ASSERT_EQUAL(sal_Int32(-1085), xShape->getPosition().Y); // Also check the specific OOXML elements - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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); @@ -1279,7 +1279,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf109184, "tdf109184.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf111964, "tdf111964.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Unicode spaces that are not XML whitespace must not be trimmed const sal_Unicode sWSReference [] { 0x2002, 0x2002, 0x2002, 0x2002, 0x2002, 0 }; assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:t", sWSReference); @@ -1354,14 +1354,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(tdf112169, "tdf112169.odt") // LO crashed while export because of character background color handling //tdf76683 - Cannot be negative number - use firstLine instead of hanging - xmlDocPtr pXmlDoc = parseExport("word/numbering.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPathNoAttribute(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pPr/w:ind", "hanging"); assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pPr/w:ind", "firstLine","360"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103090, "tdf103090.odt") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Get bookmark name OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:bookmarkStart", "name"); @@ -1379,7 +1379,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103090, "tdf103090.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf107111, "tdf107111.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Ensure that hyperlink and its properties are in place. assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:hyperlink/w:r/w:rPr", 1); @@ -1460,7 +1460,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104354_2, "tdf104354-2.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf115557, "tdf115557.docx") { // A chart anchored to a footnote multiplied during import - xmlDocPtr pXmlDoc = parseExport("word/footnotes.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/footnotes.xml"); assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx index d901af1ed886..a6a5b37af52e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx @@ -26,7 +26,7 @@ protected: DECLARE_OOXMLEXPORT_TEST(testSaveAsDotX, "sample.dotx") { - xmlDocPtr pXmlDocCT = parseExport("[Content_Types].xml"); + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); if (!pXmlDocCT) return; diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index cd5177010af2..8ac7b706d1da 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -61,7 +61,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBnc834035, "bnc834035.odt") { // Illustration index had wrong hyperlinks: anchor was using Writer's // <seqname>!<index>|sequence syntax, not a bookmark name. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // This was Figure!1|sequence. assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:hyperlink", "anchor", "_Toc363553908"); } @@ -76,7 +76,7 @@ DECLARE_OOXMLEXPORT_TEST(testCp1000015, "cp1000015.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testHyperlineIsEnd, "hyperlink.docx") { // Check that the document.xml contents all the tag properly closed. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // If document.xml miss any ending tag then parseExport() returns NULL which fail the test case. CPPUNIT_ASSERT(pXmlDoc) ; // Check hyperlink is properly open. @@ -86,7 +86,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testHyperlineIsEnd, "hyperlink.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo69649, "fdo69649.docx") { // The DOCX containing the Table of Contents was not exported with correct page nos - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[21]/w:hyperlink/w:r[5]/w:t", "15"); } @@ -94,7 +94,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo69649, "fdo69649.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFieldFlagO,"TOC_field_f.docx") { // This test case is to verify \o flag should come once. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed // not to insert an empty paragraph before TOC. @@ -109,7 +109,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTOCFlag_f, "toc_doc.docx") // \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. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // 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,14 +118,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTOCFlag_f, "toc_doc.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPreserveZfield,"preserve_Z_field_TOC.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText", " TOC \\z \\f \\o \"1-3\" \\h"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPreserveWfieldTOC, "PreserveWfieldTOC.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " TOC \\z \\w \\f \\o \"1-3\" \\h"); } @@ -133,7 +133,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPreserveWfieldTOC, "PreserveWfieldTOC.do DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFieldFlagB,"TOC_field_b.docx") { // This test case is to verify \b flag. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); // FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed // not to insert an empty paragraph before TOC. @@ -142,14 +142,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFieldFlagB,"TOC_field_b.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPreserveXfieldTOC, "PreserveXfieldTOC.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " TOC \\x \\f \\o \"1-3\" \\h"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77715,"FDO77715.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText[1]", " TOC \\c "); } @@ -157,7 +157,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77715,"FDO77715.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTOCFlag_u,"testTOCFlag_u.docx") { // DOCX containing TOC should preserve code field '\u'. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + 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. @@ -167,7 +167,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTOCFlag_u,"testTOCFlag_u.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo73596_RunInStyle,"fdo73596_RunInStyle.docx") { // INDEX should be preserved. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText[1]", " INDEX \\e \""); } @@ -175,7 +175,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo73596_RunInStyle,"fdo73596_RunInStyle DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo73596_AlphaSeparator,"fdo73596_AlphaSeparator.docx") { // INDEX flag \h "A" should be preserved. - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText[1]", " INDEX \\h \"A\" \\e \""); } @@ -185,7 +185,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCaption1, "EquationAsScientificNumbering // 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" - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:instrText", " SEQ scientific \\* ROMAN "); } @@ -194,7 +194,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCaption2, "EquationWithAboveAndBelowCapt { // 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. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[3]/w:instrText", " SEQ Equation \\* ARABIC "); } @@ -203,7 +203,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCaption3, "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. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:instrText", " SEQ picture \\* ARABIC "); } @@ -212,7 +212,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCaption4, "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. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:instrText", " SEQ Table \\* ARABIC "); } @@ -223,7 +223,7 @@ DECLARE_OOXMLEXPORT_TEST(testFooterContainHyperlink,"footer-contain-hyperlink.do // Target due to which the file get corrupted // in MS Office 2007. // Check for footer1.xml.rels file. - xmlDocPtr pXmlRels = parseExport("word/_rels/footer1.xml.rels"); + xmlDocUniquePtr pXmlRels = parseExport("word/_rels/footer1.xml.rels"); if (!pXmlRels) return; // Check the value of Target which is http://www.google.com/. @@ -240,7 +240,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAlphabeticalIndex_MultipleColumns,"alpha * If the column count is explicitly specified, * MS Office adds section breaks before and after the Index. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText", " INDEX \\c \"4\"\\e \""); @@ -255,7 +255,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageref, "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. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:hyperlink/w:r[3]/w:instrText", "PAGEREF _Toc355095261 \\h"); } @@ -268,7 +268,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAlphabeticalIndex_AutoColumn,"alphabetic * "\c" switch, don't write back '\c "0"' or the section breaks * before and after the Index Context */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText", " INDEX \\e \""); @@ -280,14 +280,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testIndexFieldFlagF,"IndexFieldFlagF.docx") { // This test case is to verify the Index field flag '\f' with some // Specific Entry Type (ex. "Syn" in our case). - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // We check the Index field flag '\f'. assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[4]/w:r[2]/w:instrText[1]", " INDEX \\c \"2\"\\f \"Syn\" \" \\e \""); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBibliography,"FDO75133.docx") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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"); @@ -298,7 +298,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testGenericTextField, "Unsupportedtextfields { // fdo#75158 : This test case is to verify the unsupported textfields are exported properly. - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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]; @@ -309,7 +309,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testGenericTextField, "Unsupportedtextfields DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_FieldType, "99_Fields.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Checking for three field types (BIBLIOGRAPHY, BIDIOUTLINE, CITATION) in sequence assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText"); @@ -318,7 +318,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_FieldType, "99_Fields.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCitation,"FDO74775.docx") { - xmlDocPtr pXmlDoc = parseExport(); + xmlDocUniquePtr pXmlDoc = parseExport(); 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)"); } @@ -328,7 +328,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testHyperLinkTagEnded, "fdo76316.docx") /* XML tag <w:hyperlink> was not getting closed when its inside another * <w:hyperlink> tag. */ - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[2]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[7]/w:tc[1]/w:tbl[1]/w:tr[2]/w:tc[6]/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:hyperlink[1]",1); @@ -336,21 +336,21 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testHyperLinkTagEnded, "fdo76316.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76163 , "fdo76163.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); //docx file after RT is getting corrupted. assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink/w:r[10]/w:fldChar", "fldCharType", "end" ); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78659, "fdo78659.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[3]/w:fldChar[1]", 0); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78654 , "fdo78654.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // In case of two "Hyperlink" tags in one paragraph and one of them // contains "PAGEREF" field then field end tag was missing from hyperlink. assertXPath ( pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:hyperlink[3]/w:r[5]/w:fldChar", "fldCharType", "end" ); @@ -359,26 +359,26 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78654 , "fdo78654.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78599,"fdo78599.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); //docx file after RT is getting corrupted. assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink/w:r[6]/w:fldChar", "fldCharType", "end" ); // Check for automatic hyphenation - if (xmlDocPtr pSettingsXml = parseExport("word/settings.xml")) + if (xmlDocUniquePtr pSettingsXml = parseExport("word/settings.xml")) // This failed as w:settings had no w:autoHyphenation child. assertXPath(pSettingsXml, "/w:settings/w:autoHyphenation"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78886, "fdo78886.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[2]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[2]/w:fldChar[1]", 0); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo78910, "fdo78910.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This is to ensure that the fld starts and ends inside a hyperlink... assertXPath ( pXmlDoc, "//w:hyperlink[2]/w:r[1]/w:fldChar", "fldCharType", "begin" ); @@ -387,7 +387,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo78910, "fdo78910.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78590, "FDO78590.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This is to ensure that the fld starts and ends inside a hyperlink... assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "w", "9851" ); @@ -397,7 +397,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78590, "FDO78590.docx") DECLARE_OOXMLEXPORT_TEST(testSdtCitationRun, "sdt-citation-run.docx") { // The problem was that the SDT was around the whole paragraph, not only around the citation field. - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) { 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 "); @@ -408,7 +408,7 @@ DECLARE_OOXMLEXPORT_TEST(testSdtCitationRun, "sdt-citation-run.docx") DECLARE_OOXMLEXPORT_TEST(testParagraphSdt, "paragraph-sdt.docx") { // The problem was that the SDT was around the run only, not the whole paragraph. - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) { // The path to w:sdt contained a w:p. assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:sdt"); @@ -417,7 +417,7 @@ DECLARE_OOXMLEXPORT_TEST(testParagraphSdt, "paragraph-sdt.docx") DECLARE_OOXMLEXPORT_TEST(testSdt2Run, "sdt-2-para.docx") { - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) { // 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"); @@ -429,7 +429,7 @@ DECLARE_OOXMLEXPORT_TEST(testSdt2Run, "sdt-2-para.docx") DECLARE_OOXMLEXPORT_TEST(test2Id, "2-id.docx") { - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) { // This was 2, but only one w:id is allowed. assertXPath(pXmlDoc, "//w:sdtPr/w:id", 1); @@ -438,7 +438,7 @@ DECLARE_OOXMLEXPORT_TEST(test2Id, "2-id.docx") DECLARE_OOXMLEXPORT_TEST(testTableStart2Sdt, "table-start-2-sdt.docx") { - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) { // 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); @@ -447,7 +447,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableStart2Sdt, "table-start-2-sdt.docx") DECLARE_OOXMLEXPORT_TEST(testSdtDateDuplicate, "sdt-date-duplicate.docx") { - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) { // Single <w:sdt> was exported as 2 <w:sdt> elements. assertXPath(pXmlDoc, "//w:sdt", 1); @@ -468,7 +468,7 @@ DECLARE_OOXMLEXPORT_TEST(testSdtDateDuplicate, "sdt-date-duplicate.docx") DECLARE_OOXMLEXPORT_TEST(testFdo81492, "fdo81492.docx") { - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:instrText", "ADDIN EN.CITE.DATA"); } @@ -479,7 +479,7 @@ DECLARE_OOXMLEXPORT_TEST(testEditTime, "fdo81341.docx") * then LO was not able to display time in "HH:MM:SS" format. * While exporting LO was writing plain text instead of field entry. */ - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { //Ensure that EditTime is written inside w:fldChar in "HH:MM:SS" format. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:fldChar", "fldCharType", "begin"); @@ -491,14 +491,14 @@ DECLARE_OOXMLEXPORT_TEST(testEditTime, "fdo81341.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo81945, "fdo81945.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//w:sdt//w:sdt", 0); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo82123, "fdo82123.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // make sure there is only one run inside first SDT after RT as in the Original file. assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:p/w:sdt[1]/w:sdtContent/w:r",1); @@ -506,7 +506,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo82123, "fdo82123.docx") DECLARE_OOXMLEXPORT_TEST(testSdtBeforeField, "sdt-before-field.docx") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { // Make sure the field doesn't sneak inside the SDT: the SDT should contain only a single run (there were 6 ones). assertXPath(pXmlDoc, "//w:sdt/w:sdtContent/w:r", 1); @@ -515,14 +515,14 @@ DECLARE_OOXMLEXPORT_TEST(testSdtBeforeField, "sdt-before-field.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo81946, "fdo81946.docx") { - xmlDocPtr pXmlDoc = parseExport("word/header1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); // make sure AlternateContent should not present in sdt assertXPath(pXmlDoc, "/w:hdr[1]/w:p[1]/w:sdt[1]/w:sdtContent[1]/w:r[2]/mc:AlternateContent[1]",0); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo82492, "fdo82492.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // make sure there is only one run inside first SDT after RT as in the Original file. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent/w:r",1); @@ -531,14 +531,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo82492, "fdo82492.docx") DECLARE_OOXMLEXPORT_TEST(testSdtHeader, "sdt-header.docx") { // Problem was that w:sdt elements in headers were lost on import. - if (xmlDocPtr pXmlDoc = parseExport("word/header1.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml")) // This was 0, w:sdt (and then w:date) was missing. assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date", 1); } DECLARE_OOXMLEXPORT_TEST(testSdtCompanyMultipara, "sdt-company-multipara.docx") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { // This was 3, but multiple paragraphs inside "Company" SDT is now allowed. assertXPath(pXmlDoc, "//w:sdtContent/w:p", 1); @@ -559,7 +559,7 @@ DECLARE_OOXMLEXPORT_TEST(testFixedDateFields, "fixed-date-field.docx") CPPUNIT_ASSERT_EQUAL(sal_uInt16(7), date.Month); CPPUNIT_ASSERT_EQUAL(sal_Int16(2014), date.Year); - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { // Previously, fixed fields were exported as static text ("Date (fixed)") // Check they are now exported correctly as fldChar with fldLock attribute @@ -574,13 +574,13 @@ DECLARE_OOXMLEXPORT_TEST(testToxmarkHyperlink, "toxmarkhyperlink.fodt") DECLARE_OOXMLEXPORT_TEST(testOO34469, "ooo34469-1.odt") { - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "2.9.2.Creating_New_files|outline"); } DECLARE_OOXMLEXPORT_TEST(testOO39845, "ooo39845-7.odt") { - if (xmlDocPtr pXmlDoc = parseExport()) + if (xmlDocUniquePtr pXmlDoc = parseExport()) assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "Figure4|graphic"); } @@ -592,7 +592,7 @@ DECLARE_OOXMLEXPORT_TEST( testTdf85161, "tdf85161.docx" ) DECLARE_OOXMLEXPORT_TEST( testTdf66401, "tdf66401.docx") { - if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:rFonts", 1); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:rFonts", "ascii", "Arial Black"); @@ -664,7 +664,7 @@ DECLARE_OOXMLEXPORT_TEST(testDropDownFieldEntryLimit, "tdf126792.odt" ) DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132185, "tdf132185.docx") { - xmlDocPtr pXmlDoc = parseExport("word/footer1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/footer1.xml"); // Since the default (without xml:space attribute) is to ignore leading and trailing spaces, // " PAGE \\* roman " will get imported as "PAGE \\* roman". This is also valid, and must be // treated accordingly. "roman" was ignored before the fix, exporting only " PAGE ". diff --git a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx index ba61d24e55c6..1ad0df5fb514 100644 --- a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx @@ -178,7 +178,7 @@ DECLARE_LINKS_IMPORT_TEST(testTdf123627_import, "tdf123627.docx", USE_RELATIVE) DECLARE_LINKS_EXPORT_TEST(testRelativeToRelativeExport, "relative-link.docx", USE_RELATIVE, USE_TEMP_DIR) { - xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); if (!pXmlDoc) return; @@ -189,7 +189,7 @@ DECLARE_LINKS_EXPORT_TEST(testRelativeToRelativeExport, "relative-link.docx", US DECLARE_LINKS_EXPORT_TEST(testRelativeToAbsoluteExport, "relative-link.docx", USE_ABSOLUTE, DONT_MODIFY_LINK) { - xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); if (!pXmlDoc) return; @@ -201,7 +201,7 @@ DECLARE_LINKS_EXPORT_TEST(testRelativeToAbsoluteExport, "relative-link.docx", US DECLARE_LINKS_EXPORT_TEST(testAbsoluteToRelativeExport, "absolute-link.docx", USE_RELATIVE, USE_TEMP_DIR) { - xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); if (!pXmlDoc) return; @@ -211,7 +211,7 @@ DECLARE_LINKS_EXPORT_TEST(testAbsoluteToRelativeExport, "absolute-link.docx", US DECLARE_LINKS_EXPORT_TEST(testAbsoluteToAbsoluteExport, "absolute-link.docx", USE_ABSOLUTE, DONT_MODIFY_LINK) { - xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); if (!pXmlDoc) return; @@ -222,7 +222,7 @@ DECLARE_LINKS_EXPORT_TEST(testAbsoluteToAbsoluteExport, "absolute-link.docx", US DECLARE_LINKS_EXPORT_TEST(testTdf123627_export, "tdf123627.docx", USE_RELATIVE, USE_TEMP_DIR) { - xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); if (!pXmlDoc) return; @@ -232,7 +232,7 @@ DECLARE_LINKS_EXPORT_TEST(testTdf123627_export, "tdf123627.docx", USE_RELATIVE, DECLARE_LINKS_EXPORT_TEST(testTdf126590_export, "tdf126590.docx", USE_ABSOLUTE, DONT_MODIFY_LINK) { - xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); if (!pXmlDoc) return; // in the original file: Target="file:///C:\TEMP\test.docx" => invalid file URI @@ -242,7 +242,7 @@ DECLARE_LINKS_EXPORT_TEST(testTdf126590_export, "tdf126590.docx", USE_ABSOLUTE, DECLARE_LINKS_EXPORT_TEST(testTdf126768_export, "tdf126768.docx", USE_ABSOLUTE, DONT_MODIFY_LINK) { - xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); if (!pXmlDoc) return; // in the original file: "file:///C:\\TEMP\\test.docx" => invalid file URI @@ -253,7 +253,7 @@ DECLARE_LINKS_EXPORT_TEST(testTdf126768_export, "tdf126768.docx", USE_ABSOLUTE, DECLARE_LINKS_EXPORT_TEST(testNon_ascii_link_export, "non_ascii_link.docx", USE_ABSOLUTE, DONT_MODIFY_LINK) { - xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels"); if (!pXmlDoc) return; diff --git a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx index 0ac181ccbd50..5c2d43698299 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx @@ -26,7 +26,7 @@ protected: DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_GlowShadowReflection, "TextEffects_Glow_Shadow_Reflection.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow", "rad").match("63500")); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow/w14:srgbClr", "val").match("00B0F0")); @@ -93,7 +93,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_GlowShadowReflection, "Text DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_TextOutline, "TextEffects_TextOutline.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Paragraph 1 assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "w", "50800"); @@ -148,7 +148,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_TextOutline, "TextEffects_T DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_TextFill, "TextEffects_TextFill.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Paragraph 1 has no textFill // Paragraph 2 @@ -185,7 +185,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_TextFill, "TextEffects_Text DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_Props3d_Ligatures_NumForm_NumSpacing, "TextEffects_Props3d_Ligatures_NumForm_NumSpacing.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Paragraph 1 - w14:props3d assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", 1); @@ -230,7 +230,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_Props3d_Ligatures_NumForm_N DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_StylisticSets_CntxtAlts, "TextEffects_StylisticSets_CntxtAlts.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Paragraph 1 - w14:stylisticSets assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:stylisticSets/w14:styleSet", 1); @@ -246,13 +246,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_StylisticSets_CntxtAlts, "T DECLARE_OOXMLEXPORT_TEST(Test_McIgnorable, "TextEffects_StylisticSets_CntxtAlts.docx") { - xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); if (!pXmlDocument) return; assertXPath(pXmlDocument, "/w:document", "Ignorable", "w14 wp14"); - xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); if (!pXmlStyles) return; @@ -261,7 +261,7 @@ DECLARE_OOXMLEXPORT_TEST(Test_McIgnorable, "TextEffects_StylisticSets_CntxtAlts. DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_CompatSettingsForW14, "TextEffects_StylisticSets_CntxtAlts.docx") { - xmlDocPtr pXmlDoc = parseExport("word/settings.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting", 5); @@ -288,7 +288,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_CompatSettingsForW14, "TextEffects_Styl DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_Groupshapes, "TextEffects_Groupshapes.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); OString sPathToWGP = "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp"; @@ -401,7 +401,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_Groupshapes, "TextEffects_G DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_InStyleXml, "TextEffects_InStyle.docx") { - xmlDocPtr pXmlDoc = parseExport("word/styles.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); OString sPathToCharacterStyle = "/w:styles/w:style[3]"; @@ -628,7 +628,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_InStyleXml, "TextEffects_In DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_no_tag_if_no_fill, "tdf112103_tablebgnofill.docx") { - xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:shd", 0); } diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 773b5c457a73..14d0d2797f8b 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -361,7 +361,7 @@ DECLARE_OOXMLIMPORT_TEST(testN758883, "n758883.docx") * The problem was that direct formatting of the paragraph was not applied * to the numbering. This is easier to test using a layout dump. */ - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page/body/txt/Special[1]", "nHeight", "220"); // check the bookmark portions are of the expected height @@ -1384,7 +1384,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf100072, "tdf100072.docx") ReadGraphic(aStream, aGraphic); const GDIMetaFile& rMetaFile = aGraphic.GetGDIMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, rMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, rMetaFile); // Get first polyline rightside x coordinate sal_Int32 nFirstEnd = getXPath(pXmlDoc, "(//polyline)[1]/point[2]", "x").toInt32(); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 6f7abeaa1bfe..f5c4344a1e8f 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1807,7 +1807,7 @@ void SwUiWriterTest::testFdo87448() ReadGraphic(aStream, aGraphic); const GDIMetaFile& rMetaFile = aGraphic.GetGDIMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumpAndParse(dumper, rMetaFile); + xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, rMetaFile); // The first polyline in the document has a number of points to draw arcs, // the last one jumps back to the start, so we call "end" the last but one. @@ -1867,7 +1867,7 @@ void SwUiWriterTest::testTdf68183() void SwUiWriterTest::testCp1000115() { createDoc("cp1000115.fodt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/root/page[2]/body/tab/row/cell[2]/txt"); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; // This was 1: the long paragraph in the B1 cell did flow over to the @@ -1907,7 +1907,7 @@ void SwUiWriterTest::testTdf63214() void SwUiWriterTest::testTdf90003() { createDoc("tdf90003.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); // This was 1: an unexpected fly portion was created, resulting in too // large x position for the empty paragraph marker. @@ -3279,7 +3279,7 @@ void SwUiWriterTest::testTdf74230() xStorable->storeToURL(aTempFile.GetURL(), aDescriptor); CPPUNIT_ASSERT(aTempFile.IsValid()); //loading an XML DOM of the "styles.xml" of the TempFile - xmlDocPtr pXmlDoc = parseExportInternal(aTempFile.GetURL(),"styles.xml"); + xmlDocUniquePtr pXmlDoc = parseExportInternal(aTempFile.GetURL(),"styles.xml"); //pXmlDoc should not be null CPPUNIT_ASSERT(pXmlDoc); //asserting XPath in loaded XML DOM @@ -4848,7 +4848,7 @@ void SwUiWriterTest::testBookmarkCollapsed() save("writer8", aTempFile); // load only content.xml from the resaved document - if (xmlDocPtr pXmlDoc = parseExportInternal(aTempFile.GetURL(), "content.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExportInternal(aTempFile.GetURL(), "content.xml")) { const OString aPath("/office:document-content/office:body/office:text/text:p"); @@ -4925,7 +4925,7 @@ void SwUiWriterTest::testRemoveBookmarkText() save("writer8", aTempFile); // load only content.xml from the resaved document - if (xmlDocPtr pXmlDoc = parseExportInternal(aTempFile.GetURL(), "content.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExportInternal(aTempFile.GetURL(), "content.xml")) { const OString aPath("/office:document-content/office:body/office:text/text:p"); @@ -5030,7 +5030,7 @@ void SwUiWriterTest::testRemoveBookmarkTextAndAddNew() save("writer8", aTempFile); // load only content.xml from the resaved document - if (xmlDocPtr pXmlDoc = parseExportInternal(aTempFile.GetURL(), "content.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExportInternal(aTempFile.GetURL(), "content.xml")) { const OString aPath("/office:document-content/office:body/office:text/text:p"); @@ -5095,7 +5095,7 @@ void SwUiWriterTest::testRemoveBookmarkTextAndAddNewAfterReload() save("writer8", aTempFile); // load only content.xml from the resaved document - if (xmlDocPtr pXmlDoc = parseExportInternal(aTempFile.GetURL(), "content.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExportInternal(aTempFile.GetURL(), "content.xml")) { const OString aPath("/office:document-content/office:body/office:text/text:p"); @@ -5134,7 +5134,7 @@ void SwUiWriterTest::testTdf88453() { createDoc("tdf88453.odt"); calcLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 0: the table does not fit the first page, but it wasn't split // to continue on the second page. assertXPath(pXmlDoc, "/root/page[2]/body/tab", 1); @@ -5204,7 +5204,7 @@ void SwUiWriterTest::testTdf98987() { createDoc("tdf98987.docx"); calcLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/SdrObject", "name", "Rectangle 1"); sal_Int32 nRectangle1 = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/bounds", "top").toInt32(); assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/SdrObject", "name", "Rectangle 2"); @@ -5221,7 +5221,7 @@ void SwUiWriterTest::testTdf99004() { createDoc("tdf99004.docx"); calcLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nTextbox1Top = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "top").toInt32(); sal_Int32 nTextBox1Height = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "height").toInt32(); sal_Int32 nTextBox1Bottom = nTextbox1Top + nTextBox1Height; @@ -5634,7 +5634,7 @@ void SwUiWriterTest::testTdf104032() void SwUiWriterTest::testTdf104440() { createDoc("tdf104440.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//page[2]/body/txt/anchored"); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; // This was 0: both Text Frames in the document were anchored to a @@ -5647,7 +5647,7 @@ void SwUiWriterTest::testTdf104440() void SwUiWriterTest::testTdf104425() { createDoc("tdf104425.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // The document contains one top-level 1-cell table with minimum row height set to 70 cm, // and the cell contents does not exceed the minimum row height. // It should span over 3 pages. @@ -5709,7 +5709,7 @@ void SwUiWriterTest::testTdf35021_tabOverMarginDemo() #if HAVE_MORE_FONTS createDoc("tdf35021_tabOverMarginDemo.doc"); calcLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Tabs should go past the margin @ ~3381 sal_Int32 nMargin = getXPath(pXmlDoc, "//body/txt[1]/infos/prtBounds", "width").toInt32(); // left tab was 3381 because it got its own full line @@ -5731,7 +5731,7 @@ void SwUiWriterTest::testTdf106701_tabOverMarginAutotab() { createDoc("tdf106701_tabOverMarginAutotab.doc"); calcLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // The right margin is ~3378 sal_Int32 nRightMargin = getXPath(pXmlDoc, "//body/txt[1]/infos/prtBounds", "width").toInt32(); // Automatic tabstops should never be affected by tabOverMargin compatibility @@ -5743,7 +5743,7 @@ void SwUiWriterTest::testTdf106701_tabOverMarginAutotab() void SwUiWriterTest::testTdf104492() { createDoc("tdf104492.docx"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // The document should split table over 3 pages. assertXPath(pXmlDoc, "//page", 3); } @@ -5755,7 +5755,7 @@ void SwUiWriterTest::testTdf107025() // break into multiple lines because of overflow. // The test document uses DFKAI-SB shipped with Windows. createDoc("tdf107025.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Verify the number of characters in each line. CPPUNIT_ASSERT_EQUAL( sal_Int32(1), getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[1]", "nLength").toInt32()); CPPUNIT_ASSERT_EQUAL( sal_Int32(9), getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[2]", "nLength").toInt32()); @@ -5776,7 +5776,7 @@ void SwUiWriterTest::testTdf107025() void SwUiWriterTest::testTdf107362() { createDoc("tdf107362.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nHeight = getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[1]" , "nHeight").toInt32(); sal_Int32 nWidth1 = getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[1]" , "nWidth").toInt32(); sal_Int32 nWidth2 = getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[2]" , "nWidth").toInt32(); @@ -5884,7 +5884,7 @@ void SwUiWriterTest::testTdf125151_protectedB() void SwUiWriterTest::testTdf106736() { createDoc("tdf106736-grid.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nWidth = getXPath(pXmlDoc, "(//Text[@nType='PortionType::TabLeft'])[1]", "nWidth").toInt32(); // In tdf106736, width of tab overflow so that it got // width value around 9200, expected value is around 103 @@ -6032,7 +6032,7 @@ void SwUiWriterTest::testTdf72942() void SwUiWriterTest::testTdf114306() { load(DATA_DIRECTORY, "fdo114306.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // There are 2 long paragraphs in cell A1. // A part of paragraph 2 should flow over to the second page but @@ -6206,7 +6206,7 @@ void SwUiWriterTest::testRhbz1810732() void SwUiWriterTest::testTdf108524() { createDoc("tdf108524.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // In total we expect two cells containing a section. assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/section", 2); @@ -6222,7 +6222,7 @@ void SwUiWriterTest::testLinesInSectionInTable() // the middle of a multi-line paragraph: the section only contains oneliner // paragraphs instead. createDoc("lines-in-section-in-table.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // In total we expect two cells containing a section. assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/section", 2); @@ -6237,7 +6237,7 @@ void SwUiWriterTest::testLinesMoveBackwardsInSectionInTable() #if HAVE_MORE_FONTS // Assert that paragraph "4" is on page 1 and "5" is on page 2. SwDoc* pDoc = createDoc("lines-in-section-in-table.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page", 2); sal_uInt32 nPara4Node = getXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell[1]/section/txt[last()]", "txtNodeIndex").toUInt32(); CPPUNIT_ASSERT_EQUAL(OUString("4"), pDoc->GetNodes()[nPara4Node]->GetTextNode()->GetText()); @@ -6266,7 +6266,7 @@ void SwUiWriterTest::testTableInSection() #if HAVE_MORE_FONTS // The document has a section, containing a table that spans over 2 pages. createDoc("table-in-sect.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // In total we expect 4 cells. assertXPath(pXmlDoc, "/root/page/body/section/tab/row/cell", 4); @@ -6282,7 +6282,7 @@ void SwUiWriterTest::testTableInNestedSection() // The document has a nested section, containing a table that spans over 2 pages. // This crashed the layout. createDoc("rhbz739252-3.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Make sure the table is inside a section and spans over 2 pages. assertXPath(pXmlDoc, "//page[1]//section/tab", 1); assertXPath(pXmlDoc, "//page[2]//section/tab", 1); @@ -6293,7 +6293,7 @@ void SwUiWriterTest::testTdf112741() { #if HAVE_MORE_FONTS createDoc("tdf112741.fodt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 5 pages. assertXPath(pXmlDoc, "//page", 4); assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell/section", 1); @@ -6318,7 +6318,7 @@ void SwUiWriterTest::testTdf113287() { #if HAVE_MORE_FONTS createDoc("tdf113287.fodt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "//page", 2); sal_uInt32 nCellTop = getXPath(pXmlDoc, "//page[2]/body/tab/row/cell[1]/infos/bounds", "top").toUInt32(); sal_uInt32 nSectionTop = getXPath(pXmlDoc, "//page[2]/body/tab/row/cell[1]/section/infos/bounds", "top").toUInt32(); @@ -6338,7 +6338,7 @@ void SwUiWriterTest::testTdf113445() pView->SetViewLayout(/*nColumns=*/2, /*bBookMode=*/false); calcLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "//page", 2); sal_uInt32 nPage1Left = getXPath(pXmlDoc, "//page[1]/infos/bounds", "left").toUInt32(); sal_uInt32 nPage2Left = getXPath(pXmlDoc, "//page[2]/infos/bounds", "left").toUInt32(); @@ -6369,7 +6369,7 @@ void SwUiWriterTest::testTdf113686() { #if HAVE_MORE_FONTS SwDoc* pDoc = createDoc("tdf113686.fodt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page", 2); sal_uInt32 nPage1LastNode = getXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell[1]/tab/row/cell[1]/txt[last()]", "txtNodeIndex").toUInt32(); CPPUNIT_ASSERT_EQUAL(OUString("Table2:A1-P10"), pDoc->GetNodes()[nPage1LastNode]->GetTextNode()->GetText()); @@ -6417,7 +6417,7 @@ void SwUiWriterTest::testSectionInTableInTable2() { #if HAVE_MORE_FONTS createDoc("split-section-in-nested-table.fodt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_uInt32 nSection1 = getXPath(pXmlDoc, "//page[1]//body/tab/row/cell/tab/row/cell/section", "id").toUInt32(); sal_uInt32 nSection1Follow = getXPath(pXmlDoc, "//page[1]//body/tab/row/cell/tab/row/cell/section", "follow").toUInt32(); // This failed, the section wasn't split inside a nested table. @@ -6447,7 +6447,7 @@ void SwUiWriterTest::testSectionInTableInTable3() // This never returned. calcLayout(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_uInt32 nTable1 = getXPath(pXmlDoc, "//page[1]//body/tab", "id").toUInt32(); sal_uInt32 nTable1Follow = getXPath(pXmlDoc, "//page[1]//body/tab", "follow").toUInt32(); sal_uInt32 nTable2 = getXPath(pXmlDoc, "//page[2]//body/tab", "id").toUInt32(); @@ -6468,7 +6468,7 @@ void SwUiWriterTest::testSectionInTableInTable4() { #if HAVE_MORE_FONTS SwDoc* pDoc = createDoc("tdf113520.fodt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page", 3); sal_uInt32 nPage1LastNode = getXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell[1]/tab/row/cell[1]/section/txt[last()]", "txtNodeIndex").toUInt32(); CPPUNIT_ASSERT_EQUAL(OUString("Section1:P10"), pDoc->GetNodes()[nPage1LastNode]->GetTextNode()->GetText()); @@ -6506,7 +6506,7 @@ void SwUiWriterTest::testTdf112160() #if HAVE_MORE_FONTS // Assert that the A2 cell is on page 1. SwDoc* pDoc = createDoc("tdf112160.fodt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_uInt32 nA2CellNode = getXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/section/txt[last()]", "txtNodeIndex").toUInt32(); CPPUNIT_ASSERT_EQUAL(OUString("Table1.A2"), pDoc->GetNodes()[nA2CellNode]->GetTextNode()->GetText()); @@ -6563,7 +6563,7 @@ void SwUiWriterTest::testTdf112448() createDoc("tdf112448.odt"); // check actual number of line breaks in the paragraph - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page/body/txt/LineBreak", 2); } @@ -6837,7 +6837,7 @@ void SwUiWriterTest::testHtmlCopyImages() SwWriter aWrt(aStream, *pDoc); aWrt.Write(xWrt); } - htmlDocPtr pHtmlDoc = parseHtml(maTempFile); + htmlDocUniquePtr pHtmlDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pHtmlDoc); // This failed, image was lost during HTML copy. @@ -6922,7 +6922,7 @@ void SwUiWriterTest::testFontEmbedding() OString aContentBaseXpath("/office:document-content/office:font-face-decls"); OString aSettingsBaseXpath("/office:document-settings/office:settings/config:config-item-set"); - xmlDocPtr pXmlDoc = nullptr; + xmlDocUniquePtr pXmlDoc; uno::Sequence<beans::PropertyValue> aDescriptor; utl::TempFile aTempFile; aTempFile.EnableKillingFile(); @@ -7092,7 +7092,7 @@ void SwUiWriterTest::testInconsistentBookmark() save("writer8", aTempFile); // load only content.xml - if (xmlDocPtr pXmlDoc = parseExportInternal(aTempFile.GetURL(), "content.xml")) + if (xmlDocUniquePtr pXmlDoc = parseExportInternal(aTempFile.GetURL(), "content.xml")) { const OString aPath("/office:document-content/office:body/office:text/text:p"); diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 7eb427901bf2..086a9122ba98 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -136,7 +136,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdfChangeNumberingListAutoFormat) CPPUNIT_ASSERT(pViewShell); pViewShell->Reformat(); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Check that we actually test the line we need assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]", "GHI GHI GHI GHI"); @@ -980,7 +980,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf123102) createDoc("tdf123102.odt"); // insert a new row after a vertically merged cell dispatchCommand(mxComponent, ".uno:InsertRowsAfter", {}); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was "3." - caused by the hidden numbered paragraph of the new merged cell assertXPath(pXmlDoc, "/root/page/body/tab/row[6]/cell[1]/txt/Special", "rText", "2."); } @@ -2355,7 +2355,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf118311) // .uno:Cut doesn't remove the table, only the selected content of the first cell dispatchCommand(mxComponent, ".uno:Cut", {}); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "//page[1]//body/tab"); // .uno:SelectAll selects the whole table, and UNO command Cut cuts it @@ -2486,7 +2486,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf90069) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf129655) { createDoc("tdf129655-vtextbox.odt"); - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "//fly/txt[@WritingMode='Vertical']", 1); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index 9375b589b06f..0f0f9bebd713 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -99,7 +99,7 @@ DECLARE_WW8EXPORT_TEST(testTdf37153, "tdf37153_considerWrapOnObjPos.doc") CPPUNIT_ASSERT_EQUAL(text::VertOrientation::BOTTOM, getProperty<sal_Int16>(xTable->getCellByName("A1"), "VertOrient")); //For MSO compatibility, the image should be at the top of the cell, not at the bottom - despite VertOrientation::BOTTOM - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nFlyTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt/anchored/fly/infos/bounds", "top").toInt32(); CPPUNIT_ASSERT_MESSAGE("FlyTop should be 3820, not 6623", nFlyTop < 4000); sal_Int32 nTextTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt[1]/infos/bounds", "top").toInt32(); @@ -979,7 +979,7 @@ DECLARE_WW8EXPORT_TEST(testTdf117503, "tdf117503.docx") DECLARE_WW8EXPORT_TEST(testTdf117885, "tdf117885.doc") { - xmlDocPtr pXmlDoc = parseLayoutDump(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); /* Get the vertical position of the paragraph containing the text "Start" */ sal_Int32 nParaA_Top = getXPath(pXmlDoc, |