summaryrefslogtreecommitdiff
path: root/svgio/qa/cppunit
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-07-10 14:46:34 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-07-10 16:54:06 +0200
commit56039daae4a436d7ea1b093a02cf0e8ad3bda4a9 (patch)
tree0b4e73635d20fe250d26146ce7b6bd9033185ff4 /svgio/qa/cppunit
parent3d5b5914ef56395a8ba3d4c0a2eff8a5c52046b4 (diff)
tdf#149673: only check opacity from parent...
... if it has a local css style Because it's the first in the style stack Partially reverts 3e0e67a152e9631574e28dacb6e06a96f03ebca2 "tdf#155932: tdf#97717: only apply opacity when primitive" Change-Id: I6a6bf08a519c84ac58c6111fd7da308cbf8a3021 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154270 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa/cppunit')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx16
-rw-r--r--svgio/qa/cppunit/data/tdf149673.svg7
2 files changed, 23 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index fc9557a5c312..0f8b31d4b1cc 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -835,6 +835,22 @@ CPPUNIT_TEST_FIXTURE(Test, testRGBColor)
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor/polypolygon", "maxy", "110");
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf149673)
+{
+ Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf149673.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/unifiedtransparence", "transparence", "90");
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence/polypolygoncolor[1]", "color", "#ff0000");
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence/polypolygoncolor[2]", "color", "#00ff00");
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence/polypolygoncolor[3]", "color", "#0000ff");
+}
+
CPPUNIT_TEST_FIXTURE(Test, testRGBAColor)
{
Primitive2DSequence aSequenceRGBAColor = parseSvg(u"/svgio/qa/cppunit/data/RGBAColor.svg");
diff --git a/svgio/qa/cppunit/data/tdf149673.svg b/svgio/qa/cppunit/data/tdf149673.svg
new file mode 100644
index 000000000000..f73b9959d342
--- /dev/null
+++ b/svgio/qa/cppunit/data/tdf149673.svg
@@ -0,0 +1,7 @@
+<svg id="svg1" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
+ <g id="g1" opacity=".1">
+ <circle id="circle1" cx="100" cy="60" fill="#f00" r="40"/>
+ <circle id="circle2" cx="70" cy="100" fill="#0f0" r="40"/>
+ <circle id="circle3" cx="130" cy="100" fill="#00f" r="40"/>
+ </g>
+</svg>