diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-01-19 11:40:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-01-19 13:24:28 +0000 |
commit | f73e72fb33f111c2eda12aa359b96dad680e6848 (patch) | |
tree | 4471f76112aad3eb6b06015457ec02f7e7cb194a /basebmp | |
parent | 8b5e8dfed7c7c3c6669062a3db04961fe5eb1855 (diff) |
only use of clone is to copy, so do that
Change-Id: I75cfb96e4afd69fd0f6a6716ce4be282aa8d3b14
Diffstat (limited to 'basebmp')
-rw-r--r-- | basebmp/source/bitmapdevice.cxx | 7 | ||||
-rw-r--r-- | basebmp/test/basictest.cxx | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx index 6c848600a114..3ca3bdf229a5 100644 --- a/basebmp/source/bitmapdevice.cxx +++ b/basebmp/source/bitmapdevice.cxx @@ -668,13 +668,14 @@ BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize rPalette ); } -BitmapDeviceSharedPtr cloneBitmapDevice( const basegfx::B2IVector& rSize, - const BitmapDeviceSharedPtr& rProto ) +BitmapDeviceSharedPtr cloneBitmapDevice(const BitmapDeviceSharedPtr& rProto) { - return createBitmapDeviceImpl( rSize, + BitmapDeviceSharedPtr aCopy = createBitmapDeviceImpl(rProto->getSize(), rProto->getScanlineFormat(), boost::shared_array< sal_uInt8 >(), rProto->getPalette() ); + aCopy->copyBitmap(rProto); + return aCopy; } } // namespace basebmp diff --git a/basebmp/test/basictest.cxx b/basebmp/test/basictest.cxx index 05da4f554ee9..763e85a8be8c 100644 --- a/basebmp/test/basictest.cxx +++ b/basebmp/test/basictest.cxx @@ -131,15 +131,13 @@ public: void testClone() { const basegfx::B2ISize aSize(101,101); - basegfx::B2ISize aSize2(3,3); BitmapDeviceSharedPtr pDevice( createBitmapDevice( aSize, Format::OneBitMsbPal ) ); BitmapDeviceSharedPtr pClone( cloneBitmapDevice( - aSize2, pDevice )); CPPUNIT_ASSERT_EQUAL_MESSAGE("right size", - aSize2, pClone->getSize() ); + aSize, pClone->getSize() ); } // Change the following lines only, if you add, remove or rename |