diff options
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index 51d13d35fdec..e0895588a17f 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -22,6 +22,7 @@ #include <drawinglayer/tools/primitive2dxmldump.hxx> #include <memory> +#include <string_view> namespace { @@ -69,7 +70,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools void testTdf94765(); void testBehaviourWhenWidthAndHeightIsOrIsNotSet(); - Primitive2DSequence parseSvg(const OUString& aSource); + Primitive2DSequence parseSvg(std::u16string_view aSource); public: CPPUNIT_TEST_SUITE(Test); @@ -106,7 +107,7 @@ public: CPPUNIT_TEST_SUITE_END(); }; -Primitive2DSequence Test::parseSvg(const OUString& aSource) +Primitive2DSequence Test::parseSvg(std::u16string_view aSource) { const Reference<XSvgParser> xSvgParser = SvgTools::create(m_xContext); @@ -157,19 +158,19 @@ bool arePrimitive2DSequencesEqual(const Primitive2DSequence& rA, const Primitive // however the end result should be the same. void Test::testStyles() { - Primitive2DSequence aSequenceRect = parseSvg("/svgio/qa/cppunit/data/Rect.svg"); + Primitive2DSequence aSequenceRect = parseSvg(u"/svgio/qa/cppunit/data/Rect.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceRect.getLength())); checkRectPrimitive(aSequenceRect); - Primitive2DSequence aSequenceRectWithStyle = parseSvg("/svgio/qa/cppunit/data/RectWithStyles.svg"); + Primitive2DSequence aSequenceRectWithStyle = parseSvg(u"/svgio/qa/cppunit/data/RectWithStyles.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceRectWithStyle.getLength())); checkRectPrimitive(aSequenceRectWithStyle); - Primitive2DSequence aSequenceRectWithParentStyle = parseSvg("/svgio/qa/cppunit/data/RectWithParentStyles.svg"); + Primitive2DSequence aSequenceRectWithParentStyle = parseSvg(u"/svgio/qa/cppunit/data/RectWithParentStyles.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceRectWithParentStyle.getLength())); checkRectPrimitive(aSequenceRectWithParentStyle); - Primitive2DSequence aSequenceRectWithStylesByGroup = parseSvg("/svgio/qa/cppunit/data/RectWithStylesByGroup.svg"); + Primitive2DSequence aSequenceRectWithStylesByGroup = parseSvg(u"/svgio/qa/cppunit/data/RectWithStylesByGroup.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceRectWithStylesByGroup.getLength())); checkRectPrimitive(aSequenceRectWithStylesByGroup); @@ -180,7 +181,7 @@ void Test::testStyles() void Test::testTdf87309() { - Primitive2DSequence aSequenceTdf87309 = parseSvg("/svgio/qa/cppunit/data/tdf87309.svg"); + Primitive2DSequence aSequenceTdf87309 = parseSvg(u"/svgio/qa/cppunit/data/tdf87309.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf87309.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -199,7 +200,7 @@ void Test::testTdf87309() void Test::testFontsizeKeywords() { - Primitive2DSequence aSequenceFontsizeKeywords = parseSvg("/svgio/qa/cppunit/data/FontsizeKeywords.svg"); + Primitive2DSequence aSequenceFontsizeKeywords = parseSvg(u"/svgio/qa/cppunit/data/FontsizeKeywords.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceFontsizeKeywords.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -262,7 +263,7 @@ void Test::testFontsizeKeywords() void Test::testFontsizePercentage() { //Check when font-size uses percentage and defined globally - Primitive2DSequence aSequenceFontsizePercentage = parseSvg("/svgio/qa/cppunit/data/FontsizePercentage.svg"); + Primitive2DSequence aSequenceFontsizePercentage = parseSvg(u"/svgio/qa/cppunit/data/FontsizePercentage.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceFontsizePercentage.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -279,7 +280,7 @@ void Test::testFontsizePercentage() void Test::testFontsizeRelative() { //Check when font-size uses relative units (em,ex) and it's based on its parent's font-size - Primitive2DSequence aSequenceFontsizeRelative = parseSvg("/svgio/qa/cppunit/data/FontsizeRelative.svg"); + Primitive2DSequence aSequenceFontsizeRelative = parseSvg(u"/svgio/qa/cppunit/data/FontsizeRelative.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceFontsizeRelative.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -301,7 +302,7 @@ void Test::testFontsizeRelative() void Test::testTdf45771() { //Check text fontsize when using relative units - Primitive2DSequence aSequenceTdf45771 = parseSvg("/svgio/qa/cppunit/data/tdf45771.svg"); + Primitive2DSequence aSequenceTdf45771 = parseSvg(u"/svgio/qa/cppunit/data/tdf45771.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf45771.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -318,7 +319,7 @@ void Test::testTdf45771() void Test::testTdf97941() { //Check tspan fontsize when using relative units - Primitive2DSequence aSequenceTdf97941 = parseSvg("/svgio/qa/cppunit/data/tdf97941.svg"); + Primitive2DSequence aSequenceTdf97941 = parseSvg(u"/svgio/qa/cppunit/data/tdf97941.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf97941.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -334,7 +335,7 @@ void Test::testTdf97941() void Test::testTdf104339() { - Primitive2DSequence aSequenceTdf104339 = parseSvg("/svgio/qa/cppunit/data/tdf104339.svg"); + Primitive2DSequence aSequenceTdf104339 = parseSvg(u"/svgio/qa/cppunit/data/tdf104339.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf104339.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -346,7 +347,7 @@ void Test::testTdf104339() void Test::testTdf85770() { - Primitive2DSequence aSequenceTdf85770 = parseSvg("/svgio/qa/cppunit/data/tdf85770.svg"); + Primitive2DSequence aSequenceTdf85770 = parseSvg(u"/svgio/qa/cppunit/data/tdf85770.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf85770.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -372,7 +373,7 @@ void Test::testTdf85770() void Test::testTdf79163() { //Check Opacity - Primitive2DSequence aSequenceTdf79163 = parseSvg("/svgio/qa/cppunit/data/tdf79163.svg"); + Primitive2DSequence aSequenceTdf79163 = parseSvg(u"/svgio/qa/cppunit/data/tdf79163.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf79163.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -385,7 +386,7 @@ void Test::testTdf79163() void Test::testTdf97542_1() { - Primitive2DSequence aSequenceTdf97542_1 = parseSvg("/svgio/qa/cppunit/data/tdf97542_1.svg"); + Primitive2DSequence aSequenceTdf97542_1 = parseSvg(u"/svgio/qa/cppunit/data/tdf97542_1.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf97542_1.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -401,7 +402,7 @@ void Test::testTdf97542_1() void Test::testTdf97542_2() { - Primitive2DSequence aSequenceTdf97542_2 = parseSvg("/svgio/qa/cppunit/data/tdf97542_2.svg"); + Primitive2DSequence aSequenceTdf97542_2 = parseSvg(u"/svgio/qa/cppunit/data/tdf97542_2.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf97542_2.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -417,7 +418,7 @@ void Test::testTdf97542_2() void Test::testTdf97543() { // check visibility="inherit" - Primitive2DSequence aSequenceTdf97543 = parseSvg("/svgio/qa/cppunit/data/tdf97543.svg"); + Primitive2DSequence aSequenceTdf97543 = parseSvg(u"/svgio/qa/cppunit/data/tdf97543.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf97543.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -436,7 +437,7 @@ void Test::testTdf97543() void Test::testRGBColor() { - Primitive2DSequence aSequenceRGBColor = parseSvg("/svgio/qa/cppunit/data/RGBColor.svg"); + Primitive2DSequence aSequenceRGBColor = parseSvg(u"/svgio/qa/cppunit/data/RGBColor.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceRGBColor.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -455,7 +456,7 @@ void Test::testRGBColor() void Test::testRGBAColor() { - Primitive2DSequence aSequenceRGBAColor = parseSvg("/svgio/qa/cppunit/data/RGBAColor.svg"); + Primitive2DSequence aSequenceRGBAColor = parseSvg(u"/svgio/qa/cppunit/data/RGBAColor.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceRGBAColor.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -468,7 +469,7 @@ void Test::testRGBAColor() void Test::testNoneColor() { - Primitive2DSequence aSequenceRGBAColor = parseSvg("/svgio/qa/cppunit/data/noneColor.svg"); + Primitive2DSequence aSequenceRGBAColor = parseSvg(u"/svgio/qa/cppunit/data/noneColor.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceRGBAColor.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -485,7 +486,7 @@ void Test::testNoneColor() void Test::testTdf97936() { // check that both rectangles are rendered in the viewBox - Primitive2DSequence aSequenceTdf97936 = parseSvg("/svgio/qa/cppunit/data/tdf97936.svg"); + Primitive2DSequence aSequenceTdf97936 = parseSvg(u"/svgio/qa/cppunit/data/tdf97936.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf97936.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -513,7 +514,7 @@ void Test::testClipPathAndParentStyle() { //Check that fill color, stroke color and stroke-width are inherited from use element //when the element is within a clipPath element - Primitive2DSequence aSequenceClipPathAndParentStyle = parseSvg("/svgio/qa/cppunit/data/ClipPathAndParentStyle.svg"); + Primitive2DSequence aSequenceClipPathAndParentStyle = parseSvg(u"/svgio/qa/cppunit/data/ClipPathAndParentStyle.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceClipPathAndParentStyle.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -531,7 +532,7 @@ void Test::testClipPathAndStyle() { //Check that fill color, stroke color and stroke-width are inherited from use element //when the element is within a clipPath element - Primitive2DSequence aSequenceClipPathAndStyle = parseSvg("/svgio/qa/cppunit/data/ClipPathAndStyle.svg"); + Primitive2DSequence aSequenceClipPathAndStyle = parseSvg(u"/svgio/qa/cppunit/data/ClipPathAndStyle.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceClipPathAndStyle.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -548,7 +549,7 @@ void Test::testClipPathAndStyle() void Test::testi125329() { //Check style inherit from * css element - Primitive2DSequence aSequencei125329 = parseSvg("/svgio/qa/cppunit/data/i125329.svg"); + Primitive2DSequence aSequencei125329 = parseSvg(u"/svgio/qa/cppunit/data/i125329.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequencei125329.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -571,7 +572,7 @@ void Test::testMaskingPath07b() { //For the time being, check that masking-path-07-b.svg can be imported and it doesn't hang on loading //it used to hang after d5649ae7b76278cb3155f951d6327157c7c92b65 - Primitive2DSequence aSequenceMaskingPath07b = parseSvg("/svgio/qa/cppunit/data/masking-path-07-b.svg"); + Primitive2DSequence aSequenceMaskingPath07b = parseSvg(u"/svgio/qa/cppunit/data/masking-path-07-b.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceMaskingPath07b.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -583,7 +584,7 @@ void Test::testMaskingPath07b() void Test::test123926() { - Primitive2DSequence aSequence123926 = parseSvg("/svgio/qa/cppunit/data/tdf123926.svg"); + Primitive2DSequence aSequence123926 = parseSvg(u"/svgio/qa/cppunit/data/tdf123926.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence123926.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -597,7 +598,7 @@ void Test::test123926() void Test::test47446() { //Check that marker's fill attribute is black is not set - Primitive2DSequence aSequence47446 = parseSvg("/svgio/qa/cppunit/data/47446.svg"); + Primitive2DSequence aSequence47446 = parseSvg(u"/svgio/qa/cppunit/data/47446.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence47446.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -612,7 +613,7 @@ void Test::test47446() void Test::test47446b() { //Check that marker's fill attribute is inherit from def - Primitive2DSequence aSequence47446b = parseSvg("/svgio/qa/cppunit/data/47446b.svg"); + Primitive2DSequence aSequence47446b = parseSvg(u"/svgio/qa/cppunit/data/47446b.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence47446b.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -627,7 +628,7 @@ void Test::test47446b() void Test::testMaskText() { //Check that mask is applied on text - Primitive2DSequence aSequenceMaskText = parseSvg("/svgio/qa/cppunit/data/maskText.svg"); + Primitive2DSequence aSequenceMaskText = parseSvg(u"/svgio/qa/cppunit/data/maskText.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceMaskText.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -645,7 +646,7 @@ void Test::testMaskText() void Test::testTdf99994() { //Check text fontsize when using relative units - Primitive2DSequence aSequenceTdf99994 = parseSvg("/svgio/qa/cppunit/data/tdf99994.svg"); + Primitive2DSequence aSequenceTdf99994 = parseSvg(u"/svgio/qa/cppunit/data/tdf99994.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf99994.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -662,7 +663,7 @@ void Test::testTdf99994() void Test::testTdf99115() { //Check that styles are resolved correctly where there is a * css selector - Primitive2DSequence aSequenceTdf99115 = parseSvg("/svgio/qa/cppunit/data/tdf99115.svg"); + Primitive2DSequence aSequenceTdf99115 = parseSvg(u"/svgio/qa/cppunit/data/tdf99115.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf99115.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -711,7 +712,7 @@ void Test::testTdf101237() { //Check that fill color, stroke color and stroke-width are inherited from use element //when the element is within a clipPath element - Primitive2DSequence aSequenceTdf101237 = parseSvg("/svgio/qa/cppunit/data/tdf101237.svg"); + Primitive2DSequence aSequenceTdf101237 = parseSvg(u"/svgio/qa/cppunit/data/tdf101237.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf101237.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -726,7 +727,7 @@ void Test::testTdf101237() void Test::testTdf94765() { - Primitive2DSequence aSequenceTdf94765 = parseSvg("/svgio/qa/cppunit/data/tdf94765.svg"); + Primitive2DSequence aSequenceTdf94765 = parseSvg(u"/svgio/qa/cppunit/data/tdf94765.svg"); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf94765.getLength())); drawinglayer::Primitive2dXmlDump dumper; @@ -754,7 +755,7 @@ void Test::testBehaviourWhenWidthAndHeightIsOrIsNotSet() // the container. { - const Primitive2DSequence aSequence = parseSvg("svgio/qa/cppunit/data/Drawing_WithWidthHeight.svg"); + const Primitive2DSequence aSequence = parseSvg(u"svgio/qa/cppunit/data/Drawing_WithWidthHeight.svg"); CPPUNIT_ASSERT(aSequence.hasElements()); geometry::RealRectangle2D aRealRect; @@ -778,7 +779,7 @@ void Test::testBehaviourWhenWidthAndHeightIsOrIsNotSet() } { - const Primitive2DSequence aSequence = parseSvg("svgio/qa/cppunit/data/Drawing_NoWidthHeight.svg"); + const Primitive2DSequence aSequence = parseSvg(u"svgio/qa/cppunit/data/Drawing_NoWidthHeight.svg"); CPPUNIT_ASSERT(aSequence.hasElements()); |