summaryrefslogtreecommitdiffstats
path: root/svgio/qa/cppunit
diff options
context:
space:
mode:
Diffstat (limited to 'svgio/qa/cppunit')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx36
-rw-r--r--svgio/qa/cppunit/data/tdf156834.svg3
-rw-r--r--svgio/qa/cppunit/data/tdf158445.svg5
-rw-r--r--svgio/qa/cppunit/data/tdf159594.svg7
4 files changed, 49 insertions, 2 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 1b0be44177..0ba32d8cb9 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -764,7 +764,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156834)
CPPUNIT_ASSERT (pDocument);
- assertXPath(pDocument, "/primitive2D/transform/textsimpleportion"_ostr, 3);
+ assertXPath(pDocument, "/primitive2D/transform/textsimpleportion"_ostr, 4);
assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]"_ostr, "text"_ostr, "Auto");
assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]"_ostr, "x"_ostr, "30");
assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]"_ostr, "y"_ostr, "20");
@@ -776,6 +776,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156834)
assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]"_ostr, "text"_ostr, "Hanging");
assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]"_ostr, "x"_ostr, "30");
assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]"_ostr, "y"_ostr, "94");
+
+ assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]"_ostr, "text"_ostr, "Central");
+ assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]"_ostr, "x"_ostr, "30");
+ assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]"_ostr, "y"_ostr, "116");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf104339)
@@ -1591,6 +1595,36 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf155733)
assertXPath(pDocument, "/primitive2D/transform/transform/unifiedtransparence"_ostr, "transparence"_ostr, "50");
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf158445)
+{
+ Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf158445.svg");
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
+
+ drawinglayer::Primitive2dXmlDump dumper;
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence));
+
+ CPPUNIT_ASSERT (pDocument);
+
+ assertXPath(pDocument, "/primitive2D/transform/mask/transform/transform/transform/polypolygoncolor"_ostr, "color"_ostr, "#000000");
+ assertXPath(pDocument, "/primitive2D/transform/mask/transform/transform/transform/polypolygoncolor/polypolygon"_ostr, "height"_ostr, "8.052");
+ assertXPath(pDocument, "/primitive2D/transform/mask/transform/transform/transform/polypolygoncolor/polypolygon"_ostr, "width"_ostr, "5.328");
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testTdf159594)
+{
+ Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf159594.svg");
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
+
+ drawinglayer::Primitive2dXmlDump dumper;
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence));
+
+ CPPUNIT_ASSERT (pDocument);
+
+ assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor"_ostr, "color"_ostr, "#000000");
+ assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor/polypolygon"_ostr, "height"_ostr, "11.671875");
+ assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor/polypolygon"_ostr, "width"_ostr, "7.5");
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf97663)
{
Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/em_units.svg");
diff --git a/svgio/qa/cppunit/data/tdf156834.svg b/svgio/qa/cppunit/data/tdf156834.svg
index 74dc154818..0ef81f9a6a 100644
--- a/svgio/qa/cppunit/data/tdf156834.svg
+++ b/svgio/qa/cppunit/data/tdf156834.svg
@@ -1,7 +1,8 @@
<svg viewBox="0 0 200 120" xmlns="http://www.w3.org/2000/svg">
- <path d="M20,20 L180,20 M20,50 L180,50 M20,80 L180,80" stroke="grey" />
+ <path d="M20,20 L180,20 M20,50 L180,50 M20,80 L180,80 M20,110 L180,110" stroke="grey" />
<text dominant-baseline="auto" x="30" y="20" font-size="20">Auto</text>
<text dominant-baseline="middle" x="30" y="50" font-size="20">Middle</text>
<text dominant-baseline="Hanging" x="30" y="80" font-size="20">Hanging</text>
+ <text dominant-baseline="central" x="30" y="110" font-size="20">Central</text>
</svg>
diff --git a/svgio/qa/cppunit/data/tdf158445.svg b/svgio/qa/cppunit/data/tdf158445.svg
new file mode 100644
index 0000000000..20e084dd05
--- /dev/null
+++ b/svgio/qa/cppunit/data/tdf158445.svg
@@ -0,0 +1,5 @@
+<svg width="160.353" height="30.488" xmlns="http://www.w3.org/2000/svg" viewBox="-0.376 -26.625 160.353 30.488">
+<symbol id="STIXTwoMathRegular_4275" width="5.868" height="51.216" viewBox="0 -31.524 5.868 51.216">
+<path d="M 5.868 -2.088 L 5.868 -2.088 L 5.46 0 L 0.54 0 L 0.54 -0.588 L 2.244 -2.316 Q 2.916 -2.988 3.354 -3.504 Q 3.792 -4.02 4.008 -4.542 Q 4.224 -5.064 4.224 -5.736 Q 4.224 -6.372 3.834 -6.786 Q 3.444 -7.2 2.736 -7.2 Q 2.088 -7.2 1.65 -6.942 Q 1.212 -6.684 0.876 -6.096 L 0.552 -6.252 Q 0.852 -7.092 1.482 -7.572 Q 2.112 -8.052 3.036 -8.052 Q 3.756 -8.052 4.308 -7.794 Q 4.86 -7.536 5.172 -7.056 Q 5.484 -6.576 5.484 -5.892 Q 5.484 -5.304 5.22 -4.788 Q 4.956 -4.272 4.47 -3.732 Q 3.984 -3.192 3.312 -2.532 L 1.812 -1.08 L 1.812 -0.996 L 2.748 -1.044 L 4.308 -1.044 Q 4.656 -1.044 4.842 -1.14 Q 5.028 -1.236 5.16 -1.47 Q 5.292 -1.704 5.448 -2.088 Z " viewBox="0 -31.524 5.868 51.216"/>
+</symbol>
+<use href="#STIXTwoMathRegular_4275" transform="translate(151.174 -52.774) scale(1.4)" fill="black" /></svg>
diff --git a/svgio/qa/cppunit/data/tdf159594.svg b/svgio/qa/cppunit/data/tdf159594.svg
new file mode 100644
index 0000000000..c2b470ec0f
--- /dev/null
+++ b/svgio/qa/cppunit/data/tdf159594.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1">
+<symbol overflow="visible" id="glyph">
+<path style="stroke:none;" d="M 1.3125 -11.671875 L 8.8125 -11.671875 L 8.8125 -11 L 4.578125 0 L 2.9375 0 L 6.921875 -10.34375 L 1.3125 -10.34375 Z M 1.3125 -11.671875 "/>
+</symbol>
+<use xlink:href="#glyph" x="40" y="30"/>
+</svg>