cui/source/customize/cfg.cxx                          |   10 ++++------
 framework/source/uiconfiguration/ImageList.cxx        |    8 ++++----
 framework/source/uiconfiguration/ImageList.hxx        |    2 +-
 framework/source/uiconfiguration/imagemanagerimpl.cxx |    2 +-
 include/vcl/image.hxx                                 |    3 +--
 svx/source/tbxctrls/SvxPresetListBox.cxx              |    3 +--
 vcl/source/image/Image.cxx                            |    5 -----
 vcl/source/window/menubarwindow.cxx                   |   14 ++++++--------
 8 files changed, 18 insertions(+), 29 deletions(-)

New commits:
commit 0c567fbc49468dd1da928f9691abb7950e786faf
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Aug 28 09:17:08 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Aug 28 10:21:22 2025 +0200

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

diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index a06c2504fa88..5c58eabdbfb0 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -3007,9 +3007,8 @@ bool SvxIconSelectorDialog::ReplaceGraphicItem(
                 Image aImage( xGraphic );
                 if ( bOK && ((aSize.Width != m_nExpectedSize) || (aSize.Height 
!= m_nExpectedSize)) )
                 {
-                    BitmapEx aBitmap(aImage.GetBitmap());
-                    BitmapEx aBitmapex = BitmapEx::AutoScaleBitmap(aBitmap, 
m_nExpectedSize);
-                    aImage = Image( aBitmapex);
+                    Bitmap aBitmap = 
Bitmap::AutoScaleBitmap(aImage.GetBitmap(), m_nExpectedSize);
+                    aImage = Image( aBitmap );
                 }
                 m_xTbSymbol->InsertItem(nId, aImage, aURL, nPos); //modify
 
@@ -3150,9 +3149,8 @@ bool SvxIconSelectorDialog::ImportGraphic( const 
OUString& aURL )
 
             if ( bOK && ((aSize.Width != m_nExpectedSize) || (aSize.Height != 
m_nExpectedSize)) )
             {
-                BitmapEx aBitmap(aImage.GetBitmap());
-                BitmapEx aBitmapex = BitmapEx::AutoScaleBitmap(aBitmap, 
m_nExpectedSize);
-                aImage = Image( aBitmapex);
+                Bitmap aBitmap = Bitmap::AutoScaleBitmap(aImage.GetBitmap(), 
m_nExpectedSize);
+                aImage = Image( aBitmap );
             }
             if ( bOK && !!aImage )
             {
diff --git a/framework/source/uiconfiguration/ImageList.cxx 
b/framework/source/uiconfiguration/ImageList.cxx
index 271620ce6f69..3b130a8eb3bd 100644
--- a/framework/source/uiconfiguration/ImageList.cxx
+++ b/framework/source/uiconfiguration/ImageList.cxx
@@ -62,7 +62,7 @@ Bitmap ImageList::GetAsHorizontalStrip() const
     return aResult;
 }
 
-void ImageList::InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
+void ImageList::InsertFromHorizontalStrip( const Bitmap &rBitmap,
                                            const std::vector< OUString > 
&rNameVector )
 {
     sal_uInt16 nItems = sal::static_int_cast< sal_uInt16 >( rNameVector.size() 
);
@@ -70,8 +70,8 @@ void ImageList::InsertFromHorizontalStrip( const BitmapEx 
&rBitmapEx,
     if (!nItems)
             return;
 
-    Size aSize( rBitmapEx.GetSizePixel() );
-    DBG_ASSERT (rBitmapEx.GetSizePixel().Width() % nItems == 0,
+    Size aSize( rBitmap.GetSizePixel() );
+    DBG_ASSERT (rBitmap.GetSizePixel().Width() % nItems == 0,
                 "ImageList::InsertFromHorizontalStrip - very odd size");
     aSize.setWidth( aSize.Width() / nItems );
     maImages.clear();
@@ -81,7 +81,7 @@ void ImageList::InsertFromHorizontalStrip( const BitmapEx 
&rBitmapEx,
 
     for (sal_uInt16 nIdx = 0; nIdx < nItems; nIdx++)
     {
-        BitmapEx aBitmap( rBitmapEx, Point( nIdx * aSize.Width(), 0 ), aSize );
+        Bitmap aBitmap( rBitmap, Point( nIdx * aSize.Width(), 0 ), aSize );
         ImplAddImage( maPrefix, rNameVector[ nIdx ], nIdx + 1, Image( aBitmap 
) );
     }
 }
diff --git a/framework/source/uiconfiguration/ImageList.hxx 
b/framework/source/uiconfiguration/ImageList.hxx
index ccfa2e68e0a0..cad8d173f4e2 100644
--- a/framework/source/uiconfiguration/ImageList.hxx
+++ b/framework/source/uiconfiguration/ImageList.hxx
@@ -41,7 +41,7 @@ public:
                     ImageList( const std::vector<OUString>& rNameVector,
                                const OUString& rPrefix);
 
-    void            InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
+    void            InsertFromHorizontalStrip( const Bitmap &rBitmap,
                                    const std::vector< OUString > &rNameVector 
);
     Bitmap          GetAsHorizontalStrip() const;
     sal_uInt16      GetImageCount() const;
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx 
b/framework/source/uiconfiguration/imagemanagerimpl.cxx
index ec01e66b81f1..8d4a468c61eb 100644
--- a/framework/source/uiconfiguration/imagemanagerimpl.cxx
+++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx
@@ -352,7 +352,7 @@ void ImageManagerImpl::implts_loadUserImages(
 
                 if ( xBitmapStream.is() )
                 {
-                    BitmapEx aUserBitmap;
+                    Bitmap aUserBitmap;
                     {
                         std::unique_ptr<SvStream> 
pSvStream(utl::UcbStreamHelper::CreateStream( xBitmapStream ));
                         vcl::PngImageReader aPngReader( *pSvStream );
diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx
index 0c5e56ce7f2e..4ba056197493 100644
--- a/include/vcl/image.hxx
+++ b/include/vcl/image.hxx
@@ -22,7 +22,7 @@
 
 #include <vcl/dllapi.h>
 #include <tools/gen.hxx>
-#include <vcl/bitmapex.hxx>
+#include <vcl/bitmap.hxx>
 #include <vcl/outdev.hxx>
 
 #include <memory>
@@ -41,7 +41,6 @@ class SAL_WARN_UNUSED VCL_DLLPUBLIC Image
     friend class ::OutputDevice;
 public:
     Image();
-    explicit Image(BitmapEx const & rBitmapEx);
     explicit Image(Bitmap const & rBitmap);
     explicit Image(css::uno::Reference<css::graphic::XGraphic> const & 
rxGraphic);
     explicit Image(OUString const & rPNGFileUrl);
diff --git a/svx/source/tbxctrls/SvxPresetListBox.cxx 
b/svx/source/tbxctrls/SvxPresetListBox.cxx
index 45137b68b048..a5c234df80d6 100644
--- a/svx/source/tbxctrls/SvxPresetListBox.cxx
+++ b/svx/source/tbxctrls/SvxPresetListBox.cxx
@@ -75,10 +75,9 @@ template <typename ListType, typename EntryType>
 void SvxPresetListBox::FillPresetListBoxImpl(ListType& pList, sal_uInt32 
nStartIndex)
 {
     const Size aSize(GetIconSize());
-    BitmapEx aBitmap;
     for (tools::Long nIndex = 0; nIndex < pList.Count(); nIndex++, 
nStartIndex++)
     {
-        aBitmap = pList.GetBitmapForPreview(nIndex, aSize);
+        Bitmap aBitmap = pList.GetBitmapForPreview(nIndex, aSize);
         EntryType* pItem = static_cast<EntryType*>(pList.Get(nIndex));
         InsertItem(nStartIndex, Image(aBitmap), pItem->GetName());
     }
diff --git a/vcl/source/image/Image.cxx b/vcl/source/image/Image.cxx
index d5f86f07ced4..5fc2d9cf154c 100644
--- a/vcl/source/image/Image.cxx
+++ b/vcl/source/image/Image.cxx
@@ -33,11 +33,6 @@ Image::Image()
 {
 }
 
-Image::Image(const BitmapEx& rBitmapEx)
-{
-    ImplInit(Bitmap(rBitmapEx));
-}
-
 Image::Image(const Bitmap& rBitmap)
 {
     ImplInit(rBitmap);
diff --git a/vcl/source/window/menubarwindow.cxx 
b/vcl/source/window/menubarwindow.cxx
index 47cc1abd19e1..f3044bda9083 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -93,21 +93,19 @@ void DecoToolBox::SetImages( tools::Long nMaxHeight, bool 
bForce )
 
     lastSize = nMaxHeight - border;
 
-    Color       aEraseColor( ColorTransparency, 255, 255, 255, 255 );
-    BitmapEx    aBmpExDst( maImage.GetBitmap() );
-    BitmapEx    aBmpExSrc( aBmpExDst );
+    Bitmap    aBmpDst( maImage.GetBitmap() );
+    Bitmap    aBmpSrc( aBmpDst );
 
-    aEraseColor.SetAlpha( 0 );
-    aBmpExDst.Erase( aEraseColor );
-    aBmpExDst.Scale( Size( lastSize, lastSize ) );
+    aBmpDst.Erase( Color( ColorAlpha, 0, 255, 255, 255 ) );
+    aBmpDst.Scale( Size( lastSize, lastSize ) );
 
     tools::Rectangle aSrcRect( Point(0,0), maImage.GetSizePixel() );
     tools::Rectangle aDestRect( Point((lastSize - 
maImage.GetSizePixel().Width())/2,
                             (lastSize - maImage.GetSizePixel().Height())/2 ),
                         maImage.GetSizePixel() );
 
-    aBmpExDst.CopyPixel( aDestRect, aSrcRect, aBmpExSrc );
-    SetItemImage( ToolBoxItemId(IID_DOCUMENTCLOSE), Image( aBmpExDst ) );
+    aBmpDst.CopyPixel( aDestRect, aSrcRect, aBmpSrc );
+    SetItemImage( ToolBoxItemId(IID_DOCUMENTCLOSE), Image( aBmpDst ) );
 
 }
 

Reply via email to