summaryrefslogtreecommitdiff
path: root/emfio
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2018-03-02 01:07:57 +0100
committerBartosz Kosiorek <gang65@poczta.onet.pl>2018-04-06 16:03:01 +0200
commit2afdea17162731888ad8f09fae2bb50e4246d7e9 (patch)
tree2288f4be8988231fdec200449dbcd620764a21f7 /emfio
parent8a15416e047f822369827404d6437548569af76c (diff)
tdf#114738 Add support for transparency for EMF+ records
With current EMF+ implementation all filled figures, does not support transparency. This patch add transparency support for following EMF+ records: - DrawDriverString - DrawString - FillEllipse - FillRects - FillPolygon - FillPie - FillPath - FillRegion Change-Id: I1e59ea90bdf5fafc07ff9417fccace44872bbecd Reviewed-on: https://gerrit.libreoffice.org/50609 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'emfio')
-rw-r--r--emfio/qa/cppunit/emf/EmfImportTest.cxx26
-rw-r--r--emfio/qa/cppunit/emf/data/TestDrawStringTransparent.emfbin0 -> 480 bytes
2 files changed, 26 insertions, 0 deletions
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index 2c1cad733f06..49c7abde157f 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -39,6 +39,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools
void testWorking();
void TestDrawString();
+ void TestDrawStringTransparent();
void TestDrawLine();
Primitive2DSequence parseEmf(const OUString& aSource);
@@ -47,6 +48,7 @@ public:
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testWorking);
CPPUNIT_TEST(TestDrawString);
+ CPPUNIT_TEST(TestDrawStringTransparent);
CPPUNIT_TEST(TestDrawLine);
CPPUNIT_TEST_SUITE_END();
};
@@ -112,6 +114,30 @@ void Test::TestDrawString()
assertXPath(pDocument, "/primitive2D/metafile/transform/textsimpleportion", "familyname", "CALIBRI");
}
+void Test::TestDrawStringTransparent()
+{
+ // This unit checks for a correct import of an EMF+ file with one DrawString Record with transparency
+
+ // first, get the sequence of primitives and dump it
+ Primitive2DSequence aSequence = parseEmf("/emfio/qa/cppunit/emf/data/TestDrawStringTransparent.emf");
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
+ Primitive2dXmlDump dumper;
+ xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence));
+ CPPUNIT_ASSERT (pDocument);
+
+ //TODO Strange that transparency is set to 0 even if it is not fully transparent
+ // check correct import of the DrawString: transparency, height, position, text, color and font
+ assertXPath(pDocument, "/primitive2D/metafile/transform/unifiedtransparence", "transparence", "0");
+
+ //TODO Where was textsimpleportion gone?
+ //assertXPath(pDocument, "/primitive2D/metafile/transform/textsimpleportion", "height", "276");
+ //assertXPath(pDocument, "/primitive2D/metafile/transform/textsimpleportion", "x", "25");
+ //assertXPath(pDocument, "/primitive2D/metafile/transform/textsimpleportion", "y", "323");
+ //assertXPath(pDocument, "/primitive2D/metafile/transform/textsimpleportion", "text", "Transparent Text");
+ //assertXPath(pDocument, "/primitive2D/metafile/transform/textsimpleportion", "fontcolor", "#000000");
+ //assertXPath(pDocument, "/primitive2D/metafile/transform/textsimpleportion", "familyname", "CALIBRI");
+}
+
void Test::TestDrawLine()
{
// This unit checks for a correct import of an EMF+ file with only one DrawLine Record
diff --git a/emfio/qa/cppunit/emf/data/TestDrawStringTransparent.emf b/emfio/qa/cppunit/emf/data/TestDrawStringTransparent.emf
new file mode 100644
index 000000000000..73954c4902c7
--- /dev/null
+++ b/emfio/qa/cppunit/emf/data/TestDrawStringTransparent.emf
Binary files differ