include/svx/galleryobjectcollection.hxx |    2 +-
 include/svx/galtheme.hxx                |    4 ++--
 svx/source/gallery2/galbrws1.cxx        |   24 ++++++++++++------------
 svx/source/gallery2/galctrl.cxx         |   18 +++++++++---------
 svx/source/gallery2/galtheme.cxx        |    8 ++++----
 5 files changed, 28 insertions(+), 28 deletions(-)

New commits:
commit e35f5cbd26a48ebe5413ab4053e022349834e387
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jul 30 14:57:25 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jul 31 14:12:46 2025 +0200

    BitmapEx->Bitmap in GalleryObject
    
    now that Bitmap can handle transparency
    
    Change-Id: I7396610e29f0940cdde265642131f730ea584c98
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188612
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svx/galleryobjectcollection.hxx 
b/include/svx/galleryobjectcollection.hxx
index c4c8f245723b..eb0935781982 100644
--- a/include/svx/galleryobjectcollection.hxx
+++ b/include/svx/galleryobjectcollection.hxx
@@ -36,7 +36,7 @@ struct SVXCORE_DLLPUBLIC GalleryObject
     bool mbDelete;
 
     //UI visualization buffering
-    BitmapEx maPreviewBitmapEx;
+    Bitmap maPreviewBitmap;
     Size maPreparedSize;
     OUString maTitle;
     OUString maPath;
diff --git a/include/svx/galtheme.hxx b/include/svx/galtheme.hxx
index dc61142fab0c..94582d77a86f 100644
--- a/include/svx/galtheme.hxx
+++ b/include/svx/galtheme.hxx
@@ -160,8 +160,8 @@ public:
     static void                 InsertAllThemes(weld::ComboBox& rListBox);
 
     // for buffering PreviewBitmaps and strings for object and path
-    SAL_DLLPRIVATE void GetPreviewBitmapExAndStrings(sal_uInt32 nPos, 
BitmapEx& rBitmapEx, Size& rSize, OUString& rTitle, OUString& rPath);
-    SAL_DLLPRIVATE void SetPreviewBitmapExAndStrings(sal_uInt32 nPos, const 
BitmapEx& rBitmapEx, const Size& rSize, const OUString& rTitle, const OUString& 
rPath);
+    SAL_DLLPRIVATE void GetPreviewBitmapAndStrings(sal_uInt32 nPos, Bitmap& 
rBitmap, Size& rSize, OUString& rTitle, OUString& rPath);
+    SAL_DLLPRIVATE void SetPreviewBitmapAndStrings(sal_uInt32 nPos, const 
Bitmap& rBitmap, const Size& rSize, const OUString& rTitle, const OUString& 
rPath);
 };
 
 #endif // INCLUDED_SVX_GALTHEME_HXX
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 8d108918f028..2cb1399a2c1b 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -1096,16 +1096,16 @@ void GalleryBrowser::UpdateRows(bool bVisibleOnly)
             return false;
 
         // get the icon for the listview
-        BitmapEx aBitmapEx;
+        Bitmap aBitmap;
         Size aPreparedSize;
 
         OUString sItemTextTitle;
         OUString sItemTextPath;
 
         sal_Int32 i = sId.toUInt32();
-        mpCurTheme->GetPreviewBitmapExAndStrings(i, aBitmapEx, aPreparedSize, 
sItemTextTitle, sItemTextPath);
+        mpCurTheme->GetPreviewBitmapAndStrings(i, aBitmap, aPreparedSize, 
sItemTextTitle, sItemTextPath);
 
-        bool bNeedToCreate(aBitmapEx.IsEmpty());
+        bool bNeedToCreate(aBitmap.IsEmpty());
         if (!bNeedToCreate && (sItemTextTitle.isEmpty() || aPreparedSize != 
maPreviewSize))
             bNeedToCreate = true;
 
@@ -1114,31 +1114,31 @@ void GalleryBrowser::UpdateRows(bool bVisibleOnly)
             std::unique_ptr<SgaObject> xObj = mpCurTheme->AcquireObject(i);
             if (xObj)
             {
-                aBitmapEx = xObj->createPreviewBitmapEx(maPreviewSize);
+                aBitmap = Bitmap(xObj->createPreviewBitmapEx(maPreviewSize));
                 sItemTextTitle = GalleryBrowser::GetItemText(*xObj, 
GalleryItemFlags::Title);
                 sItemTextPath = GalleryBrowser::GetItemText(*xObj, 
GalleryItemFlags::Path);
 
-                mpCurTheme->SetPreviewBitmapExAndStrings(i, aBitmapEx, 
maPreviewSize, sItemTextTitle, sItemTextPath);
+                mpCurTheme->SetPreviewBitmapAndStrings(i, aBitmap, 
maPreviewSize, sItemTextTitle, sItemTextPath);
             }
         }
 
         ScopedVclPtr<VirtualDevice> xDev(mxListView->create_virtual_device());
         xDev->SetOutputSizePixel(maPreviewSize);
 
-        if (!aBitmapEx.IsEmpty())
+        if (!aBitmap.IsEmpty())
         {
-            const Size aBitmapExSizePixel(aBitmapEx.GetSizePixel());
+            const Size aBitmapSizePixel(aBitmap.GetSizePixel());
             const Point aPos(
-                ((maPreviewSize.Width() - aBitmapExSizePixel.Width()) >> 1),
-                ((maPreviewSize.Height() - aBitmapExSizePixel.Height()) >> 1));
+                ((maPreviewSize.Width() - aBitmapSizePixel.Width()) >> 1),
+                ((maPreviewSize.Height() - aBitmapSizePixel.Height()) >> 1));
 
