summaryrefslogtreecommitdiff
path: root/emfio/qa
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2021-05-04 16:08:35 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2021-05-07 21:02:22 +0200
commit1ef26ffe39618a745d3367310565e7eeb184a4c2 (patch)
tree0c37afc8591f7f5de32403065147d84c55d2c427 /emfio/qa
parent13ce37a85ac73a88567c2066fac694e4fc02a6f8 (diff)
tdf#55058 tdf#141982 EMF: Add rotation support for INTERSECTCLIPRECT record
With this commit the rotation support was added for INTERSECTCLIPRECT. Before that change rotation was not applied to these CLIP rectangles. Change-Id: I3da66790e0aeeaaeeb28d2fc30780cba8dbda390 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115102 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'emfio/qa')
-rw-r--r--emfio/qa/cppunit/emf/EmfImportTest.cxx17
-rw-r--r--emfio/qa/cppunit/emf/data/TestEllipseXformIntersectClipRect.emfbin0 -> 316 bytes
2 files changed, 17 insertions, 0 deletions
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index 83b42a3020d0..e5b1f3f54114 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -55,6 +55,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools, public unotest:
void TestRectangleWithModifyWorldTransform();
void TestChordWithModifyWorldTransform();
void TestEllipseWithSelectClipPath();
+ void TestEllipseXformIntersectClipRect();
void TestDrawPolyLine16WithClip();
void TestFillRegion();
void TestCreatePen();
@@ -78,6 +79,7 @@ public:
CPPUNIT_TEST(TestRectangleWithModifyWorldTransform);
CPPUNIT_TEST(TestChordWithModifyWorldTransform);
CPPUNIT_TEST(TestEllipseWithSelectClipPath);
+ CPPUNIT_TEST(TestEllipseXformIntersectClipRect);
CPPUNIT_TEST(TestDrawPolyLine16WithClip);
CPPUNIT_TEST(TestFillRegion);
CPPUNIT_TEST(TestCreatePen);
@@ -370,6 +372,21 @@ void Test::TestEllipseWithSelectClipPath()
assertXPathContent(pDocument, "/primitive2D/metafile/transform/group/mask/polygonstroke[1]/polygon", "353,353 2825,353 2825,1410 353,1410");
}
+void Test::TestEllipseXformIntersectClipRect()
+{
+ // EMF import test with records: EXTCREATEPEN, CREATEBRUSHINDIRECT, MODIFYWORLDTRANSFORM, INTERSECTCLIPRECT, ELLIPSE
+ Primitive2DSequence aSequence = parseEmf(u"/emfio/qa/cppunit/emf/data/TestEllipseXformIntersectClipRect.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 0h3000v2000h-3000z");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/group/mask/polypolygon", "path", "m370 152 1128-409 592 1623-1128 410z");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/group/mask/polypolygoncolor/polypolygon", "path", "m3565 155-58-55-205-150-90-42-124-30-392-45-368 21-211 39-598 217-187 105-21 46-121 81-66 24-87 69-272 287-75 102-42 90-61 247-9 79 97 265 57 54 205 150 91 42 124 31 392 45 112-3 467-58 597-217 187-105 296-220 271-286 76-103 42-90 60-247 9-78z");
+ assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/group/mask/polygonstroke/polygon", "3565,155 3507,100 3302,-50 3212,-92 3088,-122 2696,-167 2328,-146 2117,-107 1519,110 1332,215 1311,261 1190,342 1124,366 1037,435 765,722 690,824 648,914 587,1161 578,1240 675,1505 732,1559 937,1709 1028,1751 1152,1782 1544,1827 1656,1824 2123,1766 2720,1549 2907,1444 3203,1224 3474,938 3550,835 3592,745 3652,498 3661,420");
+}
+
void Test::TestDrawPolyLine16WithClip()
{
// Check import of EMF image with records:
diff --git a/emfio/qa/cppunit/emf/data/TestEllipseXformIntersectClipRect.emf b/emfio/qa/cppunit/emf/data/TestEllipseXformIntersectClipRect.emf
new file mode 100644
index 000000000000..bda2ad233f4a
--- /dev/null
+++ b/emfio/qa/cppunit/emf/data/TestEllipseXformIntersectClipRect.emf
Binary files differ