Kaydet (Commit) 36f306d8 authored tarafından Noel Grandin's avatar Noel Grandin

fix bug in BitmapEx::operator==

Just because this image is transparent, does not mean it is equal to the
other image.

Similarly, just because this image has transparency color, does not mean
the other image has valid transparency color.

Also move the cheaper mbAlpha check before the more expensive
ShallowEquals check.

there since
    commit 8ab086b6
    Date:   Mon Sep 18 16:07:07 2000 +0000
    initial import

Change-Id: I63033bc8e7fed991513a171e637768e826eafad9
Reviewed-on: https://gerrit.libreoffice.org/71572
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 71d329d1
......@@ -187,13 +187,17 @@ bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const
if (GetSizePixel() != rBitmapEx.GetSizePixel())
return false;
if (meTransparent == TransparentType::NONE)
return true;
if (meTransparent != rBitmapEx.meTransparent)
return false;
if (meTransparent == TransparentType::Color)
return maTransparentColor == rBitmapEx.maTransparentColor;
if (meTransparent == TransparentType::Color
&& maTransparentColor != rBitmapEx.maTransparentColor)
return false;
if (mbAlpha != rBitmapEx.mbAlpha)
return false;
return maMask.ShallowEquals(rBitmapEx.maMask) && mbAlpha == rBitmapEx.mbAlpha;
return maMask.ShallowEquals(rBitmapEx.maMask);
}
bool BitmapEx::IsEmpty() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment