diff options
author | panoskorovesis <panoskorovesis@outlook.com> | 2021-06-14 14:04:37 +0300 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-06-16 08:22:48 +0200 |
commit | 240c6557898de6a7777b2b2055d1c133a803b396 (patch) | |
tree | b5dd745da7393c27af2dfe63d12ea75da36322cf /vcl/qa | |
parent | 81472692c4ee0b12c6d2184823faefa7a53431e6 (diff) |
Add MoveClipRegion cppunit test to vcl
The test creates two MoveClipRegions and checks their attributes.
mtfxmldump.cxx was modified to support MoveClipRegion case.
Change-Id: Ibfabf9d4048cf94e43c259e411a6c59b73baff34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117153
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/svm/data/moveclipregion.svm | bin | 0 -> 287 bytes | |||
-rw-r--r-- | vcl/qa/cppunit/svm/svmtest.cxx | 35 |
2 files changed, 33 insertions, 2 deletions
diff --git a/vcl/qa/cppunit/svm/data/moveclipregion.svm b/vcl/qa/cppunit/svm/data/moveclipregion.svm Binary files differnew file mode 100644 index 000000000000..6b53403741be --- /dev/null +++ b/vcl/qa/cppunit/svm/data/moveclipregion.svm diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx index 3fb91f84f006..02fbcdb5c04f 100644 --- a/vcl/qa/cppunit/svm/svmtest.cxx +++ b/vcl/qa/cppunit/svm/svmtest.cxx @@ -136,7 +136,7 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools void checkIntersectRegionClipRegion(const GDIMetaFile& rMetaFile); void testIntersectRegionClipRegion(); - //void checkMoveClipRegion(const GDIMetaFile& rMetaFile); + void checkMoveClipRegion(const GDIMetaFile& rMetaFile); void testMoveClipRegion(); void checkLineColor(const GDIMetaFile& rMetaFile); @@ -1647,8 +1647,39 @@ void SvmTest::testIntersectRegionClipRegion() checkIntersectRegionClipRegion(readFile(u"intersectregionclipregion.svm")); } +void SvmTest::checkMoveClipRegion(const GDIMetaFile& rMetaFile) +{ + xmlDocUniquePtr pDoc = dumpMeta(rMetaFile); + + assertXPathAttrs(pDoc, "/metafile/moveclipregion[1]", { + {"horzmove", "1"}, + {"vertmove", "2"} + }); + + assertXPathAttrs(pDoc, "/metafile/moveclipregion[2]", { + {"horzmove", "-3"}, + {"vertmove", "-4"} + }); +} + void SvmTest::testMoveClipRegion() -{} +{ + GDIMetaFile aGDIMetaFile; + ScopedVclPtrInstance<VirtualDevice> pVirtualDev; + setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); + + tools::Rectangle aRectangle(Point(1, 2), Size(4, 8)); + + vcl::Region aRegion(aRectangle); + aRegion.Move(2, 2); + pVirtualDev->SetClipRegion(aRegion); + + pVirtualDev->MoveClipRegion(1, 2); + pVirtualDev->MoveClipRegion(-3, -4); + + checkMoveClipRegion(writeAndReadStream(aGDIMetaFile)); + checkMoveClipRegion(readFile(u"moveclipregion.svm")); +} void SvmTest::checkLineColor(const GDIMetaFile& rMetaFile) { |