summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-06-28 13:23:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-29 17:07:11 +0200
commite73e7eacaeaa0b0eaccd3fdd25e10f0ed0d99779 (patch)
treee82511c303febec9242988f9ff7b0b45d202364f /vcl/source/bitmap
parent98f78fc6cae5879d7efd22fcb3c320f64fb6c2ed (diff)
tdf#125873 Selected border color preview isn't shown
Regression from commit 319c57d2af5d26d3910db4b02dca145d8881af tdf#120837 File saving at least 5 times slower which made BitmapEx::operator== rely more heavily on Bitmap::operator==, which in turn relies on the platform-specific SalBitmap subclass to calculate a checksum, which was not happening with WinSalBitmap. Consequently, make Bitmap::operator== more robust by returning false if either of the underlying bitmaps cannot generate a checksum Change-Id: Iad8a4ce19544839a6303f0e8d006b138c2d75a31 Reviewed-on: https://gerrit.libreoffice.org/74834 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/bitmap')
-rw-r--r--vcl/source/bitmap/bitmap.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx
index bf391f339750..cfaad6c7faf6 100644
--- a/vcl/source/bitmap/bitmap.cxx
+++ b/vcl/source/bitmap/bitmap.cxx
@@ -241,6 +241,9 @@ bool Bitmap::operator==( const Bitmap& rBmp ) const
BitmapChecksum aChecksum1, aChecksum2;
rBmp.mxSalBmp->GetChecksum(aChecksum1);
mxSalBmp->GetChecksum(aChecksum2);
+ // If the bitmaps can't calculate a checksum, best to regard them as different.
+ if (aChecksum1 == 0 || aChecksum2 == 0)
+ return false;
return aChecksum1 == aChecksum2;
}