include/svx/bmpmask.hxx        |    6 +++---
 svx/source/dialog/_bmpmask.cxx |   29 ++++++++++++++---------------
 2 files changed, 17 insertions(+), 18 deletions(-)

New commits:
commit 6348ffb2592ab062ac4e0d30e3305e6dcbb1ba3a
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Tue Aug 5 23:25:18 2025 +0200
Commit:     Noel Grandin <noelgran...@gmail.com>
CommitDate: Wed Aug 6 11:35:03 2025 +0200

    BitmapEx->Bitmap in SvxBmpMask
    
    now that Bitmap supports transparency
    
    Change-Id: I42961c57e37340f4a8df83316be5d24126dbb615
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188987
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/include/svx/bmpmask.hxx b/include/svx/bmpmask.hxx
index 1500b8d3bd64..001a4b1fd4e9 100644
--- a/include/svx/bmpmask.hxx
+++ b/include/svx/bmpmask.hxx
@@ -27,7 +27,7 @@
 #include <svx/svxdllapi.h>
 #include <tools/color.hxx>
 #include <vcl/animate/Animation.hxx>
-#include <vcl/bitmapex.hxx>
+#include <vcl/bitmap.hxx>
 #include <vcl/gdimtf.hxx>
 #include <vcl/graph.hxx>
 #include <memory>
@@ -131,10 +131,10 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBmpMask final : 
public SfxDockingWindow
     sal_uInt16          InitColorArrays( Color* pSrcCols, Color* pDstCols,
                                          sal_uInt8* pTols );
 
-    void                ImpMask( BitmapEx& rBitmap );
+    void                ImpMask( Bitmap& rBitmap );
     GDIMetaFile         ImpMask( const GDIMetaFile& rMtf );
     Animation           ImpMask( const Animation& rAnimation );
-    BitmapEx            ImpMaskTransparent( const BitmapEx& rBitmapEx,
+    Bitmap              ImpMaskTransparent( const Bitmap& rBitmapEx,
                                             const Color& rColor,
                                             const sal_uInt8 nTol );
 
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index 031e81af6a17..e3b9c2795f62 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -596,7 +596,7 @@ sal_uInt16 SvxBmpMask::InitColorArrays( Color* pSrcCols, 
Color* pDstCols, sal_uI
     return nCount;
 }
 
-void SvxBmpMask::ImpMask( BitmapEx& rBitmap )
+void SvxBmpMask::ImpMask( Bitmap& rBitmap )
 {
     Color           pSrcCols[4];
     Color           pDstCols[4];
@@ -608,20 +608,19 @@ void SvxBmpMask::ImpMask( BitmapEx& rBitmap )
     LeaveWait();
 }
 
-BitmapEx SvxBmpMask::ImpMaskTransparent( const BitmapEx& rBitmapEx, const 
Color& rColor, const sal_uInt8 nTol )
+Bitmap SvxBmpMask::ImpMaskTransparent( const Bitmap& rBitmap, const Color& 
rColor, const sal_uInt8 nTol )
 {
     EnterWait();
 
-    BitmapEx    aBmpEx;
-    AlphaMask   aMask( rBitmapEx.GetBitmap().CreateAlphaMask( rColor, nTol ) );
+    AlphaMask   aMask( BitmapEx(rBitmap).GetBitmap().CreateAlphaMask( rColor, 
nTol ) );
 
-    if( rBitmapEx.IsAlpha() )
-        aMask.AlphaCombineOr( rBitmapEx.GetAlphaMask() );
+    if( rBitmap.HasAlpha() )
+        aMask.AlphaCombineOr( BitmapEx(rBitmap).GetAlphaMask() );
 
-    aBmpEx = BitmapEx( rBitmapEx.GetBitmap(), aMask );
+    Bitmap aBmp(BitmapEx( BitmapEx(rBitmap).GetBitmap(), aMask ));
     LeaveWait();
 
-    return aBmpEx;
+    return aBmp;
 }
 
 
@@ -981,21 +980,21 @@ Graphic SvxBmpMask::Mask( const Graphic& rGraphic )
                             // Do we have a transparent color?
                             if (pDstCols[i] == COL_TRANSPARENT)
                             {
-                                BitmapEx    aBmpEx( ImpMaskTransparent( 
aGraphic.GetBitmapEx(),
+                                Bitmap    aBmp( ImpMaskTransparent( 
Bitmap(aGraphic.GetBitmapEx()),
                                                                         
pSrcCols[ i ], pTols[ i ] ) );
-                                const Size  aSize( aBmpEx.GetSizePixel() );
+                                const Size  aSize( aBmp.GetSizePixel() );
 
                                 if( aSize.Width() && aSize.Height() )
-                                    aGraphic = aBmpEx;
+                                    aGraphic = aBmp;
                             }
                         }
 
                         // now replace it again with the normal colors
-                        BitmapEx  aBitmapEx( aGraphic.GetBitmapEx() );
-                        if ( aBitmapEx.GetSizePixel().Width() && 
aBitmapEx.GetSizePixel().Height() )
+                        Bitmap  aBitmap( aGraphic.GetBitmapEx() );
+                        if ( aBitmap.GetSizePixel().Width() && 
aBitmap.GetSizePixel().Height() )
                         {
-                            ImpMask( aBitmapEx );
-                            aGraphic = Graphic( aBitmapEx );
+                            ImpMask( aBitmap );
+                            aGraphic = Graphic( aBitmap );
                         }
                     }
                 }

Reply via email to