summaryrefslogtreecommitdiff
path: root/emfio
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2021-05-18 17:36:21 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2021-05-18 20:42:27 +0200
commit39369c6e67dffe04acc4abb678c1a94526237fd8 (patch)
tree17b340b353e13bb5e9bc3385ae7ea2cb62345c53 /emfio
parent8cf56338a96c77f4712130cc775d57410bd9b623 (diff)
tdf#55007 tdf#142263 tdf#142268 EMF Properly display ARC and CHORD
With previous implementation the ARC, ARCTO and CHORD were not displayed if the corners of rectangle was switched. With this patch the shapes are always displayed correctly. Change-Id: Ie8ac7af812298c0b96c3b5af417117784f128ce1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115757 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'emfio')
-rw-r--r--emfio/qa/cppunit/emf/EmfImportTest.cxx15
-rw-r--r--emfio/qa/cppunit/emf/data/TestArcInsideWronglyDefinedRectangle.emfbin0 -> 264 bytes
2 files changed, 15 insertions, 0 deletions
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index fceb43b30215..64c7effa1baa 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -53,6 +53,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools, public unotest:
void TestTextMapMode();
void TestEnglishMapMode();
void TestRectangleWithModifyWorldTransform();
+ void TestArcInsideWronglyDefinedRectangle();
void TestChordWithModifyWorldTransform();
void TestEllipseWithSelectClipPath();
void TestEllipseXformIntersectClipRect();
@@ -81,6 +82,7 @@ public:
CPPUNIT_TEST(TestTextMapMode);
CPPUNIT_TEST(TestEnglishMapMode);
CPPUNIT_TEST(TestRectangleWithModifyWorldTransform);
+ CPPUNIT_TEST(TestArcInsideWronglyDefinedRectangle);
CPPUNIT_TEST(TestChordWithModifyWorldTransform);
CPPUNIT_TEST(TestEllipseWithSelectClipPath);
CPPUNIT_TEST(TestEllipseXformIntersectClipRect);
@@ -360,6 +362,19 @@ void Test::TestChordWithModifyWorldTransform()
assertXPathContent(pDocument, "/primitive2D/metafile/transform/polygonstroke/polygon", "590,448 436,541 382,598 361,643 385,710 430,731 654,725 919,628");
}
+void Test::TestArcInsideWronglyDefinedRectangle()
+{
+ // tdf#142268 EMF import test with records: ARC
+ Primitive2DSequence aSequence = parseEmf(u"/emfio/qa/cppunit/emf/data/TestArcInsideWronglyDefinedRectangle.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/polygonhairline", "color", "#000000");
+ assertXPathContent(pDocument, "/primitive2D/metafile/transform/polygonhairline/polygon", "1630,1460 1800,1530 1850,1540 1980,1540 2030,1530 2170,1470 2220,1440 2330,1330 2380,1240 2420,1140 2430,1060 2430,950 2420,930 2410,870 2410,850 2380,770 2290,640 2120,520 2090,510 2070,510 2040,500 2020,490 1970,480 1860,480 1760,500 1670,540 1600,580 1520,660 1510,680 1480,720 1460,740 1450,760");
+}
+
void Test::TestEllipseWithSelectClipPath()
{
// EMF import test with records: RECTANGLE, BEGINPATH, ENDPATH, ELLIPSE
diff --git a/emfio/qa/cppunit/emf/data/TestArcInsideWronglyDefinedRectangle.emf b/emfio/qa/cppunit/emf/data/TestArcInsideWronglyDefinedRectangle.emf
new file mode 100644
index 000000000000..3a785fba6cac
--- /dev/null
+++ b/emfio/qa/cppunit/emf/data/TestArcInsideWronglyDefinedRectangle.emf
Binary files differ