diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2011-11-03 14:58:40 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2011-11-03 15:02:00 +0100 |
commit | f7975d2335334899e5d14e35e7640d3afdf220f6 (patch) | |
tree | 2c97dc4a14afce606d8f68ee28777c917371ab17 /basebmp/test | |
parent | Add possibilty to embed ole object and to pass paragraph borders (diff) | |
download | core-f7975d2335334899e5d14e35e7640d3afdf220f6.tar.gz core-f7975d2335334899e5d14e35e7640d3afdf220f6.zip |
Fix one more subtlety around B2IBox / B2IRange changes.
The Cohen/Sutherland clip flag routine was not aware of B2IBox,
thusly yielding incorrect line clipping for BitmapDevice software
rendering. Cleaned that up, added some more unit tests around the
problem, and removed the now-extraneous maLineClip member from the
bitmap device.
Diffstat (limited to 'basebmp/test')
-rw-r--r-- | basebmp/test/basictest.cxx | 16 | ||||
-rw-r--r-- | basebmp/test/polytest.cxx | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/basebmp/test/basictest.cxx b/basebmp/test/basictest.cxx index 246a25a5e7a1..63292729d419 100644 --- a/basebmp/test/basictest.cxx +++ b/basebmp/test/basictest.cxx @@ -116,6 +116,21 @@ public: (*pDevice->getPalette())[1] == Color(0xFFFFFFFF) ); } + void testClone() + { + const basegfx::B2ISize aSize(101,101); + basegfx::B2ISize aSize2(3,3); + BitmapDeviceSharedPtr pDevice( createBitmapDevice( aSize, + true, + Format::ONE_BIT_MSB_PAL )); + + BitmapDeviceSharedPtr pClone( cloneBitmapDevice( + aSize2, + pDevice )); + CPPUNIT_ASSERT_MESSAGE("right size", + pClone->getSize() == aSize2 ); + } + void testPixelFuncs() { // 1bpp @@ -288,6 +303,7 @@ public: CPPUNIT_TEST_SUITE(BasicTest); CPPUNIT_TEST(colorTest); CPPUNIT_TEST(testConstruction); + CPPUNIT_TEST(testClone); CPPUNIT_TEST(testPixelFuncs); CPPUNIT_TEST_SUITE_END(); }; diff --git a/basebmp/test/polytest.cxx b/basebmp/test/polytest.cxx index 177557cec565..8cc51d4921ee 100644 --- a/basebmp/test/polytest.cxx +++ b/basebmp/test/polytest.cxx @@ -192,6 +192,8 @@ private: BitmapDeviceSharedPtr pClippedDevice( subsetBitmapDevice( rDevice, basegfx::B2IBox(3,3,5,8) )); + CPPUNIT_ASSERT_MESSAGE("size of subsetted device is not (2,5)", + pClippedDevice->getSize() == basegfx::B2IVector(2,5)); rDevice->clear(aBgCol); pClippedDevice->fillPolyPolygon( |