diff options
Diffstat (limited to 'emfio')
-rw-r--r-- | emfio/qa/cppunit/emf/EmfImportTest.cxx | 23 | ||||
-rw-r--r-- | emfio/qa/cppunit/emf/data/TestEmfPlusBrushPathGradientWithBlendColors.emf | bin | 0 -> 2404 bytes |
2 files changed, 23 insertions, 0 deletions
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx index cf999c2dff6e..40db85d69d2e 100644 --- a/emfio/qa/cppunit/emf/EmfImportTest.cxx +++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx @@ -65,6 +65,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools, public unotest: void TestSetArcDirection(); void TestDrawPolyLine16WithClip(); void TestFillRegion(); + void TestEmfPlusBrushPathGradientWithBlendColors(); void TestEmfPlusGetDC(); void TestEmfPlusSave(); void TestEmfPlusDrawPathWithMiterLimit(); @@ -115,6 +116,7 @@ public: CPPUNIT_TEST(TestSetArcDirection); CPPUNIT_TEST(TestDrawPolyLine16WithClip); CPPUNIT_TEST(TestFillRegion); + CPPUNIT_TEST(TestEmfPlusBrushPathGradientWithBlendColors); CPPUNIT_TEST(TestEmfPlusGetDC); CPPUNIT_TEST(TestEmfPlusSave); CPPUNIT_TEST(TestEmfPlusDrawPathWithMiterLimit); @@ -532,6 +534,7 @@ void Test::TestLinearGradient() assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "width", "15232"); assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path", "m0 0h15232v7610h-15232z"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "spreadmethod", "repeat"); assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "startx", "0"); assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "starty", "-1"); assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]", "endx", "0"); @@ -540,6 +543,8 @@ void Test::TestLinearGradient() "0.392156862745098"); assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[1]/polypolygon", "path", "m0 0.216110019646294h7615.75822989746v7610.21611001965h-7615.75822989746z"); + + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "spreadmethod", "repeat"); assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "startx", "-1"); assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "starty", "-1"); assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "endx", "0"); @@ -959,6 +964,24 @@ void Test::TestPolylinetoCloseStroke() assertXPath(pDocument, aXPathPrefix + "polygonhairline[2]", "color", "#000000"); } +void Test::TestEmfPlusBrushPathGradientWithBlendColors() +{ + // tdf#131506 EMF+ records: FillRects, Brush with PathGradient and BlendColor, FillRects + Primitive2DSequence aSequence + = parseEmf(u"emfio/qa/cppunit/emf/data/TestEmfPlusBrushPathGradientWithBlendColors.emf"); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength())); + drawinglayer::Primitive2dXmlDump dumper; + xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequence)); + CPPUNIT_ASSERT(pDocument); + + assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "radius", "0.7"); + assertXPath(pDocument, aXPathPrefix + "svgradialgradient/focalx", 0); + assertXPath(pDocument, aXPathPrefix + "svgradialgradient/focaly", 0); + assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "startx", "0"); + assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "starty", "0"); + assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "spreadmethod", "pad"); +} + void Test::TestEmfPlusGetDC() { // tdf#147818 EMF+ records: GetDC, DrawPath, FillRects diff --git a/emfio/qa/cppunit/emf/data/TestEmfPlusBrushPathGradientWithBlendColors.emf b/emfio/qa/cppunit/emf/data/TestEmfPlusBrushPathGradientWithBlendColors.emf Binary files differnew file mode 100644 index 000000000000..caa9876bd449 --- /dev/null +++ b/emfio/qa/cppunit/emf/data/TestEmfPlusBrushPathGradientWithBlendColors.emf |