diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-11-19 22:04:45 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-11-20 08:25:16 +0100 |
commit | e66ccbecfb414800271e066c630cf7e90d5f3b74 (patch) | |
tree | bda046a18e87b9aa90f3a228e9300c975ffaede2 /emfio | |
parent | 847db3fa1244c2707e1966d3e6579258bb6d8924 (diff) |
Extended loplugin:ostr: emfio
Change-Id: Ida43018a83c68f5d20dbee30325b8f32099e5b1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159713
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'emfio')
-rw-r--r-- | emfio/qa/cppunit/emf/EmfImportTest.cxx | 824 | ||||
-rw-r--r-- | emfio/qa/cppunit/wmf/wmfimporttest.cxx | 364 | ||||
-rw-r--r-- | emfio/source/reader/mtftools.cxx | 8 |
3 files changed, 620 insertions, 576 deletions
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx index 9e892b67eaa5..8a74745b6e12 100644 --- a/emfio/qa/cppunit/emf/EmfImportTest.cxx +++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx @@ -43,7 +43,7 @@ public: { } - const OString aXPathPrefix = "/primitive2D/metafile/transform/"; + const OString aXPathPrefix = "/primitive2D/metafile/transform/"_ostr; Primitive2DSequence parseEmf(std::u16string_view aSource); }; @@ -79,37 +79,38 @@ CPPUNIT_TEST_FIXTURE(Test, testPolyPolygon) CPPUNIT_ASSERT(pDocument); // Chart axis - assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path", "m0 0h19746v14817h-19746z"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path"_ostr, + "m0 0h19746v14817h-19746z"); assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor", 2); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]", "color", "#ffffff"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]", "color"_ostr, "#ffffff"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]/polypolygon", "path"_ostr, "m0 0h19781v14852h-19781z"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[2]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[2]/polypolygon", "path"_ostr, "m2574 13194v-12065h15303v12065z"); assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke", 44); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonstroke[1]/polygon", "2574,13194 2574,1129"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", "color", "#000000"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", "width", "0"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", "color"_ostr, "#000000"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", "width"_ostr, "0"); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonstroke[2]/polygon", "2574,1129 2574,1129"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", "color", "#000000"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", "width", "0"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", "color"_ostr, "#000000"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", "width"_ostr, "0"); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonstroke[10]/polygon", "8674,1129 8674,1129"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[10]/line", "color", "#000000"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[10]/line", "width", "0"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[10]/line", "color"_ostr, "#000000"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[10]/line", "width"_ostr, "0"); assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion", 28); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[6]", "width", "459"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[6]", "x", "9908"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[6]", "text", "0.5"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[6]", "fontcolor", "#000000"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[6]", "width"_ostr, "459"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[6]", "x"_ostr, "9908"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[6]", "text"_ostr, "0.5"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[6]", "fontcolor"_ostr, "#000000"); assertXPath(pDocument, aXPathPrefix + "mask/pointarray", 98); - assertXPath(pDocument, aXPathPrefix + "mask/pointarray[1]", "color", "#000000"); - assertXPath(pDocument, aXPathPrefix + "mask/pointarray[1]/point", "x", "2574"); - assertXPath(pDocument, aXPathPrefix + "mask/pointarray[1]/point", "y", "1129"); + assertXPath(pDocument, aXPathPrefix + "mask/pointarray[1]", "color"_ostr, "#000000"); + assertXPath(pDocument, aXPathPrefix + "mask/pointarray[1]/point", "x"_ostr, "2574"); + assertXPath(pDocument, aXPathPrefix + "mask/pointarray[1]/point", "y"_ostr, "1129"); } CPPUNIT_TEST_FIXTURE(Test, testDrawImagePointsTypeBitmap) @@ -124,15 +125,15 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawImagePointsTypeBitmap) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color", "#0080ff"); - assertXPath(pDocument, aXPathPrefix + "bitmap", "xy11", "5346"); - assertXPath(pDocument, aXPathPrefix + "bitmap", "xy12", "0"); - assertXPath(pDocument, aXPathPrefix + "bitmap", "xy13", "5558"); - assertXPath(pDocument, aXPathPrefix + "bitmap", "xy21", "0"); - assertXPath(pDocument, aXPathPrefix + "bitmap", "xy22", "4716"); - assertXPath(pDocument, aXPathPrefix + "bitmap", "xy23", "5564"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color"_ostr, "#0080ff"); + assertXPath(pDocument, aXPathPrefix + "bitmap", "xy11"_ostr, "5346"); + assertXPath(pDocument, aXPathPrefix + "bitmap", "xy12"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "bitmap", "xy13"_ostr, "5558"); + assertXPath(pDocument, aXPathPrefix + "bitmap", "xy21"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "bitmap", "xy22"_ostr, "4716"); + assertXPath(pDocument, aXPathPrefix + "bitmap", "xy23"_ostr, "5564"); assertXPath( - pDocument, aXPathPrefix + "bitmap/data[2]", "row", + pDocument, aXPathPrefix + "bitmap/data[2]", "row"_ostr, "020202,ffffff,ffffff,ffffff,fefefe,ffffff,ffffff,fefefe,ffffff,ffffff,f8f8f8,ffffff," "fdfdfd,ffffff,ffffff,fdfdfd,ffffff,ffffff,ffffff,fbfbfb,010101,ffffff,fefefe,ffffff," "ffffff,fbfbfb,ffffff,fdfdfd,fcfcfc,fdfdfd,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff," @@ -156,12 +157,14 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawString) CPPUNIT_ASSERT(pDocument); // check correct import of the DrawString: height, position, text, color and font - assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "height", "120"); - assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "x", "817"); - assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "y", "1137"); - assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "text", "TEST"); - assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "fontcolor", "#000000"); - assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "familyname", "CALIBRI"); + assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "height"_ostr, "120"); + assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "x"_ostr, "817"); + assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "y"_ostr, "1137"); + assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "text"_ostr, "TEST"); + assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "fontcolor"_ostr, + "#000000"); + assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "familyname"_ostr, + "CALIBRI"); #endif } @@ -177,60 +180,76 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawStringAlign) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "mask/transform", 9); - assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "width", "12"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "height", "12"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "x", "12"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "y", "22"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "text", "HLVT"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "fontcolor", + assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "width"_ostr, + "12"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "height"_ostr, + "12"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "x"_ostr, "12"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "y"_ostr, "22"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "text"_ostr, + "HLVT"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "fontcolor"_ostr, "#000000"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "familyname", + assertXPath(pDocument, aXPathPrefix + "mask/transform[1]/textsimpleportion", "familyname"_ostr, "ARIAL"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "width", "12"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "height", "12"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "x", "143"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "y", "22"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "text", "HCVT"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "width"_ostr, + "12"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "height"_ostr, + "12"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "x"_ostr, "143"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "y"_ostr, "22"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "text"_ostr, + "HCVT"); // TODO Make the position of the text the same across the platforms (Arial vs Liberation Sans). // This is usually 276, but can be 275 as well; depends on what fonts are installed? sal_Int32 nX - = getXPath(pDocument, aXPathPrefix + "mask/transform[3]/textsimpleportion", "x").toInt32(); + = getXPath(pDocument, aXPathPrefix + "mask/transform[3]/textsimpleportion", "x"_ostr) + .toInt32(); CPPUNIT_ASSERT(nX >= 275); CPPUNIT_ASSERT(nX <= 276); - assertXPath(pDocument, aXPathPrefix + "mask/transform[3]/textsimpleportion", "y", "22"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[3]/textsimpleportion", "text", "HRVT"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[3]/textsimpleportion", "y"_ostr, "22"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[3]/textsimpleportion", "text"_ostr, + "HRVT"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[4]/textsimpleportion", "x", "12"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[4]/textsimpleportion", "y", "66"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[4]/textsimpleportion", "text", "HLVC"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[4]/textsimpleportion", "x"_ostr, "12"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[4]/textsimpleportion", "y"_ostr, "66"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[4]/textsimpleportion", "text"_ostr, + "HLVC"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[5]/textsimpleportion", "x", "142"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[5]/textsimpleportion", "y", "66"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[5]/textsimpleportion", "text", "HCVC"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[5]/textsimpleportion", "x"_ostr, "142"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[5]/textsimpleportion", "y"_ostr, "66"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[5]/textsimpleportion", "text"_ostr, + "HCVC"); // This is usually 274, but can be 273 as well; depends on what fonts are installed? - nX = getXPath(pDocument, aXPathPrefix + "mask/transform[6]/textsimpleportion", "x").toInt32(); + nX = getXPath(pDocument, aXPathPrefix + "mask/transform[6]/textsimpleportion", "x"_ostr) + .toInt32(); CPPUNIT_ASSERT(nX >= 273); CPPUNIT_ASSERT(nX <= 274); - assertXPath(pDocument, aXPathPrefix + "mask/transform[6]/textsimpleportion", "y", "66"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[6]/textsimpleportion", "text", "HRVC"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[6]/textsimpleportion", "y"_ostr, "66"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[6]/textsimpleportion", "text"_ostr, + "HRVC"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[7]/textsimpleportion", "x", "12"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[7]/textsimpleportion", "y", "110"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[7]/textsimpleportion", "text", "HLVB"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[7]/textsimpleportion", "x"_ostr, "12"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[7]/textsimpleportion", "y"_ostr, "110"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[7]/textsimpleportion", "text"_ostr, + "HLVB"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[8]/textsimpleportion", "x", "143"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[8]/textsimpleportion", "y", "110"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[8]/textsimpleportion", "text", "HCVB"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[8]/textsimpleportion", "x"_ostr, "143"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[8]/textsimpleportion", "y"_ostr, "110"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[8]/textsimpleportion", "text"_ostr, + "HCVB"); // This is usually 275, but can be 274 as well; depends on what fonts are installed? - nX = getXPath(pDocument, aXPathPrefix + "mask/transform[9]/textsimpleportion", "x").toInt32(); + nX = getXPath(pDocument, aXPathPrefix + "mask/transform[9]/textsimpleportion", "x"_ostr) + .toInt32(); CPPUNIT_ASSERT(nX >= 274); CPPUNIT_ASSERT(nX <= 275); - assertXPath(pDocument, aXPathPrefix + "mask/transform[9]/textsimpleportion", "y", "110"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[9]/textsimpleportion", "text", "HRVB"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[9]/textsimpleportion", "y"_ostr, "110"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[9]/textsimpleportion", "text"_ostr, + "HRVB"); #endif } @@ -246,20 +265,20 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawStringTransparent) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "mask/transform/unifiedtransparence", "transparence", + assertXPath(pDocument, aXPathPrefix + "mask/transform/unifiedtransparence", "transparence"_ostr, "50"); assertXPath(pDocument, aXPathPrefix + "mask/transform/unifiedtransparence/textsimpleportion", - "height", "24"); + "height"_ostr, "24"); assertXPath(pDocument, aXPathPrefix + "mask/transform/unifiedtransparence/textsimpleportion", - "x", "66"); + "x"_ostr, "66"); assertXPath(pDocument, aXPathPrefix + "mask/transform/unifiedtransparence/textsimpleportion", - "y", "74"); + "y"_ostr, "74"); assertXPath(pDocument, aXPathPrefix + "mask/transform/unifiedtransparence/textsimpleportion", - "text", "Transparent Text"); + "text"_ostr, "Transparent Text"); assertXPath(pDocument, aXPathPrefix + "mask/transform/unifiedtransparence/textsimpleportion", - "fontcolor", "#0000ff"); + "fontcolor"_ostr, "#0000ff"); assertXPath(pDocument, aXPathPrefix + "mask/transform/unifiedtransparence/textsimpleportion", - "familyname", "ARIAL"); + "familyname"_ostr, "ARIAL"); #endif } @@ -272,14 +291,15 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawStringWithBrush) drawinglayer::Primitive2dXmlDump dumper; xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "xy11", "20"); - assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "xy13", "16"); - assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "xy22", "20"); - assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "xy33", "1"); - assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "text", + assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "xy11"_ostr, "20"); + assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "xy13"_ostr, "16"); + assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "xy22"_ostr, "20"); + assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "xy33"_ostr, "1"); + assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "text"_ostr, "0123456789ABCDEF"); - assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "fontcolor", "#a50021"); - assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "familyname", + assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "fontcolor"_ostr, + "#a50021"); + assertXPath(pDocument, aXPathPrefix + "transform/textdecoratedportion", "familyname"_ostr, "TIMES NEW ROMAN"); } @@ -295,20 +315,22 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawBeziers) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", 4); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color"_ostr, "#000000"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow", 9); - assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[9]/line", "color", "#00ff00"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[9]/line", "color"_ostr, "#00ff00"); assertXPath(pDocument, aXPathPrefix + "transform", 5); - assertXPath(pDocument, aXPathPrefix + "transform[1]/textsimpleportion", "fontcolor", "#000000"); - assertXPath(pDocument, aXPathPrefix + "transform[1]/textsimpleportion", "text", "% Efficiency"); - assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy11", "0"); - assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy12", "4"); - assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy13", "800"); - assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy21", "-4"); - assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy22", "0"); - assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy23", "3195"); + assertXPath(pDocument, aXPathPrefix + "transform[1]/textsimpleportion", "fontcolor"_ostr, + "#000000"); + assertXPath(pDocument, aXPathPrefix + "transform[1]/textsimpleportion", "text"_ostr, + "% Efficiency"); + assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy11"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy12"_ostr, "4"); + assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy13"_ostr, "800"); + assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy21"_ostr, "-4"); + assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy22"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy23"_ostr, "3195"); } CPPUNIT_TEST_FIXTURE(Test, testDrawLine) @@ -322,15 +344,16 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawLine) CPPUNIT_ASSERT(pDocument); // check correct import of the DrawLine: color and width of the line - assertXPath(pDocument, aXPathPrefix + "mask/unifiedtransparence", "transparence", "14"); + assertXPath(pDocument, aXPathPrefix + "mask/unifiedtransparence", "transparence"_ostr, "14"); assertXPath(pDocument, aXPathPrefix + "mask/unifiedtransparence/polypolygonstroke/line", - "color", "#c01002"); + "color"_ostr, "#c01002"); assertXPath(pDocument, aXPathPrefix + "mask/unifiedtransparence/polypolygonstroke/line", - "width", "115"); + "width"_ostr, "115"); assertXPath(pDocument, aXPathPrefix + "mask/unifiedtransparence/polypolygonstroke/line", - "linecap", "BUTT"); + "linecap"_ostr, "BUTT"); assertXPath(pDocument, aXPathPrefix + "mask/unifiedtransparence/polypolygonstroke/polypolygon", - "path", "m55.5192348773662 403.573503917507 874.352660545936-345.821325648415"); + "path"_ostr, + "m55.5192348773662 403.573503917507 874.352660545936-345.821325648415"); } CPPUNIT_TEST_FIXTURE(Test, testDrawLineWithCaps) @@ -345,46 +368,46 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawLineWithCaps) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow", 3); - assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[1]/line", "width", "211"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[1]/line", "width"_ostr, "211"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[1]/stroke", 0); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[1]/linestartattribute/polypolygon", - "path", "m0-1 1 2h-2z"); + "path"_ostr, "m0-1 1 2h-2z"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[1]/lineendattribute", 0); - assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[2]/line", "width", "211"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[2]/line", "width"_ostr, "211"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[2]/stroke", 0); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[2]/linestartattribute/polypolygon", - "path", "m0-1 1 2h-2z"); + "path"_ostr, "m0-1 1 2h-2z"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[2]/lineendattribute", 0); - assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[3]/line", "width", "423"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[3]/line", "width"_ostr, "423"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[3]/stroke", 0); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[3]/linestartattribute", 0); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[3]/lineendattribute/polypolygon", - "path", "m-1-1h2v2h-2z"); + "path"_ostr, "m-1-1h2v2h-2z"); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence", 3); - assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]", "transparence", "39"); + assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]", "transparence"_ostr, "39"); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]/polygonstrokearrow/linestartattribute/polypolygon", - "path", + "path"_ostr, "m-1 1h2v-1l-0.0764-0.3827-0.2165-0.3244-0.3244-0.2165-0.3827-0.0764-0.3827 " "0.0764-0.3244 0.2165-0.2165 0.3244-0.0764 0.3827z"); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]/polygonstrokearrow/lineendattribute/polypolygon", - "path", "m-1 1h2v-1l-1-1-1 1z"); + "path"_ostr, "m-1 1h2v-1l-1-1-1 1z"); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[2]/polygonstrokearrow/linestartattribute", 0); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[2]/polygonstrokearrow/lineendattribute/polypolygon", - "path", "m-1-1h2v2h-2z"); + "path"_ostr, "m-1-1h2v2h-2z"); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[3]/polygonstrokearrow/lineendattribute/polypolygon", - "path", "m0-1 1 1-0.5 0.5v0.5h-1v-0.5l-0.5-0.5z"); + "path"_ostr, "m0-1 1 1-0.5 0.5v0.5h-1v-0.5l-0.5-0.5z"); } CPPUNIT_TEST_FIXTURE(Test, testDrawLineWithDash) @@ -400,44 +423,46 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawLineWithDash) // check correct import of the DrawLine: color and width of the line assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke", 10); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[1]/line", "color", "#000000"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[1]/line", "width", "185"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[1]/line", "color"_ostr, + "#000000"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[1]/line", "width"_ostr, "185"); assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[1]/stroke", 0); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[2]/line", "width", "185"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[2]/stroke", "dotDashArray", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[2]/line", "width"_ostr, "185"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[2]/stroke", "dotDashArray"_ostr, "185 185 "); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[3]/line", "width", "185"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[3]/stroke", "dotDashArray", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[3]/line", "width"_ostr, "185"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[3]/stroke", "dotDashArray"_ostr, "556 185 "); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[4]/line", "width", "185"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[4]/stroke", "dotDashArray", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[4]/line", "width"_ostr, "185"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[4]/stroke", "dotDashArray"_ostr, "556 185 185 185 "); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[5]/line", "width", "370"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[5]/stroke", "dotDashArray", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[5]/line", "width"_ostr, "370"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[5]/stroke", "dotDashArray"_ostr, "556 185 185 185 185 185 "); assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow", 2); //TODO polypolygonstroke[6-9]/stroke add support for PenDataDashedLineOffset - assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow[1]/line", "width", "370"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow[1]/stroke", "dotDashArray", + assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow[1]/line", "width"_ostr, "370"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow[1]/stroke", "dotDashArray"_ostr, "1851 741 5554 1481 "); // Arrows on both ends assertXPath(pDocument, - aXPathPrefix + "mask/polygonstrokearrow[1]/linestartattribute/polypolygon", "path", - "m0-1 1 2h-2z"); + aXPathPrefix + "mask/polygonstrokearrow[1]/linestartattribute/polypolygon", + "path"_ostr, "m0-1 1 2h-2z"); assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow[1]/lineendattribute/polypolygon", - "path", "m0-1 1 2h-2z"); + "path"_ostr, "m0-1 1 2h-2z"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow[2]/line", "width", "370"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow[2]/stroke", "dotDashArray", + assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow[2]/line", "width"_ostr, "370"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow[2]/stroke", "dotDashArray"_ostr, "1852 741 5555 1481 "); assertXPath(pDocument, - aXPathPrefix + "mask/polygonstrokearrow[2]/linestartattribute/polypolygon", "path", + aXPathPrefix + "mask/polygonstrokearrow[2]/linestartattribute/polypolygon", + "path"_ostr, "m-1 1h2v-1l-0.0764-0.3827-0.2165-0.3244-0.3244-0.2165-0.3827-0.0764-0.3827 " "0.0764-0.3244 0.2165-0.2165 0.3244-0.0764 0.3827z"); assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow[2]/lineendattribute/polypolygon", - "path", + "path"_ostr, "m-1 1h2v-1l-0.0764-0.3827-0.2165-0.3244-0.3244-0.2165-0.3827-0.0764-0.3827 " "0.0764-0.3244 0.2165-0.2165 0.3244-0.0764 0.3827z"); } @@ -451,34 +476,37 @@ CPPUNIT_TEST_FIXTURE(Test, testLinearGradient) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, "/primitive2D/metafile/transform", "xy11", "1"); - assertXPath(pDocument, "/primitive2D/metafile/transform", "xy12", "0"); - assertXPath(pDocument, "/primitive2D/metafile/transform", "xy13", "0"); - assertXPath(pDocument, "/primitive2D/metafile/transform", "xy21", "0"); - assertXPath(pDocument, "/primitive2D/metafile/transform", "xy22", "1"); - assertXPath(pDocument, "/primitive2D/metafile/transform", "xy23", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "height", "7610"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "width", "15232"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path", "m0 0h15232v7610h-15232z"); - - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "spreadmethod", "repeat"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "startx", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "starty", "-1"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "endx", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "endy", "-1"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "opacity", + assertXPath(pDocument, "/primitive2D/metafile/transform"_ostr, "xy11"_ostr, "1"); + assertXPath(pDocument, "/primitive2D/metafile/transform"_ostr, "xy12"_ostr, "0"); + assertXPath(pDocument, "/primitive2D/metafile/transform"_ostr, "xy13"_ostr, "0"); + assertXPath(pDocument, "/primitive2D/metafile/transform"_ostr, "xy21"_ostr, "0"); + assertXPath(pDocument, "/primitive2D/metafile/transform"_ostr, "xy22"_ostr, "1"); + assertXPath(pDocument, "/primitive2D/metafile/transform"_ostr, "xy23"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "height"_ostr, "7610"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "width"_ostr, "15232"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path"_ostr, + "m0 0h15232v7610h-15232z"); + + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "spreadmethod"_ostr, + "repeat"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "startx"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "starty"_ostr, "-1"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "endx"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "endy"_ostr, "-1"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "opacity"_ostr, "0.392156862745098"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]/polypolygon", "path"_ostr, "m0 0.216110019646294h7615.75822989746v7610.21611001965h-7615.75822989746z"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "spreadmethod", "repeat"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "startx", "-1"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "starty", "-1"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "endx", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "endy", "-1"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "opacity", "1"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "spreadmethod"_ostr, + "repeat"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "startx"_ostr, "-1"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "starty"_ostr, "-1"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "endx"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "endy"_ostr, "-1"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "opacity"_ostr, "1"); assertXPath( - pDocument, aXPathPrefix + "mask/svglineargradient[2]/polypolygon", "path", + pDocument, aXPathPrefix + "mask/svglineargradient[2]/polypolygon", "path"_ostr, "m7615.75822989746 0.216110019646294h7615.75822989746v7610.21611001965h-7615.75822989746z"); } @@ -493,29 +521,29 @@ CPPUNIT_TEST_FIXTURE(Test, testTextMapMode) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", 2); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color", "#ffffff"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color"_ostr, "#ffffff"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]/polypolygon", "path"_ostr, "m0 0h3542v4647h-3542z"); assertXPath(pDocument, aXPathPrefix + "textsimpleportion", 20); - assertXPath(pDocument, aXPathPrefix + "textsimpleportion[1]", "text", "N"); - assertXPath(pDocument, aXPathPrefix + "textsimpleportion[1]", "fontcolor", "#4a70e3"); - assertXPath(pDocument, aXPathPrefix + "textsimpleportion[1]", "x", "2099"); - assertXPath(pDocument, aXPathPrefix + "textsimpleportion[1]", "y", "1859"); + assertXPath(pDocument, aXPathPrefix + "textsimpleportion[1]", "text"_ostr, "N"); + assertXPath(pDocument, aXPathPrefix + "textsimpleportion[1]", "fontcolor"_ostr, "#4a70e3"); + assertXPath(pDocument, aXPathPrefix + "textsimpleportion[1]", "x"_ostr, "2099"); + assertXPath(pDocument, aXPathPrefix + "textsimpleportion[1]", "y"_ostr, "1859"); assertXPath(pDocument, aXPathPrefix + "polygonstroke", 138); assertXPathContent(pDocument, aXPathPrefix + "polygonstroke[1]/polygon", "2142,1638 2142,1489"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke[1]/line", "color", "#4a70e3"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke[1]/line", "width", "11"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke[1]/line", "color"_ostr, "#4a70e3"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke[1]/line", "width"_ostr, "11"); assertXPathContent(pDocument, aXPathPrefix + "polygonstroke[10]/polygon", "1967,1029 1869,952"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke[10]/line", "color", "#4a70e3"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke[10]/line", "width", "11"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke[10]/line", "color"_ostr, "#4a70e3"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke[10]/line", "width"_ostr, "11"); assertXPathContent(pDocument, aXPathPrefix + "polygonstroke[20]/polygon", "2710,1113 2873,1330"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke[20]/line", "color", "#666666"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke[20]/line", "width", "11"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke[20]/line", "color"_ostr, "#666666"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke[20]/line", "width"_ostr, "11"); } CPPUNIT_TEST_FIXTURE(Test, testEnglishMapMode) @@ -530,25 +558,25 @@ CPPUNIT_TEST_FIXTURE(Test, testEnglishMapMode) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", 1); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygon[1]", "path", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygon[1]", "path"_ostr, "m0 0h29699v20999h-29699z"); assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor", 3); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]", "color", "#ffffad"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]", "color"_ostr, "#ffffad"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]/polypolygon", "path"_ostr, "m-1-1h29700v21001h-29700z"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[2]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[2]/polypolygon", "path"_ostr, "m1058 7937v5293h3175v-1059h-2118v-4234z"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[3]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[3]/polypolygon", "path"_ostr, "m12699 1058h4234v1060h-1587v4231h-1059v-4231h-1588z"); assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion", 4); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "text", "UL"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "fontcolor", "#000000"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "x", "106"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "y", "459"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "width", "424"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "height", "424"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "text"_ostr, "UL"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "fontcolor"_ostr, "#000000"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "x"_ostr, "106"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "y"_ostr, "459"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "width"_ostr, "424"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "height"_ostr, "424"); assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline", 3); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonhairline[1]/polygon", @@ -572,8 +600,8 @@ CPPUNIT_TEST_FIXTURE(Test, testRectangleWithModifyWorldTransform) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", 1); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color", "#ffffff"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color"_ostr, "#ffffff"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]/polypolygon", "path"_ostr, "m1042 417 918 529 353 610-918-528z"); assertXPath(pDocument, aXPathPrefix + "polygonstroke", 1); @@ -591,8 +619,8 @@ CPPUNIT_TEST_FIXTURE(Test, testChordWithModifyWorldTransform) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color", "#ffffff"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color"_ostr, "#ffffff"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor/polypolygon", "path"_ostr, "m590 448-21 45-66 24-34 12-33 12-21 45-33 12 12 33-33 12 12 33 12 34 33-12 12 33 " "34-12 33-12 45 21 33-12 33-12 46 21 66-25 33-12 66-24 34-12 66-24z"); assertXPathContent(pDocument, aXPathPrefix + "polygonstroke/polygon", @@ -612,7 +640,8 @@ CPPUNIT_TEST_FIXTURE(Test, testArcStartPointEqualEndPoint) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "mask/group/mask/polygonhairline", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "mask/group/mask/polygonhairline", "color"_ostr, + "#000000"); assertXPathContent( pDocument, aXPathPrefix + "mask/group/mask/polygonhairline/polygon", "11886,23133 11970,23223 12051,23316 12131,23410 12208,23506 12282,23604 12354,23704 " @@ -661,7 +690,7 @@ CPPUNIT_TEST_FIXTURE(Test, testArcInsideWronglyDefinedRectangle) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "polygonhairline", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonhairline", "color"_ostr, "#000000"); assertXPathContent( pDocument, aXPathPrefix + "polygonhairline/polygon", "1630,1460 1650,1470 1670,1480 1700,1490 1720,1500 1750,1510 1770,1520 1800,1530 1820,1530 " @@ -688,7 +717,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEllipseWithSelectClipPath) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "group/mask/polypolygon", 1); - assertXPath(pDocument, aXPathPrefix + "group/mask/polypolygon[1]", "path", + assertXPath(pDocument, aXPathPrefix + "group/mask/polypolygon[1]", "path"_ostr, "m2790 " "776v-36-35h-36v-35l-35-35-35-36h-36l-35-35-35-35h-35-36l-35-35h-35-36l-35-36h-35-" "36l-35-35h-35-71-35l-36-35h-70-35-36-70l-36-35h-35-71-35-71-35-71-35-35-71-35-71-" @@ -699,9 +728,10 @@ CPPUNIT_TEST_FIXTURE(Test, testEllipseWithSelectClipPath) "35l35-35h36 35l35-35h36 35l35-36h36 35l35-35 35-35h36l35-35 35-36v-35h36v-35z"); assertXPath(pDocument, aXPathPrefix + "group/mask/polypolygoncolor", 1); - assertXPath(pDocument, aXPathPrefix + "group/mask/polypolygoncolor[1]", "color", "#ffff00"); - assertXPath(pDocument, aXPathPrefix + "group/mask/polypolygoncolor[1]/polypolygon[1]", "path", - "m353 353h2472v1057h-2472z"); + assertXPath(pDocument, aXPathPrefix + "group/mask/polypolygoncolor[1]", "color"_ostr, + "#ffff00"); + assertXPath(pDocument, aXPathPrefix + "group/mask/polypolygoncolor[1]/polypolygon[1]", + "path"_ostr, "m353 353h2472v1057h-2472z"); assertXPath(pDocument, aXPathPrefix + "group/mask/polygonstroke", 1); assertXPathContent(pDocument, aXPathPrefix + "group/mask/polygonstroke[1]/polygon", @@ -718,11 +748,11 @@ CPPUNIT_TEST_FIXTURE(Test, testEllipseXformIntersectClipRect) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path", "m0 0h3000v2000h-3000z"); - assertXPath(pDocument, aXPathPrefix + "mask/group/mask/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path"_ostr, "m0 0h3000v2000h-3000z"); + assertXPath(pDocument, aXPathPrefix + "mask/group/mask/polypolygon", "path"_ostr, "m370 152 1128-409 592 1623-1128 410z"); assertXPath( - pDocument, aXPathPrefix + "mask/group/mask/polypolygoncolor/polypolygon", "path", + pDocument, aXPathPrefix + "mask/group/mask/polypolygoncolor/polypolygon", "path"_ostr, "m3613 287-12-33-12-33-12-33-12-33-33 12-12-34-13-33-45-21-12-33-33 " "12-12-33-45-21-46-21-12-33-33 12-12-33-45-21-33 12-46-21-45-21-33 12-45-21-34 12-45-21-33 " "12-45-21-34 12-45-21-33 12-45-21-33 12-34 12-45-21-33 12-33 12-45-21-34 12-66 24-45-21-33 " @@ -774,16 +804,16 @@ CPPUNIT_TEST_FIXTURE(Test, testSetArcDirection) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color", "#ffffff"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color"_ostr, "#ffffff"); assertXPath( - pDocument, aXPathPrefix + "polypolygoncolor/polypolygon", "path", + pDocument, aXPathPrefix + "polypolygoncolor/polypolygon", "path"_ostr, "m1640 1570-1000-950 50-50 50-50 50-50 50-40 60-40 50-40 60-30 60-40 60-20 60-30 70-20 " "60-20 70-10 60-20h70l70-10h60 70l70 10 60 10 70 10 70 20 60 20 60 20 70 30 60 30 60 30 50 " "40 60 40 50 40 50 40 50 50 50 50 50 50 40 60 40 60 40 60 30 60 30 60 30 60 20 70 30 70 10 " "60 20 70 10 70 10 70 10 70v80 70l-10 70v70l-10 70-20 70-20 70z"); assertXPath(pDocument, aXPathPrefix + "polygonhairline", 2); - assertXPath(pDocument, aXPathPrefix + "polygonhairline[1]", "color", "#000000"); - assertXPath(pDocument, aXPathPrefix + "polygonhairline[2]", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonhairline[1]", "color"_ostr, "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonhairline[2]", "color"_ostr, "#000000"); assertXPath(pDocument, aXPathPrefix + "polygonhairline", 2); assertXPathContent( pDocument, aXPathPrefix + "polygonhairline[1]/polygon", @@ -822,20 +852,20 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawPolyLine16WithClip) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path", "m0 0h3943v3939h-3943z"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path"_ostr, "m0 0h3943v3939h-3943z"); assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor", 1); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]/polypolygon", "path"_ostr, "m1323 0h1323v1322h1323v1322h-1323v1322h-1323v-1322h-1323v-1322h1323z"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]", "color", "#b4ffff"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]", "color"_ostr, "#b4ffff"); assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline", 1); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonhairline[1]/polygon", "1323,0 2646,0 2646,1322 3969,1322 3969,2644 2646,2644 2646,3966 1323,3966 " "1323,2644 0,2644 0,1322 1323,1322"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline[1]", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline[1]", "color"_ostr, "#000000"); - assertXPath(pDocument, aXPathPrefix + "mask/group[1]/mask/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/group[1]/mask/polypolygon", "path"_ostr, "m2646 0v1322h1323v1322h-1323v1322h-1323v-1322h-1323v-1322h1323v-1322"); assertXPathContent(pDocument, aXPathPrefix + "mask/group[1]/mask/polygonstroke/polygon", "0,793 3969,4230"); @@ -850,18 +880,18 @@ CPPUNIT_TEST_FIXTURE(Test, testFillRegion) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path", "m0 0h3943v3939h-3943z"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path"_ostr, "m0 0h3943v3939h-3943z"); assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor", 1); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]/polypolygon", "path"_ostr, "m1323 0h1323v1322h1323v1322h-1323v1322h-1323v-1322h-1323v-1322h1323z"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]", "color", "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]", "color"_ostr, "#ff0000"); assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline", 1); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonhairline[1]/polygon", "1323,0 2646,0 2646,1322 3969,1322 3969,2644 2646,2644 2646,3966 1323,3966 " "1323,2644 0,2644 0,1322 1323,1322"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline[1]", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline[1]", "color"_ostr, "#000000"); } CPPUNIT_TEST_FIXTURE(Test, testPolylinetoCloseStroke) @@ -881,14 +911,14 @@ CPPUNIT_TEST_FIXTURE(Test, testPolylinetoCloseStroke) "420,450 370,490 330,530 290,570 260,610 230,660 200,700 170,750 150,790 130,840 120,890 " "110,930 100,980 100,1030 100,1080 110,1130 120,1180 130,1220 140,1270 160,1320 190,1360 " "210,1410 250,1450 280,1490 320,1540 360,1580 400,1620 450,1650 500,1690"); - assertXPath(pDocument, aXPathPrefix + "polygonhairline[1]", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonhairline[1]", "color"_ostr, "#000000"); assertXPathContent( pDocument, aXPathPrefix + "polygonhairline[2]/polygon", "1760,1120 1710,1130 1670,1140 1620,1150 1580,1160 1540,1170 1500,1180 1460,1200 1420,1210 " "1380,1230 1350,1240 1320,1260 1290,1280 1260,1300 1230,1310 1210,1330 1190,1360 1170,1380 " "1150,1400 1140,1420 1120,1440 1110,1460 1110,1490 1100,1510 1100,1530 1100,1550 1100,1580 " "1110,1600 1120,1620 1130,1650 1140,1670 1160,1690 1170,1710 1190,1730"); - assertXPath(pDocument, aXPathPrefix + "polygonhairline[2]", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonhairline[2]", "color"_ostr, "#000000"); } CPPUNIT_TEST_FIXTURE(Test, testEmfPolydraw) @@ -901,18 +931,18 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPolydraw) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "polygonhairline", 2); - assertXPath(pDocument, aXPathPrefix + "polygonhairline[1]", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonhairline[1]", "color"_ostr, "#000000"); assertXPathContent(pDocument, aXPathPrefix + "polygonhairline[1]/polygon", "2000,200 3000,200 3000,1000"); - assertXPath(pDocument, aXPathPrefix + "polygonhairline[2]", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonhairline[2]", "color"_ostr, "#000000"); assertXPathContent(pDocument, aXPathPrefix + "polygonhairline[2]/polygon", "3000,2000 3000,2000 4000,2000 3000,3000"); assertXPath(pDocument, aXPathPrefix + "polygonstroke", 1); assertXPathContent(pDocument, aXPathPrefix + "polygonstroke[1]/polygon", "50,50 50,50 1000,1000 1000,1000 2000,2500 2000,1000"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke[1]/line", "color", "#ff0000"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke[1]/stroke", "dotDashArray", "30 10 "); + assertXPath(pDocument, aXPathPrefix + "polygonstroke[1]/line", "color"_ostr, "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke[1]/stroke", "dotDashArray"_ostr, "30 10 "); } CPPUNIT_TEST_FIXTURE(Test, testEmfPlusBrushPathGradientWithBlendColors) @@ -925,12 +955,12 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusBrushPathGradientWithBlendColors) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "radius", "0.7"); + assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "radius"_ostr, "0.7"); assertXPath(pDocument, aXPathPrefix + "svgradialgradient/focalx", 0); assertXPath(pDocument, aXPathPrefix + "svgradialgradient/focaly", 0); - assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "startx", "0"); - assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "starty", "0"); - assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "spreadmethod", "pad"); + assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "startx"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "starty"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "spreadmethod"_ostr, "pad"); } CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawCurve) @@ -945,9 +975,10 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawCurve) assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke", 26); // Verify DrawCurve with tension=0.5, offset=0, segments=2 - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[3]/line", "color", "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[3]/line", "color"_ostr, + "#ff0000"); assertXPath( - pDocument, aXPathPrefix + "mask/polypolygonstroke[3]/polypolygon", "path", + pDocument, aXPathPrefix + "mask/polypolygonstroke[3]/polypolygon", "path"_ostr, "m4121.5678588927 597.698391624308 124.350808427242 119.857180790532 168.799608035277 " "163.249184432137 191.024007839294 186.003527805174 191.024007839294 188.120210909643 " "168.799608035277 169.599233745543 124.350808427242 130.440596312875 57.677609015188 " @@ -957,9 +988,10 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawCurve) "122.899912753206-14.8162665360123 62.3098588877929"); // Verify DrawCurve with tension=1.125, offset=0, segments=3 - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[9]/line", "color", "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[9]/line", "color"_ostr, + "#ff0000"); assertXPath( - pDocument, aXPathPrefix + "mask/polypolygonstroke[9]/polypolygon", "path", + pDocument, aXPathPrefix + "mask/polypolygonstroke[9]/polypolygon", "path"_ostr, "m6593.23860852523 4960.44685532205 129.113179813817 111.125862984599 154.512493875552 " "132.292694029285 167.212150906418 147.109475760564 167.212150906418 155.576208178439 " "154.512493875552 157.692891282907 129.113179813817 153.45952507397 91.0142087212153 " @@ -973,9 +1005,10 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawCurve) "40.4815643729608-142.871141597256 25.135611865564"); // Verify DrawCurve with tension=0.125, offset=0, segments=4 - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[13]/line", "color", "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[13]/line", "color"_ostr, + "#ff0000"); assertXPath( - pDocument, aXPathPrefix + "mask/polypolygonstroke[13]/polypolygon", "path", + pDocument, aXPathPrefix + "mask/polypolygonstroke[13]/polypolygon", "path"_ostr, "m4121.5678588927 9267.6323875275 124.350808427242 119.857180790532 168.799608035277 " "163.249184432138 191.024007839294 186.003527805173 191.024007839294 188.120210909643 " "168.799608035277 169.599233745543 124.350808427242 130.440596312876 57.677609015188 " @@ -993,9 +1026,10 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawCurve) "8255756981871-15.3459525073959"); // Verify DrawCurve with tension=0.125, offset=1, segments=3 - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[18]/line", "color", "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[18]/line", "color"_ostr, + "#ff0000"); assertXPath( - pDocument, aXPathPrefix + "mask/polypolygonstroke[18]/polypolygon", "path", + pDocument, aXPathPrefix + "mask/polypolygonstroke[18]/polypolygon", "path"_ostr, "m5162.41058304753 14700.2318678401 10.5830475257226 128.191620514377 6.34982851543373 " "166.821087170927 2.11660950514397 185.606649723086-2.11660950514397 " "184.548308170854-6.34982851543373 163.646062514224-10.5830475257226 " @@ -1006,9 +1040,10 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawCurve) "56.1582486154312-70.6418422341994 23.7465385782562"); // Verify DrawClosedCurve with tension=0.5 - assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[22]/line", "color", "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygonstroke[22]/line", "color"_ostr, + "#ff0000"); assertXPath( - pDocument, aXPathPrefix + "mask/polypolygonstroke[22]/polypolygon", "path", + pDocument, aXPathPrefix + "mask/polypolygonstroke[22]/polypolygon", "path"_ostr, "m2709.26016658501 19012.0476443365v122.767620059174 173.568014566423 198.968211820044 " "198.968211820044 173.568014566423 122.767620059174 46.5670282983083l-46.5654091131796 " "23.283514149156-122.763351298383 61.383810029587-173.561979421852 " @@ -1037,31 +1072,32 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusGetDC) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "textsimpleportion", "text", "sd CCCCCCCCCCCCCCC"); - assertXPath(pDocument, aXPathPrefix + "textsimpleportion", "fontcolor", "#000000"); + assertXPath(pDocument, aXPathPrefix + "textsimpleportion", "text"_ostr, "sd CCCCCCCCCCCCCCC"); + assertXPath(pDocument, aXPathPrefix + "textsimpleportion", "fontcolor"_ostr, "#000000"); assertXPath(pDocument, aXPathPrefix + "group", 5); assertXPath( - pDocument, aXPathPrefix + "group[4]/textsimpleportion", "text", + pDocument, aXPathPrefix + "group[4]/textsimpleportion", "text"_ostr, "Getttttttttttttttttttttttttttttt, uuuu: \"eeeeeeeeeeeeeeeeeeeeeee-7acd04a3953b\")"); - assertXPath(pDocument, aXPathPrefix + "group[5]/textsimpleportion", "text", + assertXPath(pDocument, aXPathPrefix + "group[5]/textsimpleportion", "text"_ostr, "TTTTTTTTTTTTTTTTTTTTTTTTTTTTT, trackId: 55)"); - assertXPath(pDocument, aXPathPrefix + "group[5]/textsimpleportion", "fontcolor", "#000000"); + assertXPath(pDocument, aXPathPrefix + "group[5]/textsimpleportion", "fontcolor"_ostr, + "#000000"); assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", 6); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]/polypolygon", "path"_ostr, "m105.78125 " "776.111111111111h3878.64583333333l458.385416666667-493.888888888889v-176." "388888888889h-4337.03125v670.277777777778"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color", "#ffffff"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color"_ostr, "#ffffff"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[3]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[3]/polypolygon", "path"_ostr, "m2291.92708333333 4550.83333333333h317.34375v-317.5h-317.34375z"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[3]", "color", "#fcf2e3"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[3]", "color"_ostr, "#fcf2e3"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[6]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[6]/polypolygon", "path"_ostr, "m19428.4895833333 6632.22222222222h317.34375v-2398.88888888889h-317.34375z"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[6]", "color", "#fcf2e3"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[6]", "color"_ostr, "#fcf2e3"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke", 4); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow", 13); @@ -1076,17 +1112,20 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusSave) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path", "m0 0h33544v21311h-33544z"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path"_ostr, + "m0 0h33544v21311h-33544z"); - assertXPath(pDocument, aXPathPrefix + "mask/group/mask/polypolygoncolor/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/group/mask/polypolygoncolor/polypolygon", + "path"_ostr, "m327.458333333333 638.222222222222h437007.1875v295555.555555556h-437007.1875z"); - assertXPath(pDocument, aXPathPrefix + "mask/group/mask/polypolygoncolor", "color", "#ff0cad"); + assertXPath(pDocument, aXPathPrefix + "mask/group/mask/polypolygoncolor", "color"_ostr, + "#ff0cad"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor/polypolygon", "path"_ostr, "m10853.4145539602 7321.41354709201h41952690v29630720h-41952690z"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor", "color", "#00ffad"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor", "color"_ostr, "#00ffad"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow/line", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstrokearrow/line", "color"_ostr, "#000000"); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonstrokearrow/polygon", "10853.4145539602,7321.41354709201 10853.4145539602,4907.54325697157 " "12832.6557236512,4907.54325697157"); @@ -1105,15 +1144,16 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawPathWithCustomCap) assertXPathContent(pDocument, aXPathPrefix + "polygonstrokearrow/polygon", "1423.297394625,1268.98481214025 705.717657763014,1304.88786195939"); - assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/line", "color", "#cc0000"); - assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/line", "width", "96"); - assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/line", "linecap", "BUTT"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/line", "color"_ostr, "#cc0000"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/line", "width"_ostr, "96"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/line", "linecap"_ostr, "BUTT"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/stroke", 0); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/linestartattribute", 0); - assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/lineendattribute", "centered", "0"); - assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/lineendattribute/polypolygon", "path", - "m-1.5 3 1.5-3 1.5 3z"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/lineendattribute", "centered"_ostr, + "0"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/lineendattribute/polypolygon", + "path"_ostr, "m-1.5 3 1.5-3 1.5 3z"); } CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawPathWithMiterLimit) @@ -1128,39 +1168,39 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawPathWithMiterLimit) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke", 3); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "color", "#c800c8"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "width", "1057"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "linejoin", "Miter"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "miterangle", "5"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "color"_ostr, "#c800c8"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "width"_ostr, "1057"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "linejoin"_ostr, "Miter"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "miterangle"_ostr, "5"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/stroke", 0); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence", 3); - assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]", "transparence", "85"); - assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]/polypolygonstroke/line", "color", - "#6400c8"); - assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]/polypolygonstroke/line", "width", - "1057"); + assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]", "transparence"_ostr, "85"); + assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]/polypolygonstroke/line", + "color"_ostr, "#6400c8"); + assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]/polypolygonstroke/line", + "width"_ostr, "1057"); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]/polypolygonstroke/line", - "linejoin", "Miter"); + "linejoin"_ostr, "Miter"); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]/polypolygonstroke/line", - "miterangle", "19"); - assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[2]", "transparence", "69"); + "miterangle"_ostr, "19"); + assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[2]", "transparence"_ostr, "69"); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[2]/polypolygonstroke/line", - "miterangle", "19"); - assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[3]", "transparence", "53"); + "miterangle"_ostr, "19"); + assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[3]", "transparence"_ostr, "53"); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[3]/polypolygonstroke/line", - "miterangle", "19"); + "miterangle"_ostr, "19"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "color", "#0000ff"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "width", "1057"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "linejoin", "Miter"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "miterangle", "60"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "color"_ostr, "#0000ff"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "width"_ostr, "1057"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "linejoin"_ostr, "Miter"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "miterangle"_ostr, "60"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/stroke", 0); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "color", "#0000ff"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "width", "1057"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "linejoin", "Miter"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "miterangle", "60"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "color"_ostr, "#0000ff"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "width"_ostr, "1057"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "linejoin"_ostr, "Miter"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "miterangle"_ostr, "60"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/stroke", 0); } @@ -1175,12 +1215,12 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusFillClosedCurve) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", 2); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color", "#808080"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[2]", "color", "#808080"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color"_ostr, "#808080"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[2]", "color"_ostr, "#808080"); // Validate curve generated by FillClosedCurve, tension=0.25 assertXPath( - pDocument, aXPathPrefix + "polypolygoncolor[2]/polypolygon", "path", + pDocument, aXPathPrefix + "polypolygoncolor[2]/polypolygon", "path"_ostr, "m1305.97700269476 " "808.572945906987-50.3314857912787-25.4001972536228-68.1076984321412-40.2169789849024-76." "5824044585986-48.6837114027768-75.7556038706516-50.8003945072452-65.6272966683-46." @@ -1202,7 +1242,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusFillClosedCurve) // Validate curve generated by DrawClosedCurve, tension=0.25 assertXPath( - pDocument, aXPathPrefix + "polypolygonstroke[2]/polypolygon", "path", + pDocument, aXPathPrefix + "polypolygonstroke[2]/polypolygon", "path"_ostr, "m1305.97700269476 " "808.572945906987-50.3314857912787-25.4001972536228-68.1076984321412-40.2169789849024-76." "5824044585986-48.6837114027768-75.7556038706516-50.8003945072452-65.6272966683-46." @@ -1223,13 +1263,13 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusFillClosedCurve) "87.1808853652984 18.0862628613424 64.4265419922616 2.5837518373346 29.7658561565891z"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke", 2); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "color", "#00ff00"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "width", "4"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "linejoin", "Miter"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "miterangle", "3"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "linecap", "BUTT"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "color", "#aaaa00"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "width", "4"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "color"_ostr, "#00ff00"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "width"_ostr, "4"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "linejoin"_ostr, "Miter"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "miterangle"_ostr, "3"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "linecap"_ostr, "BUTT"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "color"_ostr, "#aaaa00"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "width"_ostr, "4"); } CPPUNIT_TEST_FIXTURE(Test, testExtTextOutOpaqueAndClipTransform) @@ -1243,46 +1283,48 @@ CPPUNIT_TEST_FIXTURE(Test, testExtTextOutOpaqueAndClipTransform) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "textsimpleportion", 2); - assertXPath(pDocument, aXPathPrefix + "textsimpleportion[1]", "text", "No_rect- DLP-"); - assertXPath(pDocument, aXPathPrefix + "textsimpleportion[1]", "fontcolor", "#000000"); + assertXPath(pDocument, aXPathPrefix + "textsimpleportion[1]", "text"_ostr, "No_rect- DLP-"); + assertXPath(pDocument, aXPathPrefix + "textsimpleportion[1]", "fontcolor"_ostr, "#000000"); - assertXPath(pDocument, aXPathPrefix + "textsimpleportion[2]", "text", "OpaqueTranspa"); - assertXPath(pDocument, aXPathPrefix + "textsimpleportion[2]", "fontcolor", "#000000"); + assertXPath(pDocument, aXPathPrefix + "textsimpleportion[2]", "text"_ostr, "OpaqueTranspa"); + assertXPath(pDocument, aXPathPrefix + "textsimpleportion[2]", "fontcolor"_ostr, "#000000"); assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", 3); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]/polypolygon", "path"_ostr, "m966 490-477-275-84 147 476 275z"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color", "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color"_ostr, "#ff0000"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[2]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[2]/polypolygon", "path"_ostr, "m251 713 623 361-148 257-623-361z"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[2]", "color", "#0080ff"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[2]", "color"_ostr, "#0080ff"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[3]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[3]/polypolygon", "path"_ostr, "m972 1326-476-275-148 257 476 276z"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[3]", "color", "#800080"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[3]", "color"_ostr, "#800080"); assertXPath(pDocument, aXPathPrefix + "group", 3); - assertXPath(pDocument, aXPathPrefix + "group[1]/polypolygoncolor", "color", "#ff0000"); - assertXPath(pDocument, aXPathPrefix + "group[1]/textsimpleportion", "text", "Opaque - DLP-"); - assertXPath(pDocument, aXPathPrefix + "group[1]/textsimpleportion", "fontcolor", "#000000"); + assertXPath(pDocument, aXPathPrefix + "group[1]/polypolygoncolor", "color"_ostr, "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "group[1]/textsimpleportion", "text"_ostr, + "Opaque - DLP-"); + assertXPath(pDocument, aXPathPrefix + "group[1]/textsimpleportion", "fontcolor"_ostr, + "#000000"); - assertXPath(pDocument, aXPathPrefix + "group[2]/mask/group/polypolygoncolor", "color", + assertXPath(pDocument, aXPathPrefix + "group[2]/mask/group/polypolygoncolor", "color"_ostr, "#00ff00"); - assertXPath(pDocument, aXPathPrefix + "group[2]/mask/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "group[2]/mask/polypolygon", "path"_ostr, "m320 508 586 340-169 293-586-339z"); - assertXPath(pDocument, aXPathPrefix + "group[2]/mask/group/textsimpleportion", "text", + assertXPath(pDocument, aXPathPrefix + "group[2]/mask/group/textsimpleportion", "text"_ostr, "Clip - DLP-"); - assertXPath(pDocument, aXPathPrefix + "group[2]/mask/group/textsimpleportion", "fontcolor", + assertXPath(pDocument, aXPathPrefix + "group[2]/mask/group/textsimpleportion", "fontcolor"_ostr, "#000000"); - assertXPath(pDocument, aXPathPrefix + "group[3]/mask/group/polypolygoncolor", "color", + assertXPath(pDocument, aXPathPrefix + "group[3]/mask/group/polypolygoncolor", "color"_ostr, "#0080ff"); - assertXPath(pDocument, aXPathPrefix + "group[3]/mask/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "group[3]/mask/polypolygon", "path"_ostr, "m251 713 623 361-148 257-623-361z"); - assertXPath(pDocument, aXPathPrefix + "group[3]/mask/group/textsimpleportion", "text", + assertXPath(pDocument, aXPathPrefix + "group[3]/mask/group/textsimpleportion", "text"_ostr, "Opaque ClipP-"); - assertXPath(pDocument, aXPathPrefix + "group[3]/mask/group/textsimpleportion", "fontcolor", + assertXPath(pDocument, aXPathPrefix + "group[3]/mask/group/textsimpleportion", "fontcolor"_ostr, "#000000"); } @@ -1298,10 +1340,10 @@ CPPUNIT_TEST_FIXTURE(Test, testNegativeWinOrg) // and be lower and more to the right than it actually is which would cut the // text in the emf above in half. assertXPath(pDocument, aXPathPrefix + "mask/group[1]/mask/polypolygon", 1); - assertXPath(pDocument, aXPathPrefix + "mask/group[1]/mask/polypolygon", "minx", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/group[1]/mask/polypolygon", "miny", "272"); - assertXPath(pDocument, aXPathPrefix + "mask/group[1]/mask/polypolygon", "maxx", "6800"); - assertXPath(pDocument, aXPathPrefix + "mask/group[1]/mask/polypolygon", "maxy", "644"); + assertXPath(pDocument, aXPathPrefix + "mask/group[1]/mask/polypolygon", "minx"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/group[1]/mask/polypolygon", "miny"_ostr, "272"); + assertXPath(pDocument, aXPathPrefix + "mask/group[1]/mask/polypolygon", "maxx"_ostr, "6800"); + assertXPath(pDocument, aXPathPrefix + "mask/group[1]/mask/polypolygon", "maxy"_ostr, "644"); } CPPUNIT_TEST_FIXTURE(Test, testBitBltStretchBltWMF) @@ -1315,34 +1357,34 @@ CPPUNIT_TEST_FIXTURE(Test, testBitBltStretchBltWMF) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "mask/bitmap", 2); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy11", "508"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy12", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy13", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy21", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy22", "508"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy23", "406"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "height", "10"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "width", "10"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy11"_ostr, "508"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy12"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy13"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy21"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy22"_ostr, "508"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy23"_ostr, "406"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "height"_ostr, "10"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "width"_ostr, "10"); assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]/data", 10); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]/data[1]", "row", + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]/data[1]", "row"_ostr, "000000,000000,000000,000000,000000,000000,000000,000000,000000,000000"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]/data[4]", "row", + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]/data[4]", "row"_ostr, "000000,ffffff,000000,ffffff,000000,ffffff,000000,ffffff,000000,ffffff"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]/data[5]", "row", + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]/data[5]", "row"_ostr, "ffffff,000000,ffffff,ffffff,000000,000000,000000,ffffff,ffffff,000000"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "xy11", "1524"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "xy12", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "xy13", "813"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "xy21", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "xy22", "1016"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "xy23", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "height", "10"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "width", "10"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "xy11"_ostr, "1524"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "xy12"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "xy13"_ostr, "813"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "xy21"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "xy22"_ostr, "1016"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "xy23"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "height"_ostr, "10"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "width"_ostr, "10"); assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]/data", 10); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]/data[1]", "row", + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]/data[1]", "row"_ostr, "000000,00001c,000038,000055,000071,00008d,0000aa,0000c6,0000e2,0000ff"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]/data[5]", "row", + assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]/data[5]", "row"_ostr, "720000,721c1c,723838,725555,727171,72728d,55728d,39728d,1d728d,00728d"); } @@ -1407,24 +1449,24 @@ CPPUNIT_TEST_FIXTURE(Test, testPaletteWMF) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor", 2); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]/polypolygon", "path"_ostr, "m0 0h3015v3015h-3015z"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]", "color", "#ffff00"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[1]", "color"_ostr, "#ffff00"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[2]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[2]/polypolygon", "path"_ostr, "m2222 2222h2698v2698h-2698z"); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[2]", "color", "#0080ff"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygoncolor[2]", "color"_ostr, "#0080ff"); assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke", 2); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonstroke[1]/polygon", "0,0 3015,0 3015,3015 0,3015"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", "color", "#ff0000"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", "width", "132"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", "color"_ostr, "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", "width"_ostr, "132"); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonstroke[2]/polygon", "2222,2222 4920,2222 4920,4920 2222,4920"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", "color", "#ff0000"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", "width", "132"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", "color"_ostr, "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", "width"_ostr, "132"); } CPPUNIT_TEST_FIXTURE(Test, testRestoreDCWMF) @@ -1437,22 +1479,22 @@ CPPUNIT_TEST_FIXTURE(Test, testRestoreDCWMF) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", 3); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color", "#0000ff"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color"_ostr, "#0000ff"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]/polypolygon", "path"_ostr, "m238 2884h1640v1110h-1640z"); - assertXPath(pDocument, aXPathPrefix + "polygonhairline[1]", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonhairline[1]", "color"_ostr, "#000000"); assertXPathContent(pDocument, aXPathPrefix + "polygonhairline[1]/polygon", "238,2884 1878,2884 1878,3994 238,3994"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[2]", "color", "#ff0000"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[2]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[2]", "color"_ostr, "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[2]/polypolygon", "path"_ostr, "m238 238h1640v1110h-1640z"); - assertXPath(pDocument, aXPathPrefix + "polygonhairline[2]", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonhairline[2]", "color"_ostr, "#000000"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[3]", "color", "#ff0000"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[3]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[3]", "color"_ostr, "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[3]/polypolygon", "path"_ostr, "m238 5530h1640v1110h-1640z"); - assertXPath(pDocument, aXPathPrefix + "polygonhairline[3]", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonhairline[3]", "color"_ostr, "#000000"); } CPPUNIT_TEST_FIXTURE(Test, testRoundrectWMF) @@ -1464,7 +1506,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRoundrectWMF) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color", "#ffffff"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color"_ostr, "#ffffff"); assertXPathContent( pDocument, aXPathPrefix + "polygonstroke/polygon", @@ -1492,8 +1534,8 @@ CPPUNIT_TEST_FIXTURE(Test, testRoundrectWMF) "2802,1874 2810,1866 2810,1858 2818,1850 2818,1842 2826,1834 2826,1826 2834,1818 2834,1810 " "2834,1802 2842,1794 2842,1786 2842,1778 2850,1770 2850,1762 2850,1746 2850,1739 2850,1731 " "2858,1723 2858,1715 2858,1707 2858,1691 2858,1683 2858,1675 2858,1667"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "color", "#000000"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "width", "143"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "color"_ostr, "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "width"_ostr, "143"); } CPPUNIT_TEST_FIXTURE(Test, testStretchDIBWMF) @@ -1505,19 +1547,19 @@ CPPUNIT_TEST_FIXTURE(Test, testStretchDIBWMF) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "xy11", "12065"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "xy12", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "xy13", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "xy21", "0"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "xy22", "12065"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "xy23", "0"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "xy11"_ostr, "12065"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "xy12"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "xy13"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "xy21"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "xy22"_ostr, "12065"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "xy23"_ostr, "0"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "height", "10"); - assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "width", "10"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "height"_ostr, "10"); + assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "width"_ostr, "10"); assertXPath(pDocument, aXPathPrefix + "mask/bitmap/data", 10); - assertXPath(pDocument, aXPathPrefix + "/mask/bitmap/data[1]", "row", + assertXPath(pDocument, aXPathPrefix + "/mask/bitmap/data[1]", "row"_ostr, "000000,00001c,000038,000055,000071,00008d,0000aa,0000c6,0000e2,0000ff"); - assertXPath(pDocument, aXPathPrefix + "/mask/bitmap/data[5]", "row", + assertXPath(pDocument, aXPathPrefix + "/mask/bitmap/data[5]", "row"_ostr, "720000,721c1c,723838,725555,727171,72728d,55728d,39728d,1d728d,00728d"); } @@ -1532,10 +1574,10 @@ CPPUNIT_TEST_FIXTURE(Test, testMoveToLineToWMF) assertXPathContent(pDocument, aXPathPrefix + "polygonstroke/polygon", "5856,3586 7167,621 8625,3586"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "color", "#800000"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "width", "310"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "linejoin", "Bevel"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "linecap", "ROUND"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "color"_ostr, "#800000"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "width"_ostr, "310"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "linejoin"_ostr, "Bevel"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "linecap"_ostr, "ROUND"); } CPPUNIT_TEST_FIXTURE(Test, testPolyLineWidth) @@ -1547,14 +1589,14 @@ CPPUNIT_TEST_FIXTURE(Test, testPolyLineWidth) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor/polypolygon", "path"_ostr, "m530 529 1236-176-707 352z"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color", "#ffff00"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color"_ostr, "#ffff00"); assertXPathContent(pDocument, aXPathPrefix + "polygonstroke/polygon", "530,529 530,529 1766,353 1059,705"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "color", "#000000"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "width", "71"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "color"_ostr, "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke/line", "width"_ostr, "71"); } CPPUNIT_TEST_FIXTURE(Test, testRestoreDC) @@ -1566,10 +1608,10 @@ CPPUNIT_TEST_FIXTURE(Test, testRestoreDC) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color", "#ff0000"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color"_ostr, "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor/polypolygon", "path"_ostr, "m1148 4354v1481h4943v-1481z"); - assertXPath(pDocument, aXPathPrefix + "polygonhairline", "color", "#000000"); + assertXPath(pDocument, aXPathPrefix + "polygonhairline", "color"_ostr, "#000000"); assertXPathContent(pDocument, aXPathPrefix + "polygonhairline/polygon", "1148,4354 1148,5835 6091,5835 6091,4354"); } @@ -1584,17 +1626,17 @@ CPPUNIT_TEST_FIXTURE(Test, testRoundRect) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", 2); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]/polypolygon", "path", + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]/polypolygon", "path"_ostr, "m100 100h4000v2000h-4000z"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color", "#ffffff"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[1]", "color"_ostr, "#ffffff"); assertXPath(pDocument, aXPathPrefix + "polygonstroke", 2); assertXPathContent(pDocument, aXPathPrefix + "polygonstroke[1]/polygon", "100,100 4100,100 4100,2100 100,2100"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke[1]/line", "color", "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke[1]/line", "color"_ostr, "#ff0000"); assertXPath( - pDocument, aXPathPrefix + "polypolygoncolor[2]/polypolygon", "path", + pDocument, aXPathPrefix + "polypolygoncolor[2]/polypolygon", "path"_ostr, "m4090 " "2700v-30-20l-10-30v-20l-10-30-10-20-10-20-20-30-10-20-20-20-20-20-20-30-20-20-20-20-20-10-" "30-20-20-20-30-20-30-10-30-10-30-20-30-10-30-10-40-10-30-10h-30l-40-10h-30l-40-10h-30-40-" @@ -1604,7 +1646,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRoundRect) "30 20 20 20 30 20 30 10 30 10 30 20 30 10 30 10 40 10 30 10h30l40 10h30l40 10h30 40 2590 " "40 30l40-10h30l40-10h30l30-10 40-10 30-10 30-10 30-20 30-10 30-10 30-20 20-20 30-20 20-10 " "20-20 20-20 20-30 20-20 20-20 10-20 20-30 10-20 10-20 10-30v-20l10-30v-20-30z"); - assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[2]", "color", "#ffffff"); + assertXPath(pDocument, aXPathPrefix + "polypolygoncolor[2]", "color"_ostr, "#ffffff"); assertXPathContent( pDocument, aXPathPrefix + "polygonstroke[2]/polygon", @@ -1622,7 +1664,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRoundRect) "3700,4140 3730,4130 3760,4110 3790,4100 3820,4090 3850,4070 3870,4050 3900,4030 3920,4020 " "3940,4000 3960,3980 3980,3950 4000,3930 4020,3910 4030,3890 4050,3860 4060,3840 4070,3820 " "4080,3790 4080,3770 4090,3740 4090,3720 4090,3690"); - assertXPath(pDocument, aXPathPrefix + "polygonstroke[2]/line", "color", "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "polygonstroke[2]/line", "color"_ostr, "#ff0000"); } CPPUNIT_TEST_FIXTURE(Test, testCreatePen) @@ -1635,49 +1677,51 @@ CPPUNIT_TEST_FIXTURE(Test, testCreatePen) xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); CPPUNIT_ASSERT(pDocument); - assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path", "m0 0h31250v18192h-31250z"); + assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path"_ostr, + "m0 0h31250v18192h-31250z"); assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke", 3); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonstroke[1]/polygon", "17898,5693 20172,5693"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", "color", "#008000"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", "width", "0"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", "color"_ostr, "#008000"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", "width"_ostr, "0"); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonstroke[2]/polygon", "17898,6959 20172,6959"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", "color", "#000080"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", "width", "0"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", "color"_ostr, "#000080"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", "width"_ostr, "0"); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonstroke[3]/polygon", "17898,7381 20172,7381"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[3]/line", "color", "#ff0000"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[3]/line", "width", "0"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[3]/line", "color"_ostr, "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[3]/line", "width"_ostr, "0"); assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline", 755); - assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline[5]", "color", "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline[5]", "color"_ostr, "#ff0000"); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonhairline[5]/polygon", "27925,16078 27875,16078"); - assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline[10]", "color", "#ff0000"); + assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline[10]", "color"_ostr, "#ff0000"); assertXPathContent(pDocument, aXPathPrefix + "mask/polygonhairline[10]/polygon", "27925,14180 27875,14180"); assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion", 69); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "width", "374"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "x", "28124"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "y", "16581"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "text", "0.0"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "fontcolor", "#000000"); - - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[10]", "width", "266"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[10]", "x", "28000"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[10]", "y", "428"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[10]", "text", "-6"); - assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[10]", "fontcolor", "#000000"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "width"_ostr, "374"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "x"_ostr, "28124"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "y"_ostr, "16581"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "text"_ostr, "0.0"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", "fontcolor"_ostr, "#000000"); + + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[10]", "width"_ostr, "266"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[10]", "x"_ostr, "28000"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[10]", "y"_ostr, "428"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[10]", "text"_ostr, "-6"); + assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[10]", "fontcolor"_ostr, + "#000000"); assertXPath(pDocument, aXPathPrefix + "mask/pointarray", 8); - assertXPath(pDocument, aXPathPrefix + "mask/pointarray[1]", "color", "#008000"); - assertXPath(pDocument, aXPathPrefix + "mask/pointarray[1]/point", "x", "25844"); - assertXPath(pDocument, aXPathPrefix + "mask/pointarray[1]/point", "y", "8918"); + assertXPath(pDocument, aXPathPrefix + "mask/pointarray[1]", "color"_ostr, "#008000"); + assertXPath(pDocument, aXPathPrefix + "mask/pointarray[1]/point", "x"_ostr, "25844"); + assertXPath(pDocument, aXPathPrefix + "mask/pointarray[1]/point", "y"_ostr, "8918"); } CPPUNIT_TEST_FIXTURE(Test, testPdfInEmf) diff --git a/emfio/qa/cppunit/wmf/wmfimporttest.cxx b/emfio/qa/cppunit/wmf/wmfimporttest.cxx index 84154f47d046..426b8d1b658c 100644 --- a/emfio/qa/cppunit/wmf/wmfimporttest.cxx +++ b/emfio/qa/cppunit/wmf/wmfimporttest.cxx @@ -96,17 +96,17 @@ void WmfTest::testEOFWmf() xmlDocUniquePtr pDoc = dumpAndParse(dumper, aGDIMetaFile); CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/metafile/push", 2); - assertXPath(pDoc, "/metafile/push[2]", "flags", "PushClipRegion"); - assertXPath(pDoc, "/metafile/push[2]/fillcolor", 2); - assertXPath(pDoc, "/metafile/push[2]/fillcolor[1]", "color", "#000000"); - assertXPath(pDoc, "/metafile/push[2]/fillcolor[2]", "color", "#d0d0d0"); - assertXPath(pDoc, "/metafile/push[2]/linecolor", 60); - assertXPath(pDoc, "/metafile/push[2]/polyline", 209); - assertXPath(pDoc, "/metafile/push[2]/polyline[1]/point", 5); - assertXPath(pDoc, "/metafile/push[2]/polyline[1]/point[3]", "x", "16906"); - assertXPath(pDoc, "/metafile/push[2]/polyline[1]/point[3]", "y", "12673"); - assertXPath(pDoc, "/metafile/push[2]/textarray", 307); + assertXPath(pDoc, "/metafile/push"_ostr, 2); + assertXPath(pDoc, "/metafile/push[2]"_ostr, "flags"_ostr, "PushClipRegion"); + assertXPath(pDoc, "/metafile/push[2]/fillcolor"_ostr, 2); + assertXPath(pDoc, "/metafile/push[2]/fillcolor[1]"_ostr, "color"_ostr, "#000000"); + assertXPath(pDoc, "/metafile/push[2]/fillcolor[2]"_ostr, "color"_ostr, "#d0d0d0"); + assertXPath(pDoc, "/metafile/push[2]/linecolor"_ostr, 60); + assertXPath(pDoc, "/metafile/push[2]/polyline"_ostr, 209); + assertXPath(pDoc, "/metafile/push[2]/polyline[1]/point"_ostr, 5); + assertXPath(pDoc, "/metafile/push[2]/polyline[1]/point[3]"_ostr, "x"_ostr, "16906"); + assertXPath(pDoc, "/metafile/push[2]/polyline[1]/point[3]"_ostr, "y"_ostr, "12673"); + assertXPath(pDoc, "/metafile/push[2]/textarray"_ostr, 307); } void WmfTest::testNonPlaceableWmf() @@ -124,20 +124,20 @@ void WmfTest::testNonPlaceableWmf() CPPUNIT_ASSERT(pDoc); // These values come from changes done in tdf#88163 - assertXPath(pDoc, "/metafile/polyline[1]/point[1]", "x", "16813"); - assertXPath(pDoc, "/metafile/polyline[1]/point[1]", "y", "1004"); + assertXPath(pDoc, "/metafile/polyline[1]/point[1]"_ostr, "x"_ostr, "16813"); + assertXPath(pDoc, "/metafile/polyline[1]/point[1]"_ostr, "y"_ostr, "1004"); - assertXPath(pDoc, "/metafile/polyline[1]/point[2]", "x", "16813"); - assertXPath(pDoc, "/metafile/polyline[1]/point[2]", "y", "7514"); + assertXPath(pDoc, "/metafile/polyline[1]/point[2]"_ostr, "x"_ostr, "16813"); + assertXPath(pDoc, "/metafile/polyline[1]/point[2]"_ostr, "y"_ostr, "7514"); - assertXPath(pDoc, "/metafile/polyline[1]/point[3]", "x", "26112"); - assertXPath(pDoc, "/metafile/polyline[1]/point[3]", "y", "7514"); + assertXPath(pDoc, "/metafile/polyline[1]/point[3]"_ostr, "x"_ostr, "26112"); + assertXPath(pDoc, "/metafile/polyline[1]/point[3]"_ostr, "y"_ostr, "7514"); - assertXPath(pDoc, "/metafile/polyline[1]/point[4]", "x", "26112"); - assertXPath(pDoc, "/metafile/polyline[1]/point[4]", "y", "1004"); + assertXPath(pDoc, "/metafile/polyline[1]/point[4]"_ostr, "x"_ostr, "26112"); + assertXPath(pDoc, "/metafile/polyline[1]/point[4]"_ostr, "y"_ostr, "1004"); - assertXPath(pDoc, "/metafile/polyline[1]/point[5]", "x", "16813"); - assertXPath(pDoc, "/metafile/polyline[1]/point[5]", "y", "1004"); + assertXPath(pDoc, "/metafile/polyline[1]/point[5]"_ostr, "x"_ostr, "16813"); + assertXPath(pDoc, "/metafile/polyline[1]/point[5]"_ostr, "y"_ostr, "1004"); } void WmfTest::testTdf88163NonPlaceableWmf() @@ -156,23 +156,23 @@ void WmfTest::testTdf88163NonPlaceableWmf() // Fails without the fix // With fix: 3272, without fix: ~ 8000 - auto x = getXPath(pDoc, "/metafile/push[2]/font[1]", "height"); + auto x = getXPath(pDoc, "/metafile/push[2]/font[1]"_ostr, "height"_ostr); CPPUNIT_ASSERT_EQUAL(sal_Int32(3272), x.toInt32()); // Fails without the fix: Expected: 7359, Actual: 7336 - assertXPath(pDoc, "/metafile/push[2]/textarray[1]", "x", "7359"); + assertXPath(pDoc, "/metafile/push[2]/textarray[1]"_ostr, "x"_ostr, "7359"); // Fails without the fix: Expected: 4118, Actual: 4104 - assertXPath(pDoc, "/metafile/push[2]/textarray[1]", "y", "4118"); + assertXPath(pDoc, "/metafile/push[2]/textarray[1]"_ostr, "y"_ostr, "4118"); // Fails without the fix: Expected: 5989, Actual: 5971 - assertXPath(pDoc, "/metafile/push[2]/textarray[2]", "x", "5989"); + assertXPath(pDoc, "/metafile/push[2]/textarray[2]"_ostr, "x"_ostr, "5989"); // Fails without the fix: Expected: 16264, Actual: 16208 - assertXPath(pDoc, "/metafile/push[2]/textarray[2]", "y", "16264"); + assertXPath(pDoc, "/metafile/push[2]/textarray[2]"_ostr, "y"_ostr, "16264"); // Fails without the fix: Expected: 20769, Actual: 20705 - assertXPath(pDoc, "/metafile/push[2]/textarray[3]", "x", "20769"); + assertXPath(pDoc, "/metafile/push[2]/textarray[3]"_ostr, "x"_ostr, "20769"); // Fails without the fix: Expected: 4077, Actual: 4062 - assertXPath(pDoc, "/metafile/push[2]/textarray[3]", "y", "4077"); + assertXPath(pDoc, "/metafile/push[2]/textarray[3]"_ostr, "y"_ostr, "4077"); } void WmfTest::testTdf88163PlaceableWmf() @@ -191,26 +191,26 @@ void WmfTest::testTdf88163PlaceableWmf() // These values come from the fix for tdf#88163 // The fix does not affect the font size - auto x = getXPath(pDoc, "/metafile/push[2]/font[1]", "height"); + auto x = getXPath(pDoc, "/metafile/push[2]/font[1]"_ostr, "height"_ostr); CPPUNIT_ASSERT_EQUAL(sal_Int32(313), x.toInt32()); // Fails without the fix: Expected: 1900, Actual: 19818 - assertXPath(pDoc, "/metafile", "height", "1900"); + assertXPath(pDoc, "/metafile"_ostr, "height"_ostr, "1900"); // Fails without the fix: Expected: 704, Actual: 7336 - assertXPath(pDoc, "/metafile/push[2]/textarray[1]", "x", "704"); + assertXPath(pDoc, "/metafile/push[2]/textarray[1]"_ostr, "x"_ostr, "704"); // Fails without the fix: Expected: 394, Actual: 4110 - assertXPath(pDoc, "/metafile/push[2]/textarray[1]", "y", "394"); + assertXPath(pDoc, "/metafile/push[2]/textarray[1]"_ostr, "y"_ostr, "394"); // Fails without the fix: Expected: 573, Actual: 5971 - assertXPath(pDoc, "/metafile/push[2]/textarray[2]", "x", "573"); + assertXPath(pDoc, "/metafile/push[2]/textarray[2]"_ostr, "x"_ostr, "573"); // Fails without the fix: Expected: 1556, Actual: 16230 - assertXPath(pDoc, "/metafile/push[2]/textarray[2]", "y", "1556"); + assertXPath(pDoc, "/metafile/push[2]/textarray[2]"_ostr, "y"_ostr, "1556"); // Fails without the fix: Expected: 1987, Actual: 20706 - assertXPath(pDoc, "/metafile/push[2]/textarray[3]", "x", "1987"); + assertXPath(pDoc, "/metafile/push[2]/textarray[3]"_ostr, "x"_ostr, "1987"); // Fails without the fix: Expected: 390, Actual: 4068 - assertXPath(pDoc, "/metafile/push[2]/textarray[3]", "y", "390"); + assertXPath(pDoc, "/metafile/push[2]/textarray[3]"_ostr, "y"_ostr, "390"); } void WmfTest::testSetTextAlignWmf() @@ -226,80 +226,80 @@ void WmfTest::testSetTextAlignWmf() CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/metafile", "height", "20999"); + assertXPath(pDoc, "/metafile"_ostr, "height"_ostr, "20999"); - assertXPath(pDoc, "/metafile/push[2]/textalign[2]", "align", "top"); - assertXPath(pDoc, "/metafile/push[2]/textarray[2]", "x", "11642"); - assertXPath(pDoc, "/metafile/push[2]/textarray[2]", "y", "212"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[2]/text", "textalignment:default"); + assertXPath(pDoc, "/metafile/push[2]/textalign[2]"_ostr, "align"_ostr, "top"); + assertXPath(pDoc, "/metafile/push[2]/textarray[2]"_ostr, "x"_ostr, "11642"); + assertXPath(pDoc, "/metafile/push[2]/textarray[2]"_ostr, "y"_ostr, "212"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[2]/text"_ostr, "textalignment:default"); - assertXPath(pDoc, "/metafile/push[2]/textalign[3]", "align", "top"); - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[3]", "x", 12700, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[3]", "y", "212"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[3]/text", "textalignment:0x00"); + assertXPath(pDoc, "/metafile/push[2]/textalign[3]"_ostr, "align"_ostr, "top"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[3]"_ostr, "x"_ostr, 12700, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[3]"_ostr, "y"_ostr, "212"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[3]/text"_ostr, "textalignment:0x00"); - assertXPath(pDoc, "/metafile/push[2]/textalign[4]", "align", "top"); - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[4]", "x", 12026, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[4]", "y", "423"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[4]/text", "textalignment:0x02"); + assertXPath(pDoc, "/metafile/push[2]/textalign[4]"_ostr, "align"_ostr, "top"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[4]"_ostr, "x"_ostr, 12026, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[4]"_ostr, "y"_ostr, "423"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[4]/text"_ostr, "textalignment:0x02"); - assertXPath(pDoc, "/metafile/push[2]/textalign[5]", "align", "top"); + assertXPath(pDoc, "/metafile/push[2]/textalign[5]"_ostr, "align"_ostr, "top"); // Fails without the fix: Expected: 12026, Actual: 12350 - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[5]", "x", 12026, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[5]", "y", "635"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[5]/text", "textalignment:0x04"); - - assertXPath(pDoc, "/metafile/push[2]/textalign[6]", "align", "top"); - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[6]", "x", 12363, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[6]", "y", "847"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[6]/text", "textalignment:0x06"); - - assertXPath(pDoc, "/metafile/push[2]/textalign[7]", "align", "top"); - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[7]", "x", 12700, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[7]", "y", "1058"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[7]/text", "textalignment:0x08"); - - assertXPath(pDoc, "/metafile/push[2]/textalign[8]", "align", "top"); - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[8]", "x", 12026, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[8]", "y", "1270"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[8]/text", "textalignment:0x0A"); - - assertXPath(pDoc, "/metafile/push[2]/textalign[9]", "align", "bottom"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[5]"_ostr, "x"_ostr, 12026, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[5]"_ostr, "y"_ostr, "635"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[5]/text"_ostr, "textalignment:0x04"); + + assertXPath(pDoc, "/metafile/push[2]/textalign[6]"_ostr, "align"_ostr, "top"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[6]"_ostr, "x"_ostr, 12363, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[6]"_ostr, "y"_ostr, "847"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[6]/text"_ostr, "textalignment:0x06"); + + assertXPath(pDoc, "/metafile/push[2]/textalign[7]"_ostr, "align"_ostr, "top"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[7]"_ostr, "x"_ostr, 12700, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[7]"_ostr, "y"_ostr, "1058"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[7]/text"_ostr, "textalignment:0x08"); + + assertXPath(pDoc, "/metafile/push[2]/textalign[8]"_ostr, "align"_ostr, "top"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[8]"_ostr, "x"_ostr, 12026, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[8]"_ostr, "y"_ostr, "1270"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[8]/text"_ostr, "textalignment:0x0A"); + + assertXPath(pDoc, "/metafile/push[2]/textalign[9]"_ostr, "align"_ostr, "bottom"); // Fails without the fix: Expected: 12026, Actual: 12350 - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[9]", "x", 12026, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[9]", "y", "1482"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[9]/text", "textalignment:0x0C"); - - assertXPath(pDoc, "/metafile/push[2]/textalign[10]", "align", "bottom"); - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[10]", "x", 12363, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[10]", "y", "1693"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[10]/text", "textalignment:0x0E"); - - assertXPath(pDoc, "/metafile/push[2]/textalign[11]", "align", "bottom"); - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[11]", "x", 12700, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[11]", "y", "1905"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[11]/text", "textalignment:0x10"); - - assertXPath(pDoc, "/metafile/push[2]/textalign[12]", "align", "bottom"); - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[12]", "x", 12026, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[12]", "y", "2117"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[12]/text", "textalignment:0x12"); - - assertXPath(pDoc, "/metafile/push[2]/textalign[13]", "align", "bottom"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[9]"_ostr, "x"_ostr, 12026, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[9]"_ostr, "y"_ostr, "1482"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[9]/text"_ostr, "textalignment:0x0C"); + + assertXPath(pDoc, "/metafile/push[2]/textalign[10]"_ostr, "align"_ostr, "bottom"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[10]"_ostr, "x"_ostr, 12363, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[10]"_ostr, "y"_ostr, "1693"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[10]/text"_ostr, "textalignment:0x0E"); + + assertXPath(pDoc, "/metafile/push[2]/textalign[11]"_ostr, "align"_ostr, "bottom"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[11]"_ostr, "x"_ostr, 12700, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[11]"_ostr, "y"_ostr, "1905"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[11]/text"_ostr, "textalignment:0x10"); + + assertXPath(pDoc, "/metafile/push[2]/textalign[12]"_ostr, "align"_ostr, "bottom"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[12]"_ostr, "x"_ostr, 12026, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[12]"_ostr, "y"_ostr, "2117"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[12]/text"_ostr, "textalignment:0x12"); + + assertXPath(pDoc, "/metafile/push[2]/textalign[13]"_ostr, "align"_ostr, "bottom"); // Fails without the fix: Expected: 12026, Actual: 12350 - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[13]", "x", 12026, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[13]", "y", "2328"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[13]/text", "textalignment:0x14"); - - assertXPath(pDoc, "/metafile/push[2]/textalign[14]", "align", "bottom"); - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[14]", "x", 12363, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[14]", "y", "2540"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[14]/text", "textalignment:0x16"); - - assertXPath(pDoc, "/metafile/push[2]/textalign[15]", "align", "bottom"); - assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[15]", "x", 12700, 30); - assertXPath(pDoc, "/metafile/push[2]/textarray[15]", "y", "2752"); - assertXPathContent(pDoc, "/metafile/push[2]/textarray[15]/text", "textalignment:0x18"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[13]"_ostr, "x"_ostr, 12026, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[13]"_ostr, "y"_ostr, "2328"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[13]/text"_ostr, "textalignment:0x14"); + + assertXPath(pDoc, "/metafile/push[2]/textalign[14]"_ostr, "align"_ostr, "bottom"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[14]"_ostr, "x"_ostr, 12363, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[14]"_ostr, "y"_ostr, "2540"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[14]/text"_ostr, "textalignment:0x16"); + + assertXPath(pDoc, "/metafile/push[2]/textalign[15]"_ostr, "align"_ostr, "bottom"); + assertXPathDoubleValue(pDoc, "/metafile/push[2]/textarray[15]"_ostr, "x"_ostr, 12700, 30); + assertXPath(pDoc, "/metafile/push[2]/textarray[15]"_ostr, "y"_ostr, "2752"); + assertXPathContent(pDoc, "/metafile/push[2]/textarray[15]/text"_ostr, "textalignment:0x18"); } void WmfTest::testSine() @@ -315,7 +315,7 @@ void WmfTest::testSine() CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/metafile/sectrectclipregion", 0); + assertXPath(pDoc, "/metafile/sectrectclipregion"_ostr, 0); } void WmfTest::testEmfProblem() @@ -331,11 +331,11 @@ void WmfTest::testEmfProblem() CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/metafile/sectrectclipregion", 2); - assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "top", "2125"); - assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "left", "1084"); - assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "bottom", "2927"); - assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "right", "2376"); + assertXPath(pDoc, "/metafile/sectrectclipregion"_ostr, 2); + assertXPath(pDoc, "/metafile/sectrectclipregion[1]"_ostr, "top"_ostr, "2125"); + assertXPath(pDoc, "/metafile/sectrectclipregion[1]"_ostr, "left"_ostr, "1084"); + assertXPath(pDoc, "/metafile/sectrectclipregion[1]"_ostr, "bottom"_ostr, "2927"); + assertXPath(pDoc, "/metafile/sectrectclipregion[1]"_ostr, "right"_ostr, "2376"); } void WmfTest::testEmfLineStyles() @@ -352,50 +352,50 @@ void WmfTest::testEmfLineStyles() CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/metafile/line", 4); - assertXPath(pDoc, "/metafile/linecolor", 5); - - assertXPath(pDoc, "/metafile/linecolor[1]", "color", "#ffffff"); - assertXPath(pDoc, "/metafile/linecolor[2]", "color", "#00ff00"); - assertXPath(pDoc, "/metafile/linecolor[3]", "color", "#408080"); - assertXPath(pDoc, "/metafile/linecolor[4]", "color", "#ff0000"); - assertXPath(pDoc, "/metafile/linecolor[5]", "color", "#0000ff"); - - assertXPath(pDoc, "/metafile/line[1]", "style", "dash"); - assertXPath(pDoc, "/metafile/line[1]", "dashlen", "528"); - assertXPath(pDoc, "/metafile/line[1]", "dashcount", "1"); - assertXPath(pDoc, "/metafile/line[1]", "dotlen", "176"); - assertXPath(pDoc, "/metafile/line[1]", "dotcount", "0"); - assertXPath(pDoc, "/metafile/line[1]", "distance", "176"); - assertXPath(pDoc, "/metafile/line[1]", "join", "miter"); - assertXPath(pDoc, "/metafile/line[1]", "cap", "butt"); - - assertXPath(pDoc, "/metafile/line[2]", "style", "dash"); - assertXPath(pDoc, "/metafile/line[2]", "dashlen", "528"); - assertXPath(pDoc, "/metafile/line[2]", "dashcount", "0"); - assertXPath(pDoc, "/metafile/line[2]", "dotlen", "176"); - assertXPath(pDoc, "/metafile/line[2]", "dotcount", "1"); - assertXPath(pDoc, "/metafile/line[2]", "distance", "176"); - assertXPath(pDoc, "/metafile/line[2]", "join", "miter"); - assertXPath(pDoc, "/metafile/line[2]", "cap", "butt"); - - assertXPath(pDoc, "/metafile/line[3]", "style", "dash"); - assertXPath(pDoc, "/metafile/line[3]", "dashlen", "528"); - assertXPath(pDoc, "/metafile/line[3]", "dashcount", "1"); - assertXPath(pDoc, "/metafile/line[3]", "dotlen", "176"); - assertXPath(pDoc, "/metafile/line[3]", "dotcount", "1"); - assertXPath(pDoc, "/metafile/line[3]", "distance", "176"); - assertXPath(pDoc, "/metafile/line[3]", "join", "miter"); - assertXPath(pDoc, "/metafile/line[3]", "cap", "butt"); - - assertXPath(pDoc, "/metafile/line[4]", "style", "dash"); - assertXPath(pDoc, "/metafile/line[4]", "dashlen", "528"); - assertXPath(pDoc, "/metafile/line[4]", "dashcount", "1"); - assertXPath(pDoc, "/metafile/line[4]", "dotlen", "176"); - assertXPath(pDoc, "/metafile/line[4]", "dotcount", "2"); - assertXPath(pDoc, "/metafile/line[4]", "distance", "176"); - assertXPath(pDoc, "/metafile/line[4]", "join", "miter"); - assertXPath(pDoc, "/metafile/line[4]", "cap", "butt"); + assertXPath(pDoc, "/metafile/line"_ostr, 4); + assertXPath(pDoc, "/metafile/linecolor"_ostr, 5); + + assertXPath(pDoc, "/metafile/linecolor[1]"_ostr, "color"_ostr, "#ffffff"); + assertXPath(pDoc, "/metafile/linecolor[2]"_ostr, "color"_ostr, "#00ff00"); + assertXPath(pDoc, "/metafile/linecolor[3]"_ostr, "color"_ostr, "#408080"); + assertXPath(pDoc, "/metafile/linecolor[4]"_ostr, "color"_ostr, "#ff0000"); + assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, "#0000ff"); + + assertXPath(pDoc, "/metafile/line[1]"_ostr, "style"_ostr, "dash"); + assertXPath(pDoc, "/metafile/line[1]"_ostr, "dashlen"_ostr, "528"); + assertXPath(pDoc, "/metafile/line[1]"_ostr, "dashcount"_ostr, "1"); + assertXPath(pDoc, "/metafile/line[1]"_ostr, "dotlen"_ostr, "176"); + assertXPath(pDoc, "/metafile/line[1]"_ostr, "dotcount"_ostr, "0"); + assertXPath(pDoc, "/metafile/line[1]"_ostr, "distance"_ostr, "176"); + assertXPath(pDoc, "/metafile/line[1]"_ostr, "join"_ostr, "miter"); + assertXPath(pDoc, "/metafile/line[1]"_ostr, "cap"_ostr, "butt"); + + assertXPath(pDoc, "/metafile/line[2]"_ostr, "style"_ostr, "dash"); + assertXPath(pDoc, "/metafile/line[2]"_ostr, "dashlen"_ostr, "528"); + assertXPath(pDoc, "/metafile/line[2]"_ostr, "dashcount"_ostr, "0"); + assertXPath(pDoc, "/metafile/line[2]"_ostr, "dotlen"_ostr, "176"); + assertXPath(pDoc, "/metafile/line[2]"_ostr, "dotcount"_ostr, "1"); + assertXPath(pDoc, "/metafile/line[2]"_ostr, "distance"_ostr, "176"); + assertXPath(pDoc, "/metafile/line[2]"_ostr, "join"_ostr, "miter"); + assertXPath(pDoc, "/metafile/line[2]"_ostr, "cap"_ostr, "butt"); + + assertXPath(pDoc, "/metafile/line[3]"_ostr, "style"_ostr, "dash"); + assertXPath(pDoc, "/metafile/line[3]"_ostr, "dashlen"_ostr, "528"); + assertXPath(pDoc, "/metafile/line[3]"_ostr, "dashcount"_ostr, "1"); + assertXPath(pDoc, "/metafile/line[3]"_ostr, "dotlen"_ostr, "176"); + assertXPath(pDoc, "/metafile/line[3]"_ostr, "dotcount"_ostr, "1"); + assertXPath(pDoc, "/metafile/line[3]"_ostr, "distance"_ostr, "176"); + assertXPath(pDoc, "/metafile/line[3]"_ostr, "join"_ostr, "miter"); + assertXPath(pDoc, "/metafile/line[3]"_ostr, "cap"_ostr, "butt"); + + assertXPath(pDoc, "/metafile/line[4]"_ostr, "style"_ostr, "dash"); + assertXPath(pDoc, "/metafile/line[4]"_ostr, "dashlen"_ostr, "528"); + assertXPath(pDoc, "/metafile/line[4]"_ostr, "dashcount"_ostr, "1"); + assertXPath(pDoc, "/metafile/line[4]"_ostr, "dotlen"_ostr, "176"); + assertXPath(pDoc, "/metafile/line[4]"_ostr, "dotcount"_ostr, "2"); + assertXPath(pDoc, "/metafile/line[4]"_ostr, "distance"_ostr, "176"); + assertXPath(pDoc, "/metafile/line[4]"_ostr, "join"_ostr, "miter"); + assertXPath(pDoc, "/metafile/line[4]"_ostr, "cap"_ostr, "butt"); }; void WmfTest::testWorldTransformFontSize() @@ -411,27 +411,27 @@ void WmfTest::testWorldTransformFontSize() CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/metafile/font", 9); + assertXPath(pDoc, "/metafile/font"_ostr, 9); - assertXPath(pDoc, "/metafile/font[1]", "color", "#595959"); - assertXPath(pDoc, "/metafile/font[1]", "width", "0"); - assertXPath(pDoc, "/metafile/font[1]", "height", "389"); - assertXPath(pDoc, "/metafile/font[1]", "orientation", "0"); - assertXPath(pDoc, "/metafile/font[1]", "weight", "bold"); + assertXPath(pDoc, "/metafile/font[1]"_ostr, "color"_ostr, "#595959"); + assertXPath(pDoc, "/metafile/font[1]"_ostr, "width"_ostr, "0"); + assertXPath(pDoc, "/metafile/font[1]"_ostr, "height"_ostr, "389"); + assertXPath(pDoc, "/metafile/font[1]"_ostr, "orientation"_ostr, "0"); + assertXPath(pDoc, "/metafile/font[1]"_ostr, "weight"_ostr, "bold"); - assertXPath(pDoc, "/metafile/font[3]", "color", "#000000"); - assertXPath(pDoc, "/metafile/font[3]", "width", "0"); - assertXPath(pDoc, "/metafile/font[3]", "height", "389"); - assertXPath(pDoc, "/metafile/font[3]", "orientation", "0"); - assertXPath(pDoc, "/metafile/font[3]", "weight", "bold"); + assertXPath(pDoc, "/metafile/font[3]"_ostr, "color"_ostr, "#000000"); + assertXPath(pDoc, "/metafile/font[3]"_ostr, "width"_ostr, "0"); + assertXPath(pDoc, "/metafile/font[3]"_ostr, "height"_ostr, "389"); + assertXPath(pDoc, "/metafile/font[3]"_ostr, "orientation"_ostr, "0"); + assertXPath(pDoc, "/metafile/font[3]"_ostr, "weight"_ostr, "bold"); // World transform should not affect font size. Rotating text for 90 degrees // should not exchange font width and height. - assertXPath(pDoc, "/metafile/font[4]", "color", "#000000"); - assertXPath(pDoc, "/metafile/font[4]", "width", "0"); - assertXPath(pDoc, "/metafile/font[4]", "height", "530"); - assertXPath(pDoc, "/metafile/font[4]", "orientation", "900"); - assertXPath(pDoc, "/metafile/font[4]", "weight", "normal"); + assertXPath(pDoc, "/metafile/font[4]"_ostr, "color"_ostr, "#000000"); + assertXPath(pDoc, "/metafile/font[4]"_ostr, "width"_ostr, "0"); + assertXPath(pDoc, "/metafile/font[4]"_ostr, "height"_ostr, "530"); + assertXPath(pDoc, "/metafile/font[4]"_ostr, "orientation"_ostr, "900"); + assertXPath(pDoc, "/metafile/font[4]"_ostr, "weight"_ostr, "normal"); } void WmfTest::testBigPPI() @@ -451,8 +451,8 @@ void WmfTest::testBigPPI() // If the PPI was not reduced the width and height would be <100 which is too small // Related: tdf#150888 - assertXPath(pDoc, "/metafile", "width", "2540"); - assertXPath(pDoc, "/metafile", "height", "2143"); + assertXPath(pDoc, "/metafile"_ostr, "width"_ostr, "2540"); + assertXPath(pDoc, "/metafile"_ostr, "height"_ostr, "2143"); } void WmfTest::testTdf93750() @@ -466,8 +466,8 @@ void WmfTest::testTdf93750() CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/metafile/push[1]/comment[2]", "datasize", "28"); - assertXPath(pDoc, "/metafile/push[1]/comment[3]", "datasize", "72"); + assertXPath(pDoc, "/metafile/push[1]/comment[2]"_ostr, "datasize"_ostr, "28"); + assertXPath(pDoc, "/metafile/push[1]/comment[3]"_ostr, "datasize"_ostr, "72"); } void WmfTest::testTdf99402() @@ -504,7 +504,7 @@ void WmfTest::testTdf39894Wmf() // The x position of the second text must take into account // the previous text's last Dx (previously was ~300) - auto x = getXPath(pDoc, "/metafile/push[2]/textarray[2]", "x"); + auto x = getXPath(pDoc, "/metafile/push[2]/textarray[2]"_ostr, "x"_ostr); CPPUNIT_ASSERT_GREATER(sal_Int32(2700), x.toInt32()); } @@ -521,7 +521,7 @@ void WmfTest::testTdf39894Emf() // The x position of the second text must take into account // the previous text's last Dx (previously was ~300) - auto x = getXPath(pDoc, "/metafile/push[2]/textarray[2]", "x"); + auto x = getXPath(pDoc, "/metafile/push[2]/textarray[2]"_ostr, "x"_ostr); CPPUNIT_ASSERT_GREATER(sal_Int32(2700), x.toInt32()); } @@ -538,9 +538,9 @@ void WmfTest::testETO_PDYWmf() // The y position of following text // must be smaller than that of previous - auto y1 = getXPath(pDoc, "/metafile/push[2]/textarray[1]", "y"); - auto y2 = getXPath(pDoc, "/metafile/push[2]/textarray[2]", "y"); - auto y3 = getXPath(pDoc, "/metafile/push[2]/textarray[3]", "y"); + auto y1 = getXPath(pDoc, "/metafile/push[2]/textarray[1]"_ostr, "y"_ostr); + auto y2 = getXPath(pDoc, "/metafile/push[2]/textarray[2]"_ostr, "y"_ostr); + auto y3 = getXPath(pDoc, "/metafile/push[2]/textarray[3]"_ostr, "y"_ostr); CPPUNIT_ASSERT(y2.toInt32() < y1.toInt32()); CPPUNIT_ASSERT(y3.toInt32() < y2.toInt32()); } @@ -558,9 +558,9 @@ void WmfTest::testETO_PDYEmf() // The y position of following text // must be smaller than that of previous - auto y1 = getXPath(pDoc, "/metafile/push[2]/textarray[1]", "y"); - auto y2 = getXPath(pDoc, "/metafile/push[2]/textarray[2]", "y"); - auto y3 = getXPath(pDoc, "/metafile/push[2]/textarray[3]", "y"); + auto y1 = getXPath(pDoc, "/metafile/push[2]/textarray[1]"_ostr, "y"_ostr); + auto y2 = getXPath(pDoc, "/metafile/push[2]/textarray[2]"_ostr, "y"_ostr); + auto y3 = getXPath(pDoc, "/metafile/push[2]/textarray[3]"_ostr, "y"_ostr); CPPUNIT_ASSERT(y2.toInt32() < y1.toInt32()); CPPUNIT_ASSERT(y3.toInt32() < y2.toInt32()); } @@ -580,7 +580,7 @@ void WmfTest::testStockObject() // - Expected: 1 // - Actual : 0 // - In <>, XPath '/metafile/push[2]/fillcolor[2]' number of nodes is incorrect - assertXPath(pDoc, "/metafile/push[2]/fillcolor[2]", "color", "#000000"); + assertXPath(pDoc, "/metafile/push[2]/fillcolor[2]"_ostr, "color"_ostr, "#000000"); } CPPUNIT_TEST_SUITE_REGISTRATION(WmfTest); diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx index 0ba13d49727a..5acfdd8148b1 100644 --- a/emfio/source/reader/mtftools.cxx +++ b/emfio/source/reader/mtftools.cxx @@ -1547,10 +1547,10 @@ namespace emfio WriteSvtGraphicFill( aMemStm, aFill ); - mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_BEGIN", 0, + mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_BEGIN"_ostr, 0, static_cast<const sal_uInt8*>(aMemStm.GetData()), aMemStm.TellEnd() ) ); - mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_END" ) ); + mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_END"_ostr ) ); } } @@ -2515,14 +2515,14 @@ namespace emfio // on windows where the function parameters are probably resolved in reverse order mem.Flush(); - mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS_HEADER_INFO", 0, static_cast<const sal_uInt8*>(mem.GetData()), mem.GetEndOfData() ) ); + mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS_HEADER_INFO"_ostr, 0, static_cast<const sal_uInt8*>(mem.GetData()), mem.GetEndOfData() ) ); mpGDIMetaFile->UseCanvas( true ); } void MtfTools::PassEMFPlus( void const * pBuffer, sal_uInt32 nLength ) { EMFP_DEBUG(printf ("\t\t\tadd EMF_PLUS comment length %04x\n",(unsigned int) nLength)); - mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS", 0, static_cast<const sal_uInt8*>(pBuffer), nLength ) ); + mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS"_ostr, 0, static_cast<const sal_uInt8*>(pBuffer), nLength ) ); } } |