-            if (aBitmapEx.IsAlpha())
+            if (aBitmap.HasAlpha())
             {
                 // draw checkered background
-                GalleryIconView::drawTransparenceBackground(*xDev, aPos, 
aBitmapExSizePixel);
+                GalleryIconView::drawTransparenceBackground(*xDev, aPos, 
aBitmapSizePixel);
             }
 
-            xDev->DrawBitmapEx(aPos, aBitmapEx);
+            xDev->DrawBitmapEx(aPos, aBitmap);
         }
 
         mxListView->set_text(rEntry, sItemTextTitle);
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index 04af45ee7221..f9ddd0194e71 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -314,14 +314,14 @@ void GalleryIconView::UserDraw(const UserDrawEvent& 
rUDEvt)
 
     const tools::Rectangle& rRect = rUDEvt.GetRect();
     const Size aSize(rRect.GetWidth(), rRect.GetHeight());
-    BitmapEx aBitmapEx;
+    Bitmap aBitmap;
     Size aPreparedSize;
     OUString aItemTextTitle;
     OUString aItemTextPath;
 
-    mpTheme->GetPreviewBitmapExAndStrings(nId - 1, aBitmapEx, aPreparedSize, 
aItemTextTitle, aItemTextPath);
+    mpTheme->GetPreviewBitmapAndStrings(nId - 1, aBitmap, aPreparedSize, 
aItemTextTitle, aItemTextPath);
 
-    bool bNeedToCreate(aBitmapEx.IsEmpty());
+    bool bNeedToCreate(aBitmap.IsEmpty());
 
     if (!bNeedToCreate && aItemTextTitle.isEmpty())
     {
@@ -339,28 +339,28 @@ void GalleryIconView::UserDraw(const UserDrawEvent& 
rUDEvt)
 
         if(pObj)
         {
-            aBitmapEx = pObj->createPreviewBitmapEx(aSize);
+            aBitmap = Bitmap(pObj->createPreviewBitmapEx(aSize));
             aItemTextTitle = GalleryBrowser::GetItemText(*pObj, 
GalleryItemFlags::Title);
 
-            mpTheme->SetPreviewBitmapExAndStrings(nId - 1, aBitmapEx, aSize, 
aItemTextTitle, aItemTextPath);
+            mpTheme->SetPreviewBitmapAndStrings(nId - 1, aBitmap, aSize, 
aItemTextTitle, aItemTextPath);
         }
     }
 
-    if (!aBitmapEx.IsEmpty())
+    if (!aBitmap.IsEmpty())
     {
-        const Size aBitmapExSizePixel(aBitmapEx.GetSizePixel());
+        const Size aBitmapExSizePixel(aBitmap.GetSizePixel());
         const Point aPos(
             ((aSize.Width() - aBitmapExSizePixel.Width()) >> 1) + rRect.Left(),
             ((aSize.Height() - aBitmapExSizePixel.Height()) >> 1) + 
rRect.Top());
         OutputDevice* pDev = rUDEvt.GetRenderContext();
 
-        if(aBitmapEx.IsAlpha())
+        if(aBitmap.HasAlpha())
         {
             // draw checkered background for full rectangle.
             GalleryIconView::drawTransparenceBackground(*pDev, 
rRect.TopLeft(), rRect.GetSize());
         }
 
-        pDev->DrawBitmapEx(aPos, aBitmapEx);
+        pDev->DrawBitmapEx(aPos, aBitmap);
     }
 
     SetItemText(nId, aItemTextTitle);
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 846267a15e20..7c9914dc2880 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -145,21 +145,21 @@ std::unique_ptr<SgaObject> 
GalleryTheme::AcquireObject(sal_uInt32 nPos)
     return 
mpGalleryStorageEngine->implReadSgaObject(maGalleryObjectCollection.getForPosition(nPos));
 }
 
-void GalleryTheme::GetPreviewBitmapExAndStrings(sal_uInt32 nPos, BitmapEx& 
rBitmapEx, Size& rSize, OUString& rTitle, OUString& rPath)
+void GalleryTheme::GetPreviewBitmapAndStrings(sal_uInt32 nPos, Bitmap& 
rBitmap, Size& rSize, OUString& rTitle, OUString& rPath)
 {
     const GalleryObject* pGalleryObject = 
maGalleryObjectCollection.get(nPos).get();
 
-    rBitmapEx = pGalleryObject->maPreviewBitmapEx;
+    rBitmap = pGalleryObject->maPreviewBitmap;
     rSize = pGalleryObject->maPreparedSize;
     rTitle = pGalleryObject->maTitle;
     rPath = pGalleryObject->maPath;
 }
 
-void GalleryTheme::SetPreviewBitmapExAndStrings(sal_uInt32 nPos, const 
BitmapEx& rBitmapEx, const Size& rSize, const OUString& rTitle, const OUString& 
rPath)
+void GalleryTheme::SetPreviewBitmapAndStrings(sal_uInt32 nPos, const Bitmap& 
rBitmap, const Size& rSize, const OUString& rTitle, const OUString& rPath)
 {
     GalleryObject* pGalleryObject = maGalleryObjectCollection.get(nPos).get();
 
-    pGalleryObject->maPreviewBitmapEx = rBitmapEx;
+    pGalleryObject->maPreviewBitmap = rBitmap;
     pGalleryObject->maPreparedSize = rSize;
     pGalleryObject->maTitle = rTitle;
     pGalleryObject->maPath = rPath;

Reply via email to