summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-04-29 07:46:31 +0900
committerTomaž Vajngerl <quikee@gmail.com>2019-04-29 03:52:39 +0200
commit654a7ad5420ca26f90f449122fa96ea2a53af0cf (patch)
tree67768494f915a74b08fe8072caa5e828692a1735 /vcl
parentc807d4d7643f09022c33272bee1f591d3221be8b (diff)
Add MetaActionHatch to the SVM test
Change-Id: I96113168d4ae8289cec3a5b0bbd6aa79faf97c48 Reviewed-on: https://gerrit.libreoffice.org/71493 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/svm/svmtest.cxx46
1 files changed, 44 insertions, 2 deletions
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index 107a8e4d1b36..50aa78fcfc2f 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -105,7 +105,7 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools
//void checkGradientEx(const GDIMetaFile& rMetaFile);
void testGradientEx();
- //void checkHatch(const GDIMetaFile& rMetaFile);
+ void checkHatch(const GDIMetaFile& rMetaFile);
void testHatch();
//void checkWallpaper(const GDIMetaFile& rMetaFile);
@@ -1195,8 +1195,50 @@ void SvmTest::testGradient()
void SvmTest::testGradientEx()
{}
+
+void SvmTest::checkHatch(const GDIMetaFile& rMetaFile)
+{
+ xmlDocPtr pDoc = dumpMeta(rMetaFile);
+
+ assertXPathAttrs(pDoc, "/metafile/hatch[1]/polygon/point[1]", {
+ {"x", "1"}, {"y", "8"},
+ });
+ assertXPathAttrs(pDoc, "/metafile/hatch[1]/polygon/point[2]", {
+ {"x", "2"}, {"y", "7"},
+ });
+ assertXPathAttrs(pDoc, "/metafile/hatch[1]/polygon/point[3]", {
+ {"x", "3"}, {"y", "6"},
+ });
+
+ assertXPathAttrs(pDoc, "/metafile/hatch[1]/hatch", {
+ {"style", "Single"},
+ {"color", "#ffff00"},
+ {"distance", "15"},
+ {"angle", "900"},
+ });
+}
+
void SvmTest::testHatch()
-{}
+{
+ GDIMetaFile aGDIMetaFile;
+ ScopedVclPtrInstance<VirtualDevice> pVirtualDev;
+ setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile);
+
+ tools::Polygon aPolygon(3);
+ aPolygon.SetPoint(Point(1, 8), 0);
+ aPolygon.SetPoint(Point(2, 7), 1);
+ aPolygon.SetPoint(Point(3, 6), 2);
+
+ tools::PolyPolygon aPolyPolygon(1);
+ aPolyPolygon.Insert(aPolygon);
+
+ Hatch aHatch(HatchStyle::Single, COL_YELLOW, 15, 900);
+
+ pVirtualDev->DrawHatch(aPolyPolygon, aHatch);
+
+ checkHatch(writeAndRead(aGDIMetaFile, "hatch.svm"));
+}
+
void SvmTest::testWallpaper()
{}
void SvmTest::testClipRegion()