diff options
author | Armin Le Grand <alg@apache.org> | 2012-09-06 10:06:38 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-16 19:59:30 +0100 |
commit | e52f636aa44615b180bf799b2d664de9244c3138 (patch) | |
tree | a914897f5bfac2987da5889a77b63952da8ffdbb /vcl/source | |
parent | 2df3ff140e5f803c3bb22fd621045e416c84c587 (diff) |
assertion removed: allow BitmapEx constructors with empty Mask or AlphaMask
(cherry picked from commit c66db94a90efe954691da4ac6bb1ce82ff99e22f)
Change-Id: Ifd4c734fee97d7b8f904a1f32c1367a13dde92b2
assertion corrected: BitmapEx constructors with Mask or AlphaMask...
needed more checks
(cherry picked from commit 560ab48c4b4453ffdd316d8db5dbda111f08650c)
Change-Id: Ib6d41bf3349ee89458e06c632342bff43d7a233c
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index e160cb03a8cc..61edab73b8c0 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -117,14 +117,10 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) : eTransparent ( !rMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ), bAlpha ( sal_False ) { - if(!rMask) - { - OSL_ENSURE(false, "Empty mask given (!)"); - } - else if(rBmp.GetSizePixel() != rMask.GetSizePixel()) + if(!!aBitmap && !!aMask && aBitmap.GetSizePixel() != aMask.GetSizePixel()) { OSL_ENSURE(false, "Mask size differs from Bitmap size, corrected Mask (!)"); - aMask.Scale(rBmp.GetSizePixel()); + aMask.Scale(aBitmap.GetSizePixel()); } // Ensure a mask is exactly one bit deep @@ -142,11 +138,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) : eTransparent ( !rAlphaMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ), bAlpha ( !rAlphaMask ? sal_False : sal_True ) { - if(!rAlphaMask) - { - OSL_ENSURE(false, "Empty alpha given (!)"); - } - else if(rBmp.GetSizePixel() != rAlphaMask.GetSizePixel()) + if(!!aBitmap && !!aMask && aBitmap.GetSizePixel() != aMask.GetSizePixel()) { OSL_ENSURE(false, "Alpha size differs from Bitmap size, corrected Mask (!)"); aMask.Scale(rBmp.GetSizePixel()); |