vcl/source/filter/eps/eps.cxx            |   10 +++++-----
 vcl/source/filter/igif/gifread.cxx       |    4 ++--
 vcl/source/filter/imet/ios2met.cxx       |    6 +++---
 vcl/source/filter/ipdf/pdfread.cxx       |    2 +-
 vcl/source/filter/png/PngImageWriter.cxx |    2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 81ec25bc11d3f2015bf0c3532529b2b881e28a46
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Sep 4 14:59:51 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Sep 4 18:00:19 2025 +0200

    simplify some BitmapEx expressions
    
    Change-Id: Ia92b4182f34936284cade0b25f209dbeacdb2b93
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190590
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/vcl/source/filter/eps/eps.cxx b/vcl/source/filter/eps/eps.cxx
index 35cfc27a788c..025b8c736d8d 100644
--- a/vcl/source/filter/eps/eps.cxx
+++ b/vcl/source/filter/eps/eps.cxx
@@ -897,18 +897,18 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, 
VirtualDevice& rVDev )
 
                 if ( aWallpaper.IsBitmap() )
                 {
-                    BitmapEx aBitmapEx(aWallpaper.GetBitmap());
-                    const Bitmap& aBitmap( aBitmapEx.GetBitmap() );
-                    if ( aBitmapEx.IsAlpha() )
+                    Bitmap aBitmap(aWallpaper.GetBitmap());
+                    if ( aBitmap.HasAlpha() )
                     {
+                        const Bitmap aBitmap2( aBitmap.CreateColorBitmap() );
                         if ( aWallpaper.IsGradient() )
                         {
 
                         // gradient action
 
                         }
-                        const AlphaMask& aMask( aBitmapEx.GetAlphaMask() );
-                        ImplBmp( &aBitmap, &aMask, Point( aRect.Left(), 
aRect.Top() ), aRect.GetWidth(), aRect.GetHeight() );
+                        const AlphaMask aMask( aBitmap.CreateAlphaMask() );
+                        ImplBmp( &aBitmap2, &aMask, Point( aRect.Left(), 
aRect.Top() ), aRect.GetWidth(), aRect.GetHeight() );
                     }
                     else
                         ImplBmp( &aBitmap, nullptr, Point( aRect.Left(), 
aRect.Top() ), aRect.GetWidth(), aRect.GetHeight() );
diff --git a/vcl/source/filter/igif/gifread.cxx 
b/vcl/source/filter/igif/gifread.cxx
index 0501d1b570cd..a4ce576e0eba 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -664,7 +664,7 @@ void GIFReader::CreateNewBitmaps()
         AlphaMask aAlphaMask(aBmp1);
         // No need to convert from transparency to alpha
         // aBmp1 is already inverted
-        aAnimationFrame.maBitmap = Bitmap(BitmapEx( aBmp8, aAlphaMask ));
+        aAnimationFrame.maBitmap = Bitmap( aBmp8, aAlphaMask );
     }
     else if( nPaletteSize > 2 )
     {
@@ -676,7 +676,7 @@ void GIFReader::CreateNewBitmaps()
         // and create a completely opaque bitmap instead.
         // Note: this fix also fixes tdf#157576, tdf#157635, and tdf#157793.
         AlphaMask aAlphaMask(aBmp8.GetSizePixel());
-        aAnimationFrame.maBitmap = Bitmap(BitmapEx( aBmp8, aAlphaMask ));
+        aAnimationFrame.maBitmap = Bitmap( aBmp8, aAlphaMask );
     }
     else
     {
diff --git a/vcl/source/filter/imet/ios2met.cxx 
b/vcl/source/filter/imet/ios2met.cxx
index 56d98f3878cc..41da4c390bf9 100644
--- a/vcl/source/filter/imet/ios2met.cxx
+++ b/vcl/source/filter/imet/ios2met.cxx
@@ -278,7 +278,7 @@ struct OSFont {
 struct OSBitmap {
     OSBitmap * pSucc;
     sal_uInt32 nID;
-    BitmapEx   aBitmapEx;
+    Bitmap   aBitmap;
 
     // required during reading of the bitmap:
     SvStream * pBMP; // pointer to temporary Windows-BMP file or NULL
@@ -1016,7 +1016,7 @@ void OS2METReader::ReadBitBlt()
     while (pB!=nullptr && pB->nID!=nID) pB=pB->pSucc;
     if (pB!=nullptr) {
         SetRasterOp(aAttr.ePatMix);
-        pVirDev->DrawBitmapEx(aP1,aSize,Bitmap(pB->aBitmapEx));
+        pVirDev->DrawBitmapEx(aP1,aSize,pB->aBitmap);
     }
 }
 
@@ -2544,7 +2544,7 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, 
sal_uInt16 nFieldSize)
             }
             pBitmapList->pBMP->Seek(0);
 
-            ReadDIBBitmapEx(pBitmapList->aBitmapEx, *(pBitmapList->pBMP), 
false);
+            ReadDIBBitmapEx(pBitmapList->aBitmap, *(pBitmapList->pBMP), false);
 
             if (pBitmapList->pBMP->GetError()!=ERRCODE_NONE) {
                 pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
diff --git a/vcl/source/filter/ipdf/pdfread.cxx 
b/vcl/source/filter/ipdf/pdfread.cxx
index 6d9c0cb4fd34..1a9e9db42559 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -94,7 +94,7 @@ size_t RenderPDFBitmaps(const void* pBuffer, int nSize, 
std::vector<Bitmap>& rBi
         }
         else
         {
-            rBitmaps.emplace_back(BitmapEx(aBitmap).GetBitmap());
+            rBitmaps.emplace_back(aBitmap.CreateColorBitmap());
         }
     }
 
diff --git a/vcl/source/filter/png/PngImageWriter.cxx 
b/vcl/source/filter/png/PngImageWriter.cxx
index b2ec3a6a80df..4586c1d59c52 100644
--- a/vcl/source/filter/png/PngImageWriter.cxx
+++ b/vcl/source/filter/png/PngImageWriter.cxx
@@ -143,7 +143,7 @@ static bool pngWrite(SvStream& rStream, const Graphic& 
rGraphic, int nCompressio
     if (!bTranslucent && aBitmap.HasAlpha())
     {
         // strip out the alpha layer
-        aBitmap = BitmapEx(aBitmap).GetBitmap();
+        aBitmap = aBitmap.CreateColorBitmap();
     }
 
     BitmapScopedReadAccess pAccess(aBitmap);

Reply via email to