diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2021-04-02 16:06:11 +0200 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2021-04-03 15:30:46 +0200 |
commit | aa17ea3d36b8f1ea8cd3d2fb215e80051547439d (patch) | |
tree | 29f7d426b321e7fe69b0595b4d6c8086ab8c2830 /emfio/qa/cppunit | |
parent | 58db3df246d7f8e8824e36894c435b40207fe07e (diff) |
As the visual glitches were resolved with:
https://gerrit.libreoffice.org/c/core/+/113423
It is time for enabling complex clipping.
Change-Id: I12edc88fc9a55c8deedf3d87faeb50cfe0067a01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113520
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'emfio/qa/cppunit')
-rw-r--r-- | emfio/qa/cppunit/emf/EmfImportTest.cxx | 30 | ||||
-rw-r--r-- | emfio/qa/cppunit/emf/data/TestDrawPolyLine16WithClip.emf | bin | 0 -> 1088 bytes | |||
-rw-r--r-- | emfio/qa/cppunit/wmf/wmfimporttest.cxx | 9 |
3 files changed, 35 insertions, 4 deletions
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx index 4213b373eebb..9ab862f6cd69 100644 --- a/emfio/qa/cppunit/emf/EmfImportTest.cxx +++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx @@ -51,6 +51,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools, public unotest: void TestLinearGradient(); void TestTextMapMode(); void TestEnglishMapMode(); + void TestDrawPolyLine16WithClip(); void TestFillRegion(); void TestCreatePen(); void TestPdfInEmf(); @@ -70,6 +71,7 @@ public: CPPUNIT_TEST(TestLinearGradient); CPPUNIT_TEST(TestTextMapMode); CPPUNIT_TEST(TestEnglishMapMode); + CPPUNIT_TEST(TestDrawPolyLine16WithClip); CPPUNIT_TEST(TestFillRegion); CPPUNIT_TEST(TestCreatePen); CPPUNIT_TEST(TestPdfInEmf); @@ -311,6 +313,34 @@ void Test::TestEnglishMapMode() } +void Test::TestDrawPolyLine16WithClip() +{ + // Check import of EMF image with records: + // CREATEBRUSHINDIRECT, FILLRGN, BEGINPATH, POLYGON16, SELECTCLIPPATH, MODIFYWORLDTRANSFORM, SELECTOBJECT + Primitive2DSequence aSequence = parseEmf(u"/emfio/qa/cppunit/emf/data/TestDrawPolyLine16WithClip.emf"); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength())); + drawinglayer::Primitive2dXmlDump dumper; + xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence)); + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygon", "path", "m0 0h3943v3939h-3943z"); + + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygoncolor", 1); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygoncolor[1]/polypolygon", + "path", "m1323 0h1323v1322h1323v1322h-1323v1322h-1323v-1322h-1323v-1322h1323z"); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygoncolor[1]", "color", "#b4ffff"); + + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline", 1); + assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[1]/polygon", + "1323,0 2646,0 2646,1322 3969,1322 3969,2644 2646,2644 2646,3966 1323,3966 1323,2644 0,2644 0,1322 1323,1322"); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[1]", "color", "#000000"); + + + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/group[1]/mask/polypolygon", "path", "m2646 0v1322h1323v1322h-1323v1322h-1323v-1322h-1323v-1322h1323v-1322"); + assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/group[1]/mask/polygonstroke/polygon", "0,793 3969,4230"); + +} + void Test::TestFillRegion() { // Check import of EMF image with records: CREATEBRUSHINDIRECT, FILLRGN. The SETICMMODE is also used. diff --git a/emfio/qa/cppunit/emf/data/TestDrawPolyLine16WithClip.emf b/emfio/qa/cppunit/emf/data/TestDrawPolyLine16WithClip.emf Binary files differnew file mode 100644 index 000000000000..acb69cc34ce3 --- /dev/null +++ b/emfio/qa/cppunit/emf/data/TestDrawPolyLine16WithClip.emf diff --git a/emfio/qa/cppunit/wmf/wmfimporttest.cxx b/emfio/qa/cppunit/wmf/wmfimporttest.cxx index 9be21a2735bd..41c15e3989f8 100644 --- a/emfio/qa/cppunit/wmf/wmfimporttest.cxx +++ b/emfio/qa/cppunit/wmf/wmfimporttest.cxx @@ -126,10 +126,11 @@ void WmfTest::testEmfProblem() CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "top", "427"); - assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "left", "740"); - assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "bottom", "2823"); - assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "right", "1876"); + assertXPath(pDoc, "/metafile/sectrectclipregion", 2); + assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "top", "2125"); + assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "left", "1084"); + assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "bottom", "2927"); + assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "right", "2376"); } void WmfTest::testEmfLineStyles() |