summaryrefslogtreecommitdiff
path: root/svgio/qa/cppunit
diff options
context:
space:
mode:
Diffstat (limited to 'svgio/qa/cppunit')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx21
-rw-r--r--svgio/qa/cppunit/data/textXmlSpace.svg12
2 files changed, 33 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 07a98f4a5a2f..23734777cf2c 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -48,6 +48,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools
void testMarkerOrient();
void testMarkerInPresentation();
void testMarkerInCssStyle();
+ void testTextXmlSpace();
void testTdf45771();
void testTdf97941();
void testTdf104339();
@@ -97,6 +98,7 @@ public:
CPPUNIT_TEST(testMarkerOrient);
CPPUNIT_TEST(testMarkerInPresentation);
CPPUNIT_TEST(testMarkerInCssStyle);
+ CPPUNIT_TEST(testTextXmlSpace);
CPPUNIT_TEST(testTdf45771);
CPPUNIT_TEST(testTdf97941);
CPPUNIT_TEST(testTdf104339);
@@ -420,6 +422,25 @@ void Test::testMarkerInCssStyle()
assertXPath(pDocument, "/primitive2D/transform/transform[1]/polypolygonstroke/line", "linecap", "BUTT");
}
+void Test::testTextXmlSpace()
+{
+ //Check tspan fontsize when using relative units
+ Primitive2DSequence aSequenceTdf97941 = parseSvg(u"/svgio/qa/cppunit/data/textXmlSpace.svg");
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf97941.getLength()));
+
+ drawinglayer::Primitive2dXmlDump dumper;
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequenceTdf97941);
+
+ CPPUNIT_ASSERT (pDocument);
+
+ assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[1]", "text", "a b");
+ assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[2]", "text", "a b");
+ assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[3]", "text", "a b");
+ assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", "text", "a b");
+ assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[5]", "text", "a b");
+ assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[6]", "text", "a b");
+}
+
void Test::testTdf45771()
{
//Check text fontsize when using relative units
diff --git a/svgio/qa/cppunit/data/textXmlSpace.svg b/svgio/qa/cppunit/data/textXmlSpace.svg
new file mode 100644
index 000000000000..606e2eb7a306
--- /dev/null
+++ b/svgio/qa/cppunit/data/textXmlSpace.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
+ viewBox="0 0 250 250">
+ <text y="10" xml:space="default">a b</text>
+ <text y="30" xml:space="default">a b</text>
+ <text y="50" xml:space="default">a
+ b</text>
+ <text y="70" xml:space="preserve">a b</text>
+ <text y="90" xml:space="preserve">a b</text>
+ <text y="110" xml:space="preserve">a
+ b</text>
+</svg>
+