summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit/canvasbitmaptest.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-15 12:43:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-15 14:33:52 +0100
commit52fece12345161911da2a531213b7d5541192aad (patch)
treefd27e700dc56ca5293e88746dbeed7cc08a57f3a /vcl/qa/cppunit/canvasbitmaptest.cxx
parent0a76eb059a77c799e6ce8400c558fc4dd1d866aa (diff)
tweak GetBitmap methods in BitmapEx
so we return a const& for the normal case, just like other methods, which reduces copying. This revealed that CreateDisplayBitmap in Bitmap can be const. Change-Id: I9f9b9ff0c52d7e95eaae62af152218be8847dd63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86836 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/qa/cppunit/canvasbitmaptest.cxx')
-rw-r--r--vcl/qa/cppunit/canvasbitmaptest.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx
index 48514580104b..69971210db92 100644
--- a/vcl/qa/cppunit/canvasbitmaptest.cxx
+++ b/vcl/qa/cppunit/canvasbitmaptest.cxx
@@ -711,7 +711,8 @@ void CanvasBitmapTest::runTest()
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bitmap does not have bitcount of 8",
static_cast<sal_uInt16>(8), aBmp.GetBitCount());
{
- BitmapReadAccess* pBmpAcc = aBmp.GetBitmap().AcquireReadAccess();
+ Bitmap aBitmap = aBmp.GetBitmap();
+ BitmapReadAccess* pBmpAcc = aBitmap.AcquireReadAccess();
CPPUNIT_ASSERT_MESSAGE( "Bitmap has invalid BitmapReadAccess",
pBmpAcc );
@@ -738,7 +739,8 @@ void CanvasBitmapTest::runTest()
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bitmap has bitcount of 24",
static_cast<sal_uInt16>(24), aBmp.GetBitCount());
{
- BitmapReadAccess* pBmpAcc = aBmp.GetBitmap().AcquireReadAccess();
+ Bitmap aBitmap = aBmp.GetBitmap();
+ BitmapReadAccess* pBmpAcc = aBitmap.AcquireReadAccess();
BitmapReadAccess* pAlphaAcc = aBmp.GetAlpha().AcquireReadAccess();
CPPUNIT_ASSERT_MESSAGE( "Bitmap has invalid BitmapReadAccess",