[Libreoffice-commits] core.git: vcl/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jun 29 15:08:17 UTC 2019
vcl/source/bitmap/bitmap.cxx | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit e73e7eacaeaa0b0eaccd3fdd25e10f0ed0d99779
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jun 28 13:23:46 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jun 29 17:07:11 2019 +0200
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 at collabora.co.uk>
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;
}
More information about the Libreoffice-commits
mailing list