summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-03 14:50:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-04 09:18:09 +0200
commit0ba0cfa9a0173a5cca9e230f980b9f4efde7a794 (patch)
tree511f9ebb4caffce15b383179bc147c6fecc7ac18 /svx
parent405c4e37b2ddf3afeda5e4bf9f57a3c9dd5eab85 (diff)
move "replace transparency" logic inside vcl
Change-Id: I7e6994ec6bf7f0c7380df36c49d0b05a9d27c673 Reviewed-on: https://gerrit.libreoffice.org/75041 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/_bmpmask.cxx26
1 files changed, 4 insertions, 22 deletions
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index b0a7b7de8458..1eb212f9f636 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -901,19 +901,6 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf )
}
-BitmapEx SvxBmpMask::ImpReplaceTransparency( const BitmapEx& rBmpEx, const Color& rColor )
-{
- if( rBmpEx.IsTransparent() )
- {
- Bitmap aBmp( rBmpEx.GetBitmap() );
- aBmp.Replace( rBmpEx.GetMask(), rColor );
- return BitmapEx(aBmp);
- }
- else
- return rBmpEx;
-}
-
-
Animation SvxBmpMask::ImpReplaceTransparency( const Animation& rAnim, const Color& rColor )
{
Animation aAnimation( rAnim );
@@ -922,7 +909,7 @@ Animation SvxBmpMask::ImpReplaceTransparency( const Animation& rAnim, const Colo
for( sal_uInt16 i = 0; i < nAnimationCount; i++ )
{
AnimationBitmap aAnimationBitmap(aAnimation.Get(i));
- aAnimationBitmap.maBitmapEx = ImpReplaceTransparency(aAnimationBitmap.maBitmapEx, rColor);
+ aAnimationBitmap.maBitmapEx.ReplaceTransparency(rColor);
aAnimation.Replace(aAnimationBitmap, i);
}
@@ -990,14 +977,9 @@ Graphic SvxBmpMask::Mask( const Graphic& rGraphic )
// Replace transparency?
if( m_pCbxTrans->IsChecked() )
{
- if( aGraphic.IsTransparent() )
- {
- BitmapEx aBmpEx( ImpReplaceTransparency( aGraphic.GetBitmapEx(), aReplColor ) );
- const Size aSize( aBmpEx.GetSizePixel() );
-
- if( aSize.Width() && aSize.Height() )
- aGraphic = aBmpEx;
- }
+ BitmapEx aBmpEx = aGraphic.GetBitmapEx();
+ aBmpEx.ReplaceTransparency(aReplColor);
+ aGraphic = aBmpEx;
}
else
{