sd/qa/filter/eppt/eppt.cxx | 4 sd/qa/unit/HtmlExportTest.cxx | 43 - sd/qa/unit/SVGExportTests.cxx | 100 +-- sd/qa/unit/ShapeImportExportTest.cxx | 88 +-- sd/qa/unit/dialogs-test.cxx | 44 - sd/qa/unit/export-tests-ooxml1.cxx | 387 +++++++------- sd/qa/unit/export-tests-ooxml2.cxx | 673 ++++++++++++++------------ sd/qa/unit/export-tests-ooxml3.cxx | 306 ++++++----- sd/qa/unit/export-tests-ooxml4.cxx | 198 ++++--- sd/qa/unit/export-tests.cxx | 217 ++++---- sd/qa/unit/layout-tests.cxx | 97 ++- sd/qa/unit/misc-tests.cxx | 3 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx | 38 - sd/qa/unit/tiledrendering/tiledrendering.cxx | 36 - sd/source/filter/eppt/pptx-epptooxml.cxx | 2 sd/source/ui/app/sdmod.cxx | 2 sd/source/ui/remotecontrol/Communicator.cxx | 8 sd/source/ui/remotecontrol/ImagePreparer.cxx | 4 sd/source/ui/view/ViewShellBase.cxx | 6 sd/source/ui/view/drviews1.cxx | 2 sd/source/ui/view/drviewse.cxx | 4 sd/source/ui/view/sdview.cxx | 2 22 files changed, 1205 insertions(+), 1059 deletions(-)
New commits: commit c7526e303ff8113b6d4fdcc5b439b2ea2734cd51 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Sun Nov 19 17:31:25 2023 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Sun Nov 19 20:38:53 2023 +0100 Extended loplugin:ostr: sd Change-Id: Iadfe05a173bacd236086728ac23de1e610f0bf27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159679 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/sd/qa/filter/eppt/eppt.cxx b/sd/qa/filter/eppt/eppt.cxx index 08e83053ed2f..b55a5070e696 100644 --- a/sd/qa/filter/eppt/eppt.cxx +++ b/sd/qa/filter/eppt/eppt.cxx @@ -88,7 +88,7 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeExport) // Verify that this color is not lost: xmlDocUniquePtr pXmlDoc = parseExport("ppt/theme/theme1.xml"); - assertXPath(pXmlDoc, "//a:clrScheme/a:lt1/a:srgbClr", "val", + assertXPath(pXmlDoc, "//a:clrScheme/a:lt1/a:srgbClr"_ostr, "val"_ostr, "222222"); // expected color 22-22-22 // Check the theme after loading again @@ -126,7 +126,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLoopingFromAnimation) // - Actual : 0 // - In <>, XPath '//p:cMediaNode/p:cTn' number of nodes is incorrect // i.e. the media node was lost on export, the video no longer looped. - assertXPath(pXmlDoc, "//p:cMediaNode/p:cTn", "repeatCount", "indefinite"); + assertXPath(pXmlDoc, "//p:cMediaNode/p:cTn"_ostr, "repeatCount"_ostr, "indefinite"); } } diff --git a/sd/qa/unit/HtmlExportTest.cxx b/sd/qa/unit/HtmlExportTest.cxx index 93c1a21339d1..34b262f6e76c 100644 --- a/sd/qa/unit/HtmlExportTest.cxx +++ b/sd/qa/unit/HtmlExportTest.cxx @@ -26,18 +26,19 @@ public: save("impress_html_Export"); htmlDocUniquePtr htmlDoc = parseHtml(maTempFile); - assertXPath(htmlDoc, "/html", 1); - assertXPath(htmlDoc, "/html/body", 1); - assertXPath(htmlDoc, "/html/body/h1", 4); - assertXPath(htmlDoc, "/html/body/table", 1); - assertXPath(htmlDoc, "/html/body/table/tr", 5); - assertXPath(htmlDoc, "/html/body/ul", 1); - assertXPath(htmlDoc, "/html/body/ul/li", 2); + assertXPath(htmlDoc, "/html"_ostr, 1); + assertXPath(htmlDoc, "/html/body"_ostr, 1); + assertXPath(htmlDoc, "/html/body/h1"_ostr, 4); + assertXPath(htmlDoc, "/html/body/table"_ostr, 1); + assertXPath(htmlDoc, "/html/body/table/tr"_ostr, 5); + assertXPath(htmlDoc, "/html/body/ul"_ostr, 1); + assertXPath(htmlDoc, "/html/body/ul/li"_ostr, 2); - assertXPath(htmlDoc, "/html/head/meta[1]", "content", "text/html; charset=utf-8"); - assertXPath(htmlDoc, "/html/head/meta[2]", "name", "generator"); - assertXPath(htmlDoc, "/html/head/meta[3]", "name", "created"); - assertXPath(htmlDoc, "/html/head/meta[3]", "content", "2014-04-09T17:05:41.987922038"); + assertXPath(htmlDoc, "/html/head/meta[1]"_ostr, "content"_ostr, "text/html; charset=utf-8"); + assertXPath(htmlDoc, "/html/head/meta[2]"_ostr, "name"_ostr, "generator"); + assertXPath(htmlDoc, "/html/head/meta[3]"_ostr, "name"_ostr, "created"); + assertXPath(htmlDoc, "/html/head/meta[3]"_ostr, "content"_ostr, + "2014-04-09T17:05:41.987922038"); } void testTdf154989() @@ -46,21 +47,23 @@ public: save("XHTML Draw File"); xmlDocUniquePtr pXmlDoc = parseXml(maTempFile); - assertXPath(pXmlDoc, "/xhtml:html", 1); + assertXPath(pXmlDoc, "/xhtml:html"_ostr, 1); // 1 page - assertXPath(pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div", 1); + assertXPath(pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div"_ostr, 1); // 4 shapes - assertXPath(pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div", 4); + assertXPath(pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div"_ostr, 4); // 3 of them are text boxes - assertXPath(pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div/xhtml:div", 3); + assertXPath(pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div/xhtml:div"_ostr, 3); // not sure if the order of these is stable? - assertXPathContent(pXmlDoc, - "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div[2]/xhtml:div/xhtml:p", - "before"); assertXPathContent( - pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div[3]/xhtml:div/xhtml:p", "above"); + pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div[2]/xhtml:div/xhtml:p"_ostr, + "before"); assertXPathContent( - pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div[4]/xhtml:div/xhtml:p", "below"); + pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div[3]/xhtml:div/xhtml:p"_ostr, + "above"); + assertXPathContent( + pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div[4]/xhtml:div/xhtml:p"_ostr, + "below"); } CPPUNIT_TEST_SUITE(SdHTMLFilterTest); diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx index 713cd3b5a4d6..03381bd8901e 100644 --- a/sd/qa/unit/SVGExportTests.cxx +++ b/sd/qa/unit/SVGExportTests.cxx @@ -85,16 +85,16 @@ public: svgDoc->name = reinterpret_cast<char *>(xmlStrdup(reinterpret_cast<xmlChar const *>(OUStringToOString(maTempFile.GetURL(), RTL_TEXTENCODING_UTF8).getStr()))); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG ), 1); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2] ), "class", "SlideGroup"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G ), "class", "Slide"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1] ), "class", "TitleText"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1]/SVG_G/SVG_TEXT ), "class", "SVGTextShape"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN ), "class", "TextPosition"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN[1] ), "text-decoration", "underline"); - - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[2]/SVG_G/SVG_TEXT ), "class", "SVGTextShape"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[2]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN ), "class", "TextPosition"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[2]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "text-decoration", "line-through"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2] ), "class"_ostr, "SlideGroup"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G ), "class"_ostr, "Slide"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1] ), "class"_ostr, "TitleText"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1]/SVG_G/SVG_TEXT ), "class"_ostr, "SVGTextShape"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN ), "class"_ostr, "TextPosition"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[1]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN[1] ), "text-decoration"_ostr, "underline"); + + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[2]/SVG_G/SVG_TEXT ), "class"_ostr, "SVGTextShape"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[2]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN ), "class"_ostr, "TextPosition"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[2]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "text-decoration"_ostr, "line-through"); } void testSVGExportJavascriptURL() @@ -120,7 +120,7 @@ public: xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_DEFS ), "class", "SlideBackground"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_DEFS ), "class"_ostr, "SlideBackground"); } void testSVGExportTextFieldsInMasterPage() @@ -131,20 +131,20 @@ public: xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2] ), "class", "Master_Slide"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2] ), "class", "BackgroundObjects"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2] ), "class"_ostr, "Master_Slide"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2] ), "class"_ostr, "BackgroundObjects"); // Current Date Field - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[4] ), "class", "TextShape"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[4]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class", "PlaceholderText Date"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[4] ), "class"_ostr, "TextShape"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[4]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class"_ostr, "PlaceholderText Date"); // Current Time Field - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[5] ), "class", "TextShape"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[5]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class", "PlaceholderText Time"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[5] ), "class"_ostr, "TextShape"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[5]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class"_ostr, "PlaceholderText Time"); // Slide Name Field - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[6] ), "class", "TextShape"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[6]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class", "PlaceholderText PageName"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[6] ), "class"_ostr, "TextShape"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[6]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class"_ostr, "PlaceholderText PageName"); // Slide Number Field - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[7] ), "class", "TextShape"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[7]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class", "PlaceholderText PageNumber"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[7] ), "class"_ostr, "TextShape"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[7]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class"_ostr, "PlaceholderText PageNumber"); } void testSVGExportEmbeddedVideo() @@ -156,25 +156,25 @@ public: CPPUNIT_ASSERT(svgDoc); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG ), 1); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2] ), "class", "SlideGroup"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1] ), "visibility", "hidden"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1] ), "id", "container-id1"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1] ), "class", "Slide"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1] ), "class", "Page"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1] ), "class", "TitleText"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2] ), "class"_ostr, "SlideGroup"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1] ), "visibility"_ostr, "hidden"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1] ), "id"_ostr, "container-id1"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1] ), "class"_ostr, "Slide"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1] ), "class"_ostr, "Page"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1] ), "class"_ostr, "TitleText"); // First one has no valid video, so we just generate the stock thumbnail as an image. - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[2] ), "class", "com.sun.star.presentation.MediaShape"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[2] ), "class"_ostr, "com.sun.star.presentation.MediaShape"); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[2]/SVG_G[1]/SVG_IMAGE ), 1); // The second one is a valid video, with the thumbnail embedded. - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[5] ), "class", "com.sun.star.drawing.MediaShape"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[5] ), "class"_ostr, "com.sun.star.drawing.MediaShape"); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[5]/SVG_G[1] ), 1); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[5]/SVG_G[1]/SVG_FOREIGNOBJECT ), 1); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[5]/SVG_G[1]/SVG_FOREIGNOBJECT/SVG_BODY ), 1); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[5]/SVG_G[1]/SVG_FOREIGNOBJECT/SVG_BODY/SVG_VIDEO ), "preload", "auto"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[5]/SVG_G[1]/SVG_FOREIGNOBJECT/SVG_BODY/SVG_VIDEO ), "preload"_ostr, "auto"); - const OUString poster = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[5]/SVG_G[1]/SVG_FOREIGNOBJECT/SVG_BODY/SVG_VIDEO), "poster"); + const OUString poster = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[1]/SVG_G[5]/SVG_G[1]/SVG_FOREIGNOBJECT/SVG_BODY/SVG_VIDEO), "poster"_ostr); CPPUNIT_ASSERT_MESSAGE("The video poster is invalid", poster.startsWith("data:image/png;base64,")); } @@ -186,19 +186,19 @@ public: xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9] ), "class", "BackgroundBitmaps"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9] ), "class"_ostr, "BackgroundBitmaps"); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_IMAGE ), 1); - OUString sImageId = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_IMAGE ), "id"); + OUString sImageId = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_IMAGE ), "id"_ostr); CPPUNIT_ASSERT_MESSAGE(OString("The exported bitmap has not a valid id: " + sImageId.toUtf8()).getStr(), isValidBitmapId(sImageId)); BitmapChecksum nChecksum = getBitmapChecksumFromId(sImageId); CPPUNIT_ASSERT_MESSAGE(OString("The exported bitmap has not a valid checksum: " + sImageId.toUtf8()).getStr(), nChecksum != 0); // single image case - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G/SVG_G/SVG_G/SVG_DEFS ), "class", "SlideBackground"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G/SVG_G/SVG_G/SVG_DEFS ), "class"_ostr, "SlideBackground"); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G/SVG_G/SVG_G/SVG_DEFS/SVG_G/SVG_G/SVG_USE ), 1); - OUString sRef = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G/SVG_G/SVG_G/SVG_DEFS/SVG_G/SVG_G/SVG_USE ), "href"); + OUString sRef = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G/SVG_G/SVG_G/SVG_DEFS/SVG_G/SVG_G/SVG_USE ), "href"_ostr); CPPUNIT_ASSERT_MESSAGE("The <use> element has not a valid href attribute: starting '#' not present.", sRef.startsWith("#")); sRef = sRef.copy(1); CPPUNIT_ASSERT_MESSAGE(OString("The <use> element does not point to a valid bitmap id: " + sRef.toUtf8()).getStr(), isValidBitmapId(sRef)); @@ -216,46 +216,46 @@ public: CPPUNIT_ASSERT(svgDoc); // check the bitmap - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9] ), "class", "BackgroundBitmaps"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9] ), "class"_ostr, "BackgroundBitmaps"); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_IMAGE ), 1); // check the pattern and background rectangle - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10] ), "class", "BackgroundPatterns"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10] ), "class"_ostr, "BackgroundPatterns"); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10]/SVG_PATTERN ), 1); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10]/SVG_PATTERN/SVG_USE ), 1); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10]/SVG_G/SVG_RECT ), 1); // check that <pattern><use> is pointing to the correct <image> - OUString sImageId = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_IMAGE ), "id"); + OUString sImageId = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_IMAGE ), "id"_ostr); CPPUNIT_ASSERT_MESSAGE(OString("The exported bitmap has not a valid id: " + sImageId.toUtf8()).getStr(), isValidBitmapId(sImageId)); BitmapChecksum nChecksum = getBitmapChecksumFromId(sImageId); CPPUNIT_ASSERT_MESSAGE(OString("The exported bitmap has not a valid checksum: " + sImageId.toUtf8()).getStr(), nChecksum != 0); - OUString sRef = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10]/SVG_PATTERN/SVG_USE ), "href"); + OUString sRef = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10]/SVG_PATTERN/SVG_USE ), "href"_ostr); CPPUNIT_ASSERT_MESSAGE("The <pattern><use> element has not a valid href attribute: starting '#' not present.", sRef.startsWith("#")); sRef = sRef.copy(1); CPPUNIT_ASSERT_EQUAL_MESSAGE("The href attribute for <pattern><use> does not match the <image> id attribute: ", sImageId, sRef); - OUString sPatternId = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10]/SVG_PATTERN ), "id"); + OUString sPatternId = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10]/SVG_PATTERN ), "id"_ostr); CPPUNIT_ASSERT_MESSAGE(OString("The exported pattern has not a valid id: " + sPatternId.toUtf8()).getStr(), isValidBackgroundPatternId(sPatternId)); - OUString sFillUrl = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10]/SVG_G/SVG_RECT ), "fill"); + OUString sFillUrl = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10]/SVG_G/SVG_RECT ), "fill"_ostr); bool bIsUrlFormat = sFillUrl.startsWith("url(#") && sFillUrl.endsWith(")"); CPPUNIT_ASSERT_MESSAGE("The fill attribute for the <rectangle> element has not a url format .", bIsUrlFormat); // remove "url(#" and ")" sFillUrl = sFillUrl.copy(5, sFillUrl.getLength() - 6); CPPUNIT_ASSERT_EQUAL_MESSAGE("The fill url for <rectangle> does not match the <pattern> id attribute: ", sPatternId, sFillUrl); - OUString sBackgroundId = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10]/SVG_G ), "id"); + OUString sBackgroundId = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[10]/SVG_G ), "id"_ostr); CPPUNIT_ASSERT_MESSAGE(OString("The exported tiled background has not a valid id: " + sBackgroundId.toUtf8()).getStr(), isValidTiledBackgroundId(sBackgroundId)); // check <use> element that point to the tiled background - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G/SVG_G/SVG_G/SVG_DEFS ), "class", "SlideBackground"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G/SVG_G/SVG_G/SVG_DEFS ), "class"_ostr, "SlideBackground"); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G/SVG_G/SVG_G/SVG_DEFS/SVG_G/SVG_USE ), 1); - sRef = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G/SVG_G/SVG_G/SVG_DEFS/SVG_G/SVG_USE ), "href"); + sRef = getXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G[1]/SVG_G/SVG_G/SVG_G/SVG_DEFS/SVG_G/SVG_USE ), "href"_ostr); CPPUNIT_ASSERT_MESSAGE("The <use> element has not a valid href attribute: starting '#' not present.", sRef.startsWith("#")); sRef = sRef.copy(1); CPPUNIT_ASSERT_EQUAL_MESSAGE("The href attribute for <use> does not match the tiled background id attribute: ", sBackgroundId, sRef); @@ -280,15 +280,15 @@ public: xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2] ), "class", "Master_Slide"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2] ), "class", "BackgroundObjects"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2] ), "class"_ostr, "Master_Slide"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2] ), "class"_ostr, "BackgroundObjects"); // Slide Name Field - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[6] ), "class", "TextShape"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[6]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class", "PlaceholderText PageName"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[6] ), "class"_ostr, "TextShape"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[6]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class"_ostr, "PlaceholderText PageName"); // Slide Number Field - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[7] ), "class", "TextShape"); - assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[7]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class", "PlaceholderText PageNumber"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[7] ), "class"_ostr, "TextShape"); + assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[7]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class"_ostr, "PlaceholderText PageNumber"); } CPPUNIT_TEST_SUITE(SdSVGFilterTest); diff --git a/sd/qa/unit/ShapeImportExportTest.cxx b/sd/qa/unit/ShapeImportExportTest.cxx index b1008702ad22..a59e503e4140 100644 --- a/sd/qa/unit/ShapeImportExportTest.cxx +++ b/sd/qa/unit/ShapeImportExportTest.cxx @@ -261,107 +261,117 @@ void ShapeImportExportTest::testTextDistancesOOXML_Export() CPPUNIT_ASSERT(pXmlDoc); //Check shape Top/Bottom - 0cm, 4cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:nvSpPr/p:cNvPr", "name", "Text_TB_0_4"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, + "Text_TB_0_4"); + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr"_ostr, { { "tIns", "-360000" }, { "bIns", "1079640" } }); //Check shape Top/Bottom - 4cm, 0cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:nvSpPr/p:cNvPr", "name", "Text_TB_4_0"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:bodyPr", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, + "Text_TB_4_0"); + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:bodyPr"_ostr, { { "tIns", "1079640" }, { "bIns", "-360000" } }); //Check shape Top/Bottom - 0cm, 3cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:nvSpPr/p:cNvPr", "name", "Text_TB_0_3"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:txBody/a:bodyPr", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, + "Text_TB_0_3"); + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:txBody/a:bodyPr"_ostr, { { "tIns", "-180000" }, { "bIns", "899640" } }); //Check shape Top/Bottom - 2cm, 1cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:nvSpPr/p:cNvPr", "name", "Text_TB_2_1"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:txBody/a:bodyPr", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, + "Text_TB_2_1"); + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:txBody/a:bodyPr"_ostr, { { "tIns", "540000" }, { "bIns", "180000" } }); //Check shape Top/Bottom - 0cm, 2.5cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:nvSpPr/p:cNvPr", "name", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, "Text_TB_0_2.5"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:txBody/a:bodyPr", + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:txBody/a:bodyPr"_ostr, { { "tIns", "-90000" }, { "bIns", "809640" } }); //Check shape Top/Bottom - 0cm, 2cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:nvSpPr/p:cNvPr", "name", "Text_TB_0_2"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:txBody/a:bodyPr", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, + "Text_TB_0_2"); + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:txBody/a:bodyPr"_ostr, { { "tIns", "0" }, { "bIns", "720000" } }); //Check shape Top/Bottom - 0cm, 1.5cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[7]/p:nvSpPr/p:cNvPr", "name", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[7]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, "Text_TB_0_1.5"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[7]/p:txBody/a:bodyPr", + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[7]/p:txBody/a:bodyPr"_ostr, { { "tIns", "0" }, { "bIns", "540000" } }); //Check shape Top/Bottom - 3cm, 0cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[8]/p:nvSpPr/p:cNvPr", "name", "Text_TB_3_0"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[8]/p:txBody/a:bodyPr", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[8]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, + "Text_TB_3_0"); + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[8]/p:txBody/a:bodyPr"_ostr, { { "tIns", "899640" }, { "bIns", "-180000" } }); //Check shape Top/Bottom - 2.5cm, 0cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[9]/p:nvSpPr/p:cNvPr", "name", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[9]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, "Text_TB_2.5_0"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[9]/p:txBody/a:bodyPr", + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[9]/p:txBody/a:bodyPr"_ostr, { { "tIns", "809640" }, { "bIns", "-90000" } }); //Check shape Top/Bottom - 2cm, 0cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[10]/p:nvSpPr/p:cNvPr", "name", "Text_TB_2_0"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[10]/p:txBody/a:bodyPr", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[10]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, + "Text_TB_2_0"); + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[10]/p:txBody/a:bodyPr"_ostr, { { "tIns", "720000" }, { "bIns", "0" } }); //Check shape Top/Bottom - 1.5cm, 0cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[11]/p:nvSpPr/p:cNvPr", "name", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[11]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, "Text_TB_1.5_0"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[11]/p:txBody/a:bodyPr", + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[11]/p:txBody/a:bodyPr"_ostr, { { "tIns", "540000" }, { "bIns", "0" } }); //Check shape Top/Bottom - 1cm, 2cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[12]/p:nvSpPr/p:cNvPr", "name", "Text_TB_1_2"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[12]/p:txBody/a:bodyPr", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[12]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, + "Text_TB_1_2"); + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[12]/p:txBody/a:bodyPr"_ostr, { { "tIns", "180000" }, { "bIns", "540000" } }); //Check shape Top/Bottom - 2cm, 1.5cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[13]/p:nvSpPr/p:cNvPr", "name", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[13]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, "Text_TB_2_1.5"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[13]/p:txBody/a:bodyPr", + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[13]/p:txBody/a:bodyPr"_ostr, { { "tIns", "450000" }, { "bIns", "270000" } }); //Check shape Top/Bottom - 1.5cm, 2cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[14]/p:nvSpPr/p:cNvPr", "name", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[14]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, "Text_TB_1.5_2"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[14]/p:txBody/a:bodyPr", + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[14]/p:txBody/a:bodyPr"_ostr, { { "tIns", "270000" }, { "bIns", "450000" } }); //Check shape Top/Bottom - 2cm, 1.75cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[15]/p:nvSpPr/p:cNvPr", "name", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[15]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, "Text_TB_2_1.75"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[15]/p:txBody/a:bodyPr", + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[15]/p:txBody/a:bodyPr"_ostr, { { "tIns", "405000" }, { "bIns", "315000" } }); //Check shape Top/Bottom - 1.75cm, 2cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[16]/p:nvSpPr/p:cNvPr", "name", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[16]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, "Text_TB_1.75_2"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[16]/p:txBody/a:bodyPr", + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[16]/p:txBody/a:bodyPr"_ostr, { { "tIns", "315000" }, { "bIns", "405000" } }); //Check shape Top/Bottom - 2cm, 2cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[17]/p:nvSpPr/p:cNvPr", "name", "Text_TB_2_2"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[17]/p:txBody/a:bodyPr", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[17]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, + "Text_TB_2_2"); + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[17]/p:txBody/a:bodyPr"_ostr, { { "tIns", "360000" }, { "bIns", "360000" } }); //Check shape Top/Bottom - 1cm, 1cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[18]/p:nvSpPr/p:cNvPr", "name", "Text_TB_1_1"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[18]/p:txBody/a:bodyPr", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[18]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, + "Text_TB_1_1"); + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[18]/p:txBody/a:bodyPr"_ostr, { { "tIns", "360000" }, { "bIns", "360000" } }); //Check shape Top/Bottom - 0.5cm, 0.5cm - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[19]/p:nvSpPr/p:cNvPr", "name", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[19]/p:nvSpPr/p:cNvPr"_ostr, "name"_ostr, "Text_TB_0.5_0.5"); - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[19]/p:txBody/a:bodyPr", + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[19]/p:txBody/a:bodyPr"_ostr, { { "tIns", "180000" }, { "bIns", "180000" } }); } @@ -375,7 +385,7 @@ void ShapeImportExportTest::testTextDistancesODP_OOXML_Export() // The text ends 5cm below the top edge of the shape. // Without the fix we exported tIns="3600000" and bIns="5400000". // The text had ended about 3.3cm below the top edge in PowerPoint. - assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr", + assertXPathAttrs(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr"_ostr, { { "tIns", "720000" }, { "bIns", "2520000" } }); } diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx index c9182eea751d..45bdcaef9d48 100644 --- a/sd/qa/unit/dialogs-test.cxx +++ b/sd/qa/unit/dialogs-test.cxx @@ -209,28 +209,28 @@ const SfxItemSet& SdDialogsTest::getEmptyFillStyleSfxItemSet() void SdDialogsTest::registerKnownDialogsByID(mapType& rKnownDialogs) { // fill map of known dialogs - rKnownDialogs["modules/sdraw/ui/breakdialog.ui"] = 0; - rKnownDialogs["modules/sdraw/ui/copydlg.ui"] = 1; - rKnownDialogs["modules/simpress/ui/customslideshows.ui"] = 2; - rKnownDialogs["modules/sdraw/ui/drawchardialog.ui"] = 3; - rKnownDialogs["modules/sdraw/ui/drawpagedialog.ui"] = 4; - rKnownDialogs["modules/simpress/ui/dlgfield.ui"] = 5; - rKnownDialogs["modules/sdraw/ui/dlgsnap.ui"] = 6; - rKnownDialogs["modules/sdraw/ui/insertlayer.ui"] = 7; - rKnownDialogs["modules/sdraw/ui/insertslidesdialog.ui"] = 8; - rKnownDialogs["modules/sdraw/ui/crossfadedialog.ui"] = 9; - rKnownDialogs["modules/sdraw/ui/bulletsandnumbering.ui"] = 10; - rKnownDialogs["modules/sdraw/ui/drawparadialog.ui"] = 11; - rKnownDialogs["modules/simpress/ui/presentationdialog.ui"] = 12; - rKnownDialogs["modules/simpress/ui/remotedialog.ui"] = 13; - rKnownDialogs["modules/sdraw/ui/drawprtldialog.ui"] = 14; - rKnownDialogs["modules/simpress/ui/slidedesigndialog.ui"] = 15; - rKnownDialogs["modules/simpress/ui/templatedialog.ui"] = 16; - rKnownDialogs["modules/simpress/ui/interactiondialog.ui"] = 17; - rKnownDialogs["modules/sdraw/ui/vectorize.ui"] = 18; - rKnownDialogs["modules/simpress/ui/photoalbum.ui"] = 19; - rKnownDialogs["modules/simpress/ui/masterlayoutdlg.ui"] = 20; - rKnownDialogs["modules/simpress/ui/headerfooterdialog.ui"] = 21; + rKnownDialogs["modules/sdraw/ui/breakdialog.ui"_ostr] = 0; + rKnownDialogs["modules/sdraw/ui/copydlg.ui"_ostr] = 1; + rKnownDialogs["modules/simpress/ui/customslideshows.ui"_ostr] = 2; + rKnownDialogs["modules/sdraw/ui/drawchardialog.ui"_ostr] = 3; + rKnownDialogs["modules/sdraw/ui/drawpagedialog.ui"_ostr] = 4; + rKnownDialogs["modules/simpress/ui/dlgfield.ui"_ostr] = 5; + rKnownDialogs["modules/sdraw/ui/dlgsnap.ui"_ostr] = 6; + rKnownDialogs["modules/sdraw/ui/insertlayer.ui"_ostr] = 7; + rKnownDialogs["modules/sdraw/ui/insertslidesdialog.ui"_ostr] = 8; + rKnownDialogs["modules/sdraw/ui/crossfadedialog.ui"_ostr] = 9; + rKnownDialogs["modules/sdraw/ui/bulletsandnumbering.ui"_ostr] = 10; + rKnownDialogs["modules/sdraw/ui/drawparadialog.ui"_ostr] = 11; + rKnownDialogs["modules/simpress/ui/presentationdialog.ui"_ostr] = 12; + rKnownDialogs["modules/simpress/ui/remotedialog.ui"_ostr] = 13; + rKnownDialogs["modules/sdraw/ui/drawprtldialog.ui"_ostr] = 14; + rKnownDialogs["modules/simpress/ui/slidedesigndialog.ui"_ostr] = 15; + rKnownDialogs["modules/simpress/ui/templatedialog.ui"_ostr] = 16; + rKnownDialogs["modules/simpress/ui/interactiondialog.ui"_ostr] = 17; + rKnownDialogs["modules/sdraw/ui/vectorize.ui"_ostr] = 18; + rKnownDialogs["modules/simpress/ui/photoalbum.ui"_ostr] = 19; + rKnownDialogs["modules/simpress/ui/masterlayoutdlg.ui"_ostr] = 20; + rKnownDialogs["modules/simpress/ui/headerfooterdialog.ui"_ostr] = 21; } VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID) diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 167f67f8674e..deab0ea2de24 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -80,7 +80,8 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf152335) xmlDocUniquePtr pXmlDocTheme = parseExport("ppt/theme/theme1.xml"); assertXPathChildren( - pXmlDocTheme, "/a:theme/a:themeElements/a:fmtScheme/a:effectStyleLst/a:effectStyle[3]", 1); + pXmlDocTheme, "/a:theme/a:themeElements/a:fmtScheme/a:effectStyleLst/a:effectStyle[3]"_ostr, + 1); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149803) @@ -89,7 +90,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149803) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp", "useBgFill", "1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp"_ostr, "useBgFill"_ostr, "1"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149311) @@ -99,7 +100,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149311) xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide1.xml.rels"); - assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", + assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "Target"_ostr, "slide2.xml"); } @@ -109,14 +110,14 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149128) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "id", - "42"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", - "0"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "id", - "43"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx", - "2"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn"_ostr, + "id"_ostr, "42"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn"_ostr, + "idx"_ostr, "0"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn"_ostr, + "id"_ostr, "43"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn"_ostr, + "idx"_ostr, "2"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf66228) @@ -125,7 +126,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf66228) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:prstGeom", "prst", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:prstGeom"_ostr, "prst"_ostr, "bentConnector3"); } @@ -135,66 +136,72 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf147919) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:spPr/a:prstGeom", "prst", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:spPr/a:prstGeom"_ostr, "prst"_ostr, "bentConnector2"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:prstGeom/a:avLst/a:gd", "name", - "adj1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:prstGeom", "prst", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:prstGeom/a:avLst/a:gd"_ostr, + "name"_ostr, "adj1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:prstGeom"_ostr, "prst"_ostr, "bentConnector3"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:xfrm", "flipH", "1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:xfrm", "rot", "16200000"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[1]", - "name", "adj1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[2]", - "name", "adj2"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom", "prst", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:xfrm"_ostr, "flipH"_ostr, "1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:xfrm"_ostr, "rot"_ostr, + "16200000"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, + "name"_ostr, "adj1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, + "name"_ostr, "adj2"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom"_ostr, "prst"_ostr, "bentConnector4"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm", "flipH", "1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm", "flipV", "1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm", "rot", "10800000"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[1]", - "name", "adj1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[2]", - "name", "adj2"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[3]", - "name", "adj3"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom", "prst", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm"_ostr, "flipH"_ostr, "1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm"_ostr, "flipV"_ostr, "1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm"_ostr, "rot"_ostr, + "10800000"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, + "name"_ostr, "adj1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, + "name"_ostr, "adj2"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[3]"_ostr, + "name"_ostr, "adj3"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom"_ostr, "prst"_ostr, "bentConnector5"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[5]/p:spPr/a:xfrm", "flipH", "1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[5]/p:spPr/a:xfrm", "rot", "16200000"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[5]/p:spPr/a:prstGeom", "prst", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[5]/p:spPr/a:xfrm"_ostr, "flipH"_ostr, "1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[5]/p:spPr/a:xfrm"_ostr, "rot"_ostr, + "16200000"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[5]/p:spPr/a:prstGeom"_ostr, "prst"_ostr, "curvedConnector2"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:xfrm", "flipH", "1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:xfrm", "rot", "16200000"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:prstGeom/a:avLst/a:gd", "name", - "adj1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:prstGeom", "prst", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:xfrm"_ostr, "flipH"_ostr, "1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:xfrm"_ostr, "rot"_ostr, + "16200000"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:prstGeom/a:avLst/a:gd"_ostr, + "name"_ostr, "adj1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:prstGeom"_ostr, "prst"_ostr, "curvedConnector3"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:xfrm", "flipH", "1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:xfrm", "flipV", "1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:xfrm", "rot", "10800000"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom/a:avLst/a:gd[1]", - "name", "adj1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom/a:avLst/a:gd[2]", - "name", "adj2"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom", "prst", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:xfrm"_ostr, "flipH"_ostr, "1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:xfrm"_ostr, "flipV"_ostr, "1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:xfrm"_ostr, "rot"_ostr, + "10800000"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, + "name"_ostr, "adj1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, + "name"_ostr, "adj2"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom"_ostr, "prst"_ostr, "curvedConnector4"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:xfrm", "flipV", "1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:xfrm", "rot", "16200000"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[1]", - "name", "adj1"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[2]", - "name", "adj2"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[3]", - "name", "adj3"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom", "prst", + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:xfrm"_ostr, "flipV"_ostr, "1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:xfrm"_ostr, "rot"_ostr, + "16200000"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, + "name"_ostr, "adj1"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, + "name"_ostr, "adj2"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[3]"_ostr, + "name"_ostr, "adj3"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom"_ostr, "prst"_ostr, "curvedConnector5"); } @@ -204,7 +211,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf130165) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "/p:sld", "showMasterSp", "0"); + assertXPath(pXmlDoc, "/p:sld"_ostr, "showMasterSp"_ostr, "0"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124781) @@ -213,12 +220,12 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124781) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc1 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[1]/a:r[2]/a:rPr", "baseline", - "33000"); + assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[1]/a:r[2]/a:rPr"_ostr, + "baseline"_ostr, "33000"); xmlDocUniquePtr pXmlDoc2 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc2, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[2]/a:r[2]/a:rPr", "baseline", - "-8000"); + assertXPath(pXmlDoc2, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[2]/a:r[2]/a:rPr"_ostr, + "baseline"_ostr, "-8000"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf144914) @@ -227,37 +234,37 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf144914) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc1 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", - "ppaction://hlinkshowjump?jump=firstslide"); + assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:nvSpPr/p:cNvPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinkshowjump?jump=firstslide"); xmlDocUniquePtr pXmlDoc2 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", - "ppaction://hlinkshowjump?jump=lastslide"); + assertXPath(pXmlDoc2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:nvSpPr/p:cNvPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinkshowjump?jump=lastslide"); xmlDocUniquePtr pXmlDoc3 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", - "ppaction://hlinkshowjump?jump=nextslide"); + assertXPath(pXmlDoc3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:nvSpPr/p:cNvPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinkshowjump?jump=nextslide"); xmlDocUniquePtr pXmlDoc4 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", - "ppaction://hlinkshowjump?jump=previousslide"); + assertXPath(pXmlDoc4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:nvSpPr/p:cNvPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinkshowjump?jump=previousslide"); xmlDocUniquePtr pXmlDoc5 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc5, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", - "ppaction://hlinksldjump"); + assertXPath(pXmlDoc5, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:nvSpPr/p:cNvPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinksldjump"); xmlDocUniquePtr pRelsDoc5 = parseExport("ppt/slides/_rels/slide1.xml.rels"); - assertXPath(pRelsDoc5, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", + assertXPath(pRelsDoc5, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "Target"_ostr, "slide2.xml"); xmlDocUniquePtr pXmlDoc6 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc6, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", - "ppaction://hlinkshowjump?jump=endshow"); + assertXPath(pXmlDoc6, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:nvSpPr/p:cNvPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinkshowjump?jump=endshow"); xmlDocUniquePtr pXmlDoc7 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc7, "/p:sld/p:cSld/p:spTree/p:sp[7]/p:nvSpPr/p:cNvPr/a:hlinkClick", "id", - "rId2"); + assertXPath(pXmlDoc7, "/p:sld/p:cSld/p:spTree/p:sp[7]/p:nvSpPr/p:cNvPr/a:hlinkClick"_ostr, + "id"_ostr, "rId2"); xmlDocUniquePtr pRelsDoc7 = parseExport("ppt/slides/_rels/slide1.xml.rels"); - assertXPath(pRelsDoc7, "/rels:Relationships/rels:Relationship[@Id='rId2']", "Target", + assertXPath(pRelsDoc7, "/rels:Relationships/rels:Relationship[@Id='rId2']"_ostr, "Target"_ostr, "http://www.example.com/"); } @@ -267,38 +274,38 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124232) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc1 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", - "ppaction://hlinkshowjump?jump=lastslide"); + assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinkshowjump?jump=lastslide"); xmlDocUniquePtr pXmlDoc2 = parseExport("ppt/slides/slide2.xml"); - assertXPath(pXmlDoc2, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", - "ppaction://hlinkshowjump?jump=nextslide"); + assertXPath(pXmlDoc2, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinkshowjump?jump=nextslide"); xmlDocUniquePtr pXmlDoc3 = parseExport("ppt/slides/slide3.xml"); - assertXPath(pXmlDoc3, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", - "ppaction://hlinkshowjump?jump=previousslide"); + assertXPath(pXmlDoc3, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinkshowjump?jump=previousslide"); xmlDocUniquePtr pXmlDoc4 = parseExport("ppt/slides/slide4.xml"); - assertXPath(pXmlDoc4, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "id", - "rId1"); + assertXPath(pXmlDoc4, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick"_ostr, + "id"_ostr, "rId1"); xmlDocUniquePtr pRelsDoc4 = parseExport("ppt/slides/_rels/slide4.xml.rels"); - assertXPath(pRelsDoc4, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", + assertXPath(pRelsDoc4, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "Target"_ostr, "http://www.example.com/"); xmlDocUniquePtr pXmlDoc5 = parseExport("ppt/slides/slide5.xml"); - assertXPath(pXmlDoc5, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", - "ppaction://hlinksldjump"); + assertXPath(pXmlDoc5, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinksldjump"); xmlDocUniquePtr pRelsDoc5 = parseExport("ppt/slides/_rels/slide5.xml.rels"); - assertXPath(pRelsDoc5, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", + assertXPath(pRelsDoc5, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "Target"_ostr, "slide6.xml"); xmlDocUniquePtr pXmlDoc6 = parseExport("ppt/slides/slide6.xml"); - assertXPath(pXmlDoc6, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", - "ppaction://hlinkshowjump?jump=endshow"); + assertXPath(pXmlDoc6, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinkshowjump?jump=endshow"); xmlDocUniquePtr pXmlDoc7 = parseExport("ppt/slides/slide7.xml"); - assertXPath(pXmlDoc7, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", - "ppaction://hlinkshowjump?jump=firstslide"); + assertXPath(pXmlDoc7, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinkshowjump?jump=firstslide"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143624) @@ -308,9 +315,9 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143624) xmlDocUniquePtr pXmlDoc = parseExport("ppt/presProps.xml"); - assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "useTimings", "0"); + assertXPath(pXmlDoc, "/p:presentationPr/p:showPr"_ostr, "useTimings"_ostr, "0"); - assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1"); + assertXPath(pXmlDoc, "/p:presentationPr/p:showPr"_ostr, "showNarration"_ostr, "1"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf142648) @@ -328,7 +335,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf142648) xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide2.xml.rels"); - assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", + assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "Target"_ostr, "slide1.xml"); } @@ -339,9 +346,9 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf47365) xmlDocUniquePtr pXmlDoc = parseExport("ppt/presProps.xml"); - assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "loop", "1"); + assertXPath(pXmlDoc, "/p:presentationPr/p:showPr"_ostr, "loop"_ostr, "1"); - assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1"); + assertXPath(pXmlDoc, "/p:presentationPr/p:showPr"_ostr, "showNarration"_ostr, "1"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf125071) @@ -351,8 +358,10 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf125071) xmlDocUniquePtr pXmlDoc = parseExport("ppt/presentation.xml"); - assertXPath(pXmlDoc, "/p:presentation/p:custShowLst/p:custShow[1]", "name", "Custom1"); - assertXPath(pXmlDoc, "/p:presentation/p:custShowLst/p:custShow[2]", "name", "Custom2"); + assertXPath(pXmlDoc, "/p:presentation/p:custShowLst/p:custShow[1]"_ostr, "name"_ostr, + "Custom1"); + assertXPath(pXmlDoc, "/p:presentation/p:custShowLst/p:custShow[2]"_ostr, "name"_ostr, + "Custom2"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf54037) @@ -363,13 +372,13 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf54037) xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide1.xml.rels"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[1]/a:r/a:rPr/a:hlinkClick", - "action", "ppaction://hlinksldjump"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[1]/a:r/a:rPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinksldjump"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[2]/a:r/a:rPr/a:hlinkClick", - "action", "ppaction://hlinkshowjump?jump=nextslide"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[2]/a:r/a:rPr/a:hlinkClick"_ostr, + "action"_ostr, "ppaction://hlinkshowjump?jump=nextslide"); - assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", + assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "Target"_ostr, "slide2.xml"); } @@ -1136,16 +1145,16 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf112633) // Check image with artistic effect exists in the slide assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/" - "a14:imgLayer/a14:imgEffect/a14:artisticPencilGrayscale", - "pencilSize", "80"); + "a14:imgLayer/a14:imgEffect/a14:artisticPencilGrayscale"_ostr, + "pencilSize"_ostr, "80"); // Check there is a relation with the .wdp file that contains the backed up image OUString sEmbedId1 = getXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:extLst/" - "a:ext/a14:imgProps/a14:imgLayer", - "embed"); + "a:ext/a14:imgProps/a14:imgLayer"_ostr, + "embed"_ostr); OUString sXmlPath = "/rels:Relationships/rels:Relationship[@Id='" + sEmbedId1 + "']"; - assertXPath(pRelsDoc, OUStringToOString(sXmlPath, RTL_TEXTENCODING_UTF8), "Target", + assertXPath(pRelsDoc, OUStringToOString(sXmlPath, RTL_TEXTENCODING_UTF8), "Target"_ostr, "../media/hdphoto1.wdp"); // Check the .wdp file exists @@ -1162,10 +1171,12 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128952) xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:off", "x", "360"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:off", "y", "-360"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:ext", "cx", "1919880"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:ext", "cy", "1462680"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:off"_ostr, "x"_ostr, "360"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:off"_ostr, "y"_ostr, "-360"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:ext"_ostr, "cx"_ostr, + "1919880"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:ext"_ostr, "cy"_ostr, + "1462680"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf127090) @@ -1175,7 +1186,8 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf127090) xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr", "rot", "-5400000"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr"_ostr, "rot"_ostr, + "-5400000"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testCustomXml) @@ -1190,8 +1202,8 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testCustomXml) CPPUNIT_ASSERT(pRelsDoc); // Check there is a relation to itemProps1.xml. - assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship", 1); - assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", + assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship"_ostr, 1); + assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "Target"_ostr, "itemProps1.xml"); std::unique_ptr<SvStream> pStream = parseExportStream(maTempFile.GetURL(), "ddp/ddpfile.xen"); @@ -1330,7 +1342,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testRoundtripPrstDash) for (sal_uInt16 i = 0; i < 10; i++) { OString sXmlPath = sStart + OString::number(i + 1) + sEnd; - OUString sResaved = getXPath(pXmlDoc, sXmlPath, "val"); + OUString sResaved = getXPath(pXmlDoc, sXmlPath, "val"_ostr); CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong prstDash", sOriginal[i], sResaved); } @@ -1359,7 +1371,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testDashOnHairline) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:ln/a:custDash/a:ds", 11); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:ln/a:custDash/a:ds"_ostr, 11); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testNarrationNonMediaShape) @@ -1386,7 +1398,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testCustomshapeBitmapfillSrcrect) // i.e. <a:srcRect> was exported as <a:fillRect> in <a:stretch>, which made part of the image // invisible. - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect"_ostr); // tdf#134210 // Original values of attribute of l and r in xml files: <a:srcRect l="4393" r="4393"/> @@ -1395,10 +1407,14 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testCustomshapeBitmapfillSrcrect) // future if we add core feature to LibreOffice, we should change the control value with // 4393. - assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "l"); - assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "r"); - assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "t"); - assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "b"); + assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect"_ostr, + "l"_ostr); + assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect"_ostr, + "r"_ostr); + assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect"_ostr, + "t"_ostr); + assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect"_ostr, + "b"_ostr); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf100348FontworkBitmapFill) @@ -1411,7 +1427,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf100348FontworkBitmapFill) xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); static constexpr OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr"_ostr); assertXPath(pXmlDoc, sPathStart + "/a:blipFill/a:blip", 1); - assertXPath(pXmlDoc, sPathStart + "/a:ln/a:solidFill/a:srgbClr", "val", "ffbf00"); + assertXPath(pXmlDoc, sPathStart + "/a:ln/a:solidFill/a:srgbClr", "val"_ostr, "ffbf00"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf100348FontworkGradientGlow) @@ -1423,9 +1439,10 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf100348FontworkGradientGlow) // Without the patch, fill was black and no glow applied. xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); static constexpr OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr"_ostr); - assertXPath(pXmlDoc, sPathStart + "/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", "8d281e"); - assertXPath(pXmlDoc, sPathStart + "/a:effectLst/a:glow", "rad", "63360"); - assertXPath(pXmlDoc, sPathStart + "/a:effectLst/a:glow/a:srgbClr", "val", "ff4500"); + assertXPath(pXmlDoc, sPathStart + "/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val"_ostr, + "8d281e"); + assertXPath(pXmlDoc, sPathStart + "/a:effectLst/a:glow", "rad"_ostr, "63360"); + assertXPath(pXmlDoc, sPathStart + "/a:effectLst/a:glow/a:srgbClr", "val"_ostr, "ff4500"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345FullTransparentGradient) @@ -1435,7 +1452,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345FullTransparentGradient) // Make sure the shape has no fill. Without the patch, fill was solid red. xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:noFill"); + assertXPath(pXmlDoc, "//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:noFill"_ostr); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientLinear) @@ -1446,14 +1463,14 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientLinear) // Make sure the shape has a lin fill. Without the patch, fill was solid red. xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); static constexpr OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill"_ostr); - assertXPath(pXmlDoc, sPathStart + "/a:lin", "ang", "3600000"); + assertXPath(pXmlDoc, sPathStart + "/a:lin", "ang"_ostr, "3600000"); assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2); - assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]", "pos", "25000"); - assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr", "val", "ff0000"); - assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val", "20000"); - assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]", "pos", "100000"); - assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr", "val", "ff0000"); - assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", "80000"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]", "pos"_ostr, "25000"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr", "val"_ostr, "ff0000"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val"_ostr, "20000"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]", "pos"_ostr, "100000"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr", "val"_ostr, "ff0000"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val"_ostr, "80000"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientRadial) @@ -1466,10 +1483,10 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientRadial) xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); static constexpr OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill"_ostr); assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2); - assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr", "val", "ff0000"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr", "val"_ostr, "ff0000"); assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", 0); - assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr", "val", "ffffff"); - assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", "0"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr", "val"_ostr, "ffffff"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val"_ostr, "0"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientAxial) @@ -1506,8 +1523,8 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf134969TransparencyOnColorGradien xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); static constexpr OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill"_ostr); assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2); - assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val", "60000"); - assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", "60000"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val"_ostr, "60000"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val"_ostr, "60000"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testArcTo) @@ -1517,10 +1534,10 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testArcTo) xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); static constexpr OString sPath("//a:custGeom/a:pathLst/a:path/a:arcTo"_ostr); - assertXPath(pXmlDoc, sPath, "wR", "3"); - assertXPath(pXmlDoc, sPath, "hR", "3"); - assertXPath(pXmlDoc, sPath, "stAng", "1800000"); - assertXPath(pXmlDoc, sPath, "swAng", "2700000"); + assertXPath(pXmlDoc, sPath, "wR"_ostr, "3"); + assertXPath(pXmlDoc, sPath, "hR"_ostr, "3"); + assertXPath(pXmlDoc, sPath, "stAng"_ostr, "1800000"); + assertXPath(pXmlDoc, sPath, "swAng"_ostr, "2700000"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testNarrationMimeType) @@ -1533,17 +1550,17 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testNarrationMimeType) // - Actual : application/vnd.sun.star.media // i.e. the mime type of the narration was incorrect. assertXPath(pXmlDoc, - "/ContentType:Types/ContentType:Override[@PartName='/ppt/media/media1.m4a']", - "ContentType", "audio/mp4"); + "/ContentType:Types/ContentType:Override[@PartName='/ppt/media/media1.m4a']"_ostr, + "ContentType"_ostr, "audio/mp4"); // Check if the bitmap of the media shape is exported correctly. xmlDocUniquePtr pSlideDoc = parseExport("ppt/slides/slide1.xml"); OUString aImageId - = getXPath(pSlideDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip", "embed"); + = getXPath(pSlideDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip"_ostr, "embed"_ostr); xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide1.xml.rels"); OUString aImagePath = "/rels:Relationships/rels:Relationship[@Id='" + aImageId + "']"; // Something like ../media/image2.png. - OUString aImageStreamName = getXPath(pRelsDoc, aImagePath.toUtf8(), "Target"); + OUString aImageStreamName = getXPath(pRelsDoc, aImagePath.toUtf8(), "Target"_ostr); OUString aImageAbsName = rtl::Uri::convertRelToAbs("file:///ppt/slides/", aImageStreamName); // Something like ppt/media/image2.png. OUString aImageRelName; @@ -1561,28 +1578,28 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testNarrationMimeType) // - Expected: 1 // - Actual : 0 // i.e. p:blipFill was missing its a:stretch child element, so the shape was invisible. - assertXPath(pSlideDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:stretch/a:fillRect", 1); + assertXPath(pSlideDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:stretch/a:fillRect"_ostr, 1); // Without the accompanying fix in place, this test would have failed with: // - ... no attribute 'cmd' exist // i.e. '<p:cmd type="call">' was written instead of '<p:cmd type="call" cmd="playFrom(0.0)">'. - assertXPath(pSlideDoc, "//p:cmd", "cmd", "playFrom(0.0)"); + assertXPath(pSlideDoc, "//p:cmd"_ostr, "cmd"_ostr, "playFrom(0.0)"); // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 // - Actual : 0 // i.e. <p:childTnLst> had no <p:audio> children, the whole audio animation node was lost. - assertXPath(pSlideDoc, "//p:childTnLst/p:audio/p:cMediaNode", 1); + assertXPath(pSlideDoc, "//p:childTnLst/p:audio/p:cMediaNode"_ostr, 1); // Without the accompanying fix in place, this test would have failed with: // - ... no attribute 'showWhenStopped' exist // i.e. <p:cMediaNode> had the default visibility -> bitmap was visible during slideshow. - assertXPath(pSlideDoc, "//p:childTnLst/p:audio/p:cMediaNode", "showWhenStopped", "0"); + assertXPath(pSlideDoc, "//p:childTnLst/p:audio/p:cMediaNode"_ostr, "showWhenStopped"_ostr, "0"); // Without the accompanying fix in place, this test would have failed with: // - ... no attribute 'isNarration' exist // i.e. <p:audio> was not a narration -> could not mass-remove narrations on the UI. - assertXPath(pSlideDoc, "//p:childTnLst/p:audio", "isNarration", "1"); + assertXPath(pSlideDoc, "//p:childTnLst/p:audio"_ostr, "isNarration"_ostr, "1"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf150316) @@ -1591,7 +1608,8 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf150316) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:p/a:pPr", "indent", "-343080"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:p/a:pPr"_ostr, "indent"_ostr, + "-343080"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf140865Wordart3D) @@ -1602,14 +1620,14 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf140865Wordart3D) // without the fix in place a:sp3d was lost on round trip, and so extrusion was lost. constexpr OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr"_ostr); - assertXPath(pXmlDoc, sPathStart + "/a:sp3d", "extrusionH", "342900"); - assertXPath(pXmlDoc, sPathStart + "/a:sp3d", "contourW", "12700"); - assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:bevelT", "w", "114300"); - assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:bevelT", "h", "38100"); - assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:bevelT", "prst", "softRound"); - assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:bevelB", "h", "152400"); - assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:extrusionClr/a:srgbClr", "val", "990000"); - assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:contourClr/a:srgbClr", "val", "009876"); + assertXPath(pXmlDoc, sPathStart + "/a:sp3d", "extrusionH"_ostr, "342900"); + assertXPath(pXmlDoc, sPathStart + "/a:sp3d", "contourW"_ostr, "12700"); + assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:bevelT", "w"_ostr, "114300"); + assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:bevelT", "h"_ostr, "38100"); + assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:bevelT", "prst"_ostr, "softRound"); + assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:bevelB", "h"_ostr, "152400"); + assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:extrusionClr/a:srgbClr", "val"_ostr, "990000"); + assertXPath(pXmlDoc, sPathStart + "/a:sp3d/a:contourClr/a:srgbClr", "val"_ostr, "009876"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124457) @@ -1619,15 +1637,17 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124457) xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, - "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/" - "p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par[1]/p:cTn", - "repeatCount", "3000"); + assertXPath( + pXmlDoc, + "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/" + "p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par[1]/p:cTn"_ostr, + "repeatCount"_ostr, "3000"); - assertXPath(pXmlDoc, - "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/" - "p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par[2]/p:cTn", - "repeatCount", "indefinite"); + assertXPath( + pXmlDoc, + "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/" + "p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par[2]/p:cTn"_ostr, + "repeatCount"_ostr, "indefinite"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143126) @@ -1637,9 +1657,9 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143126) xmlDocUniquePtr pXmlDoc = parseExport("ppt/presProps.xml"); - assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1"); - assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "st", "2"); - assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "end", "3"); + assertXPath(pXmlDoc, "/p:presentationPr/p:showPr"_ostr, "showNarration"_ostr, "1"); + assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg"_ostr, "st"_ostr, "2"); + assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg"_ostr, "end"_ostr, "3"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143129) @@ -1649,8 +1669,8 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143129) xmlDocUniquePtr pXmlDoc = parseExport("ppt/presProps.xml"); - assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1"); - assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:custShow", "id", "0"); + assertXPath(pXmlDoc, "/p:presentationPr/p:showPr"_ostr, "showNarration"_ostr, "1"); + assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:custShow"_ostr, "id"_ostr, "0"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf118045) @@ -1659,8 +1679,8 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf118045) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc1 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr/a:lnSpc/a:spcPct", "val", - "110000"); + assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr/a:lnSpc/a:spcPct"_ostr, + "val"_ostr, "110000"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf137675) @@ -1669,8 +1689,8 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf137675) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", "fill", - "none"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path"_ostr, + "fill"_ostr, "none"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf151134) @@ -1679,7 +1699,8 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf151134) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr", "lIns", "91440"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr"_ostr, "lIns"_ostr, + "91440"); } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 30301c6e4c16..0583233c9f06 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -84,19 +84,29 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testRepeatBitmapMode) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDocContent1 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile", "tx", "1269669"); - assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile", "ty", "186051"); - assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile", "sx", "100000"); - assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile", "sy", "100000"); - assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile", "algn", "tr"); + assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile"_ostr, "tx"_ostr, + "1269669"); + assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile"_ostr, "ty"_ostr, + "186051"); + assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile"_ostr, "sx"_ostr, + "100000"); + assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile"_ostr, "sy"_ostr, + "100000"); + assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile"_ostr, "algn"_ostr, + "tr"); // if the "Scale" setting is checked in the images settings dialog. xmlDocUniquePtr pXmlDocContent2 = parseExport("ppt/slides/slide2.xml"); - assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile", "tx", "0"); - assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile", "ty", "0"); - assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile", "sx", "682760"); - assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile", "sy", "639983"); - assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile", "algn", "ctr"); + assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile"_ostr, "tx"_ostr, + "0"); + assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile"_ostr, "ty"_ostr, + "0"); + assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile"_ostr, "sx"_ostr, + "682760"); + assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile"_ostr, "sy"_ostr, + "639983"); + assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile"_ostr, "algn"_ostr, + "ctr"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf153107) @@ -106,55 +116,55 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf153107) // placeholder xmlDocUniquePtr pXmlDocContent1 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile", "tx", - "1879200"); - assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile", "ty", - "83628"); - assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile", "sx", - "264773"); - assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile", "sy", - "91428"); - assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile", "algn", - "ctr"); + assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile"_ostr, + "tx"_ostr, "1879200"); + assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile"_ostr, + "ty"_ostr, "83628"); + assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile"_ostr, + "sx"_ostr, "264773"); + assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile"_ostr, + "sy"_ostr, "91428"); + assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile"_ostr, + "algn"_ostr, "ctr"); // custom shape xmlDocUniquePtr pXmlDocContent2 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile", "tx", - "198000"); - assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile", "ty", - "324000"); - assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile", "sx", - "69743"); - assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile", "sy", - "78709"); - assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile", "algn", - "tl"); + assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile"_ostr, + "tx"_ostr, "198000"); + assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile"_ostr, + "ty"_ostr, "324000"); + assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile"_ostr, + "sx"_ostr, "69743"); + assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile"_ostr, + "sy"_ostr, "78709"); + assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile"_ostr, + "algn"_ostr, "tl"); // polygon xmlDocUniquePtr pXmlDocContent3 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile", "tx", - "2073600"); - assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile", "ty", - "221760"); - assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile", "sx", - "182602"); - assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile", "sy", - "86580"); - assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile", "algn", - "ctr"); + assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile"_ostr, + "tx"_ostr, "2073600"); + assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile"_ostr, + "ty"_ostr, "221760"); + assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile"_ostr, + "sx"_ostr, "182602"); + assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile"_ostr, + "sy"_ostr, "86580"); + assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile"_ostr, + "algn"_ostr, "ctr"); // textbox xmlDocUniquePtr pXmlDocContent4 = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile", "tx", - "662400"); - assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile", "ty", - "760320"); - assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile", "sx", - "202891"); - assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile", "sy", - "129870"); - assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile", "algn", - "tl"); + assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile"_ostr, + "tx"_ostr, "662400"); + assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile"_ostr, + "ty"_ostr, "760320"); + assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile"_ostr, + "sx"_ostr, "202891"); + assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile"_ostr, + "sy"_ostr, "129870"); + assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile"_ostr, + "algn"_ostr, "tl"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf142291) @@ -165,24 +175,24 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf142291) xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc[1]/" - "a:tcPr/a:lnL/a:prstDash", - "val", "sysDashDotDot"); + "a:tcPr/a:lnL/a:prstDash"_ostr, + "val"_ostr, "sysDashDotDot"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc[1]/" - "a:tcPr/a:lnR/a:prstDash", - "val", "dot"); + "a:tcPr/a:lnR/a:prstDash"_ostr, + "val"_ostr, "dot"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc[1]/" - "a:tcPr/a:lnT/a:prstDash", - "val", "solid"); + "a:tcPr/a:lnT/a:prstDash"_ostr, + "val"_ostr, "solid"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc[1]/" - "a:tcPr/a:lnB/a:prstDash", - "val", "dash"); + "a:tcPr/a:lnB/a:prstDash"_ostr, + "val"_ostr, "dash"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc[2]/" - "a:tcPr/a:lnR/a:prstDash", - "val", "dashDot"); + "a:tcPr/a:lnR/a:prstDash"_ostr, + "val"_ostr, "dashDot"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf151492) @@ -191,8 +201,9 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf151492) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", - "idx", "0"); + assertXPath(pXmlDocContent, + "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn"_ostr, "idx"_ostr, + "0"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf149697) @@ -202,15 +213,19 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf149697) xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, - "/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", "5"); + "/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn"_ostr, + "idx"_ostr, "5"); assertXPath(pXmlDocContent, - "/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx", "4"); + "/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn"_ostr, + "idx"_ostr, "4"); assertXPath(pXmlDocContent, - "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", "3"); + "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn"_ostr, + "idx"_ostr, "3"); assertXPath(pXmlDocContent, - "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx", "1"); + "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn"_ostr, + "idx"_ostr, "1"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf149126) @@ -219,7 +234,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf149126) save("Impress Office Open XML"); xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom", "prst", + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom"_ostr, "prst"_ostr, "triangle"); } @@ -231,18 +246,18 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf131905) xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath( pXmlDocContent, - "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr[1]/a:tc/a:tcPr", - "anchor", "t"); + "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr[1]/a:tc/a:tcPr"_ostr, + "anchor"_ostr, "t"); assertXPath( pXmlDocContent, - "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr[2]/a:tc/a:tcPr", - "anchor", "ctr"); + "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr[2]/a:tc/a:tcPr"_ostr, + "anchor"_ostr, "ctr"); assertXPath( pXmlDocContent, - "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr[3]/a:tc/a:tcPr", - "anchor", "b"); + "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr[3]/a:tc/a:tcPr"_ostr, + "anchor"_ostr, "b"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf93883) @@ -266,19 +281,20 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testBnc822341) xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@ContentType='application/" - "vnd.openxmlformats-officedocument.wordprocessingml.document']", - "PartName", "/ppt/embeddings/oleObject1.docx"); + "vnd.openxmlformats-officedocument.wordprocessingml.document']"_ostr, + "PartName"_ostr, "/ppt/embeddings/oleObject1.docx"); xmlDocUniquePtr pXmlDocRels = parseExport("ppt/slides/_rels/slide1.xml.rels"); assertXPath( pXmlDocRels, - "/rels:Relationships/rels:Relationship[@Target='../embeddings/oleObject1.docx']", - "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + "/rels:Relationships/rels:Relationship[@Target='../embeddings/oleObject1.docx']"_ostr, + "Type"_ostr, + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, - "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/p:oleObj", - "progId", "Word.Document.12"); + "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/p:oleObj"_ostr, + "progId"_ostr, "Word.Document.12"); const SdrPage* pPage = GetPage(1); @@ -294,19 +310,20 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testBnc822341) xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@ContentType='application/" - "vnd.openxmlformats-officedocument.wordprocessingml.document']", - "PartName", "/ppt/embeddings/oleObject1.docx"); + "vnd.openxmlformats-officedocument.wordprocessingml.document']"_ostr, + "PartName"_ostr, "/ppt/embeddings/oleObject1.docx"); xmlDocUniquePtr pXmlDocRels = parseExport("ppt/slides/_rels/slide1.xml.rels"); assertXPath( pXmlDocRels, - "/rels:Relationships/rels:Relationship[@Target='../embeddings/oleObject1.docx']", - "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + "/rels:Relationships/rels:Relationship[@Target='../embeddings/oleObject1.docx']"_ostr, + "Type"_ostr, + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, - "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/p:oleObj", - "progId", "Word.Document.12"); + "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/p:oleObj"_ostr, + "progId"_ostr, "Word.Document.12"); const SdrPage* pPage = GetPage(1); @@ -325,11 +342,11 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testMathObject) // Export an LO specific ole object (imported from an ODP document) { xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice", - "Requires", "a14"); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice"_ostr, + "Requires"_ostr, "a14"); assertXPathContent(pXmlDocContent, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice/p:sp/p:txBody/a:p/" - "a14:m/m:oMath/m:r[1]/m:t", + "a14:m/m:oMath/m:r[1]/m:t"_ostr, ... etc. - the rest is truncated