[Libreoffice-commits] core.git: svgio/qa test/source
Xisco Fauli
anistenis at gmail.com
Tue Feb 9 14:27:23 UTC 2016
svgio/qa/cppunit/SvgImportTest.cxx | 17 +++++++++++++++++
svgio/qa/cppunit/data/tdf85770.svg | 7 +++++++
test/source/primitive2dxmldump.cxx | 2 ++
3 files changed, 26 insertions(+)
New commits:
commit 8fbbb923ea752e3c5b147824f0dc04e4b9e27dad
Author: Xisco Fauli <anistenis at gmail.com>
Date: Sun Feb 7 20:27:05 2016 +0100
SVGIO: tdf#85770: Add import test
Change-Id: Ifffe1d461ae6fa30a9cc61df2ece5716078031ab
Reviewed-on: https://gerrit.libreoffice.org/22190
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: jan iversen <jani at documentfoundation.org>
Tested-by: jan iversen <jani at documentfoundation.org>
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index cc4c267..f918a15 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -43,6 +43,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools
void testFontsizeKeywords();
void testFontsizePercentage();
void testTdf45771();
+ void testTdf85770();
Primitive2DSequence parseSvg(const char* aSource);
@@ -56,6 +57,7 @@ public:
CPPUNIT_TEST(testFontsizeKeywords);
CPPUNIT_TEST(testFontsizePercentage);
CPPUNIT_TEST(testTdf45771);
+ CPPUNIT_TEST(testTdf85770);
CPPUNIT_TEST_SUITE_END();
};
@@ -204,6 +206,21 @@ void Test::testTdf45771()
assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "32");
}
+
+void Test::testTdf85770()
+{
+ Primitive2DSequence aSequenceTdf85770 = parseSvg("/svgio/qa/cppunit/data/tdf85770.svg");
+ CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceTdf85770.getLength());
+
+ Primitive2dXmlDump dumper;
+ xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf85770));
+
+ CPPUNIT_ASSERT (pDocument);
+
+ assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", "Start Middle End");
+ assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "text", "Start ");
+ assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "text", "End");
+}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
diff --git a/svgio/qa/cppunit/data/tdf85770.svg b/svgio/qa/cppunit/data/tdf85770.svg
new file mode 100644
index 0000000..b1cf9eb
--- /dev/null
+++ b/svgio/qa/cppunit/data/tdf85770.svg
@@ -0,0 +1,7 @@
+<svg id="svg-root"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="13cm" height="11cm">
+<text x="5" y="35" font-size="x-small">Start Middle End</text>
+<text x="5" y="65" font-size="x-small">Start <tspan visibility="hidden">Middle</tspan> End</text>
+</svg>
diff --git a/test/source/primitive2dxmldump.cxx b/test/source/primitive2dxmldump.cxx
index 940dea0..48fa0d0 100644
--- a/test/source/primitive2dxmldump.cxx
+++ b/test/source/primitive2dxmldump.cxx
@@ -178,6 +178,8 @@ void Primitive2dXmlDump::decomposeAndWrite(
{
rWriter.attribute("height", aScale.getY());
}
+
+ rWriter.attribute("text", pTextSimplePortionPrimitive2D->getText());
rWriter.endElement();
}
break;
More information about the Libreoffice-commits
mailing list