diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2022-06-16 02:47:23 +0200 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2022-06-27 10:24:13 +0200 |
commit | 5b21b65572610df88986e700b81f1156aff14f65 (patch) | |
tree | 340f3853fa498974e5108bef05fc9f2bcd804267 /emfio | |
parent | 75e2d313760847110479f00a86a19fba4f508181 (diff) |
tdf#142770 tdf#143031 EMF+ Implement CustomLineCap
Change-Id: I9fae1d259ecdca37a1babac8a8a0e503b2dc0118
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135960
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'emfio')
-rw-r--r-- | emfio/qa/cppunit/emf/EmfImportTest.cxx | 26 | ||||
-rw-r--r-- | emfio/qa/cppunit/emf/data/TestEmfPlusDrawPathWithCustomCap.emf | bin | 0 -> 492 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 40db85d69d2e..b423eae91721 100644 --- a/emfio/qa/cppunit/emf/EmfImportTest.cxx +++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx @@ -68,6 +68,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools, public unotest: void TestEmfPlusBrushPathGradientWithBlendColors(); void TestEmfPlusGetDC(); void TestEmfPlusSave(); + void TestEmfPlusDrawPathWithCustomCap(); void TestEmfPlusDrawPathWithMiterLimit(); void TestEmfPlusFillClosedCurve(); void TestExtTextOutOpaqueAndClipTransform(); @@ -119,6 +120,7 @@ public: CPPUNIT_TEST(TestEmfPlusBrushPathGradientWithBlendColors); CPPUNIT_TEST(TestEmfPlusGetDC); CPPUNIT_TEST(TestEmfPlusSave); + CPPUNIT_TEST(TestEmfPlusDrawPathWithCustomCap); CPPUNIT_TEST(TestEmfPlusDrawPathWithMiterLimit); CPPUNIT_TEST(TestEmfPlusFillClosedCurve); CPPUNIT_TEST(TestExtTextOutOpaqueAndClipTransform); @@ -1046,6 +1048,30 @@ void Test::TestEmfPlusSave() "12832.6557236512,4907.54325697157"); } +void Test::TestEmfPlusDrawPathWithCustomCap() +{ + // tdf#142261 EMF+ records: DrawPath, SetWorldTransform, Object (Brush, Pen, Path) + // Check if CustomEndCap is displayed correctly + Primitive2DSequence aSequence + = parseEmf(u"emfio/qa/cppunit/emf/data/TestEmfPlusDrawPathWithCustomCap.emf"); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength())); + drawinglayer::Primitive2dXmlDump dumper; + xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); + CPPUNIT_ASSERT(pDocument); + + assertXPathContent(pDocument, aXPathPrefix + "polygonstrokearrow/polygon", + "1423.297394625,1268.98481214025 830.006276132353,558.656004112967"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/line", "color", "#cc0000"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/line", "width", "96"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/line", "linecap", "BUTT"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/stroke", 0); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/linestartattribute", 0); + + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/lineendattribute", "centered", "0"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/lineendattribute/polypolygon", "path", + "m-1.5 3 1.5-3 1.5 3z"); +} + void Test::TestEmfPlusDrawPathWithMiterLimit() { // tdf#142261 EMF+ records: DrawPath, TranslateWorldTransform, Object (Brush, Pen, Path) diff --git a/emfio/qa/cppunit/emf/data/TestEmfPlusDrawPathWithCustomCap.emf b/emfio/qa/cppunit/emf/data/TestEmfPlusDrawPathWithCustomCap.emf Binary files differnew file mode 100644 index 000000000000..e94986431618 --- /dev/null +++ b/emfio/qa/cppunit/emf/data/TestEmfPlusDrawPathWithCustomCap.emf |