summaryrefslogtreecommitdiff
path: root/svgio/qa/cppunit/SvgImportTest.cxx
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2019-09-19 11:45:20 +0200
committerXisco Faulí <xiscofauli@libreoffice.org>2019-09-19 13:51:57 +0200
commitab1479956568b0d9a6022133cf651f846293aa46 (patch)
treefa4ab602b7d395e732d60df2ecd13eab69b827d7 /svgio/qa/cppunit/SvgImportTest.cxx
parentab825c665c1ee509769bdaf0ae95fc111a357fc6 (diff)
tdf#94765: SVGIO: Look for gradient/pattern ids once the file...
... is completely parsed it might happen the element's id the url points to hasn't been parsed yet Change-Id: Ia92c9188de5d23f2f992846aa91f3f936aeefacb Reviewed-on: https://gerrit.libreoffice.org/79118 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa/cppunit/SvgImportTest.cxx')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx23
1 files changed, 21 insertions, 2 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 4fe57b9adc3d..ea510cdbe1a5 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -64,6 +64,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools
void testTdf99994();
void testTdf99115();
void testTdf101237();
+ void testTdf94765();
void testBehaviourWhenWidthAndHeightIsOrIsNotSet();
Primitive2DSequence parseSvg(const OUString& aSource);
@@ -95,6 +96,7 @@ public:
CPPUNIT_TEST(testTdf99994);
CPPUNIT_TEST(testTdf99115);
CPPUNIT_TEST(testTdf101237);
+ CPPUNIT_TEST(testTdf94765);
CPPUNIT_TEST(testBehaviourWhenWidthAndHeightIsOrIsNotSet);
CPPUNIT_TEST_SUITE_END();
};
@@ -390,8 +392,8 @@ void Test::testTdf97542_2()
CPPUNIT_ASSERT (pDocument);
- assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient[1]", "x", "1");
- assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient[1]", "y", "1");
+ assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient[1]", "focusx", "1");
+ assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient[1]", "focusy", "1");
assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient[1]", "radius", "3");
}
@@ -676,6 +678,23 @@ void Test::testTdf101237()
assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/line", "width", "5");
}
+void Test::testTdf94765()
+{
+ Primitive2DSequence aSequenceTdf94765 = parseSvg("/svgio/qa/cppunit/data/tdf94765.svg");
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf94765.getLength()));
+
+ drawinglayer::tools::Primitive2dXmlDump dumper;
+ xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf94765));
+
+ CPPUNIT_ASSERT (pDocument);
+
+ //Check that both rectangles use the gradient as fill
+ assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[1]", "endx", "2");
+ assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[1]", "endy", "1");
+ assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[2]", "endx", "0");
+ assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[2]", "endy", "0");
+}
+
void Test::testBehaviourWhenWidthAndHeightIsOrIsNotSet()
{
// This test checks the behaviour when width and height attributes