summaryrefslogtreecommitdiff
path: root/svgio/qa/cppunit
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-06-19 13:18:42 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-06-19 15:32:49 +0200
commitd47b37eea9779e3c354e6c19a7211a306965b7ef (patch)
tree9dea50e5dd37d49352027f2363052057684f6308 /svgio/qa/cppunit
parent99d01ff26fe69ccc66f49b3ddd43b258c3687f2c (diff)
tdf#97717: do not call add_postProcess from g element
Otherwise, it will be called twice, from g and from its children Change-Id: I88535a7caab6a7711f917b3f383cd79b3b9fbd2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153260 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa/cppunit')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx19
-rw-r--r--svgio/qa/cppunit/data/tdf97717.svg11
2 files changed, 30 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index ba267f5443a5..c9ec752d882a 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -302,6 +302,25 @@ CPPUNIT_TEST_FIXTURE(Test, testFontsizeRelative)
assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "familyname", "serif");
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf97717)
+{
+ //Check when font-size uses relative units (em,ex) and it's based on its parent's font-size
+ Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf97717.svg");
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
+
+ drawinglayer::Primitive2dXmlDump dumper;
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequence);
+
+ CPPUNIT_ASSERT (pDocument);
+
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence[1]", "transparence", "50");
+ // Without the fix in place, this test would have failed here since the patch
+ // would have contained two unifiedtransparence
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence[1]/polypolygoncolor", "color", "#ccccff");
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence[2]", "transparence", "50");
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence[2]/polypolygoncolor", "color", "#ccccff");
+}
+
CPPUNIT_TEST_FIXTURE(Test, testMarkerOrient)
{
Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/MarkerOrient.svg");
diff --git a/svgio/qa/cppunit/data/tdf97717.svg b/svgio/qa/cppunit/data/tdf97717.svg
new file mode 100644
index 000000000000..c354e4416827
--- /dev/null
+++ b/svgio/qa/cppunit/data/tdf97717.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-0 0 300 300">
+
+ <g opacity="0.5">
+ <rect x="0" y="0" height="50" width="50"
+ style="fill: #ccccff">
+ </rect>
+ </g>
+ <rect x="60" y="0" height="50" width="50"
+ style="fill: #ccccff" opacity="0.5">
+ </rect>
+</svg>