diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-12-09 13:24:44 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-12-10 11:02:32 +0100 |
commit | 5b0e9e8c18205dd9b06cbcec146cefa1acef4f32 (patch) | |
tree | cff47282ec1a3b659b0c317666852e8e4f662a83 /vcl | |
parent | 63b8d83fd0d135af4ac04f78d26bfd3322ab65f6 (diff) |
return value by simply returning it
Change-Id: I0c3443f182db697d12fb8bc8a356d989b62847df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126610
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/salbmp.hxx | 7 | ||||
-rw-r--r-- | vcl/qa/cppunit/skia/skia.cxx | 6 | ||||
-rw-r--r-- | vcl/source/bitmap/bitmap.cxx | 9 |
3 files changed, 9 insertions, 13 deletions
diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx index 78d553b5194c..f04ea291aa84 100644 --- a/vcl/inc/salbmp.hxx +++ b/vcl/inc/salbmp.hxx @@ -97,13 +97,12 @@ public: return false; } - void GetChecksum(BitmapChecksum& rChecksum) const + BitmapChecksum GetChecksum() const { updateChecksum(); if (!mbChecksumValid) - rChecksum = 0; // back-compat - else - rChecksum = mnChecksum; + return 0; // back-compat + return mnChecksum; } void InvalidateChecksum() diff --git a/vcl/qa/cppunit/skia/skia.cxx b/vcl/qa/cppunit/skia/skia.cxx index 21e3d0baf696..f2990d3811fc 100644 --- a/vcl/qa/cppunit/skia/skia.cxx +++ b/vcl/qa/cppunit/skia/skia.cxx @@ -500,12 +500,10 @@ void SkiaTest::testChecksum() // The optimized changing of images to greyscale should change the checksum. SkiaSalBitmap* skiaBitmap2 = dynamic_cast<SkiaSalBitmap*>(bitmap.ImplGetSalBitmap().get()); skiaBitmap2->unittestResetToImage(); - BitmapChecksum checksum6; - skiaBitmap2->GetChecksum(checksum6); + BitmapChecksum checksum6 = skiaBitmap2->GetChecksum(); CPPUNIT_ASSERT_EQUAL(checksum5, checksum6); CPPUNIT_ASSERT(skiaBitmap2->ConvertToGreyscale()); - BitmapChecksum checksum7; - skiaBitmap2->GetChecksum(checksum7); + BitmapChecksum checksum7 = skiaBitmap2->GetChecksum(); CPPUNIT_ASSERT(checksum7 != checksum6); } diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx index 8d966e2446e0..c755a70ebad1 100644 --- a/vcl/source/bitmap/bitmap.cxx +++ b/vcl/source/bitmap/bitmap.cxx @@ -259,9 +259,8 @@ bool Bitmap::operator==( const Bitmap& rBmp ) const if (rBmp.mxSalBmp->GetSize() != mxSalBmp->GetSize() || rBmp.mxSalBmp->GetBitCount() != mxSalBmp->GetBitCount()) return false; - BitmapChecksum aChecksum1, aChecksum2; - rBmp.mxSalBmp->GetChecksum(aChecksum1); - mxSalBmp->GetChecksum(aChecksum2); + BitmapChecksum aChecksum1 = rBmp.mxSalBmp->GetChecksum(); + BitmapChecksum aChecksum2 = mxSalBmp->GetChecksum(); // If the bitmaps can't calculate a checksum, best to regard them as different. if (aChecksum1 == 0 || aChecksum2 == 0) return false; @@ -331,7 +330,7 @@ BitmapChecksum Bitmap::GetChecksum() const if( mxSalBmp ) { - mxSalBmp->GetChecksum(nRet); + nRet = mxSalBmp->GetChecksum(); if (!nRet) { @@ -344,7 +343,7 @@ BitmapChecksum Bitmap::GetChecksum() const { Bitmap* pThis = const_cast<Bitmap*>(this); pThis->mxSalBmp = xNewImpBmp; - mxSalBmp->GetChecksum(nRet); + nRet = mxSalBmp->GetChecksum(); } } } |