sd/source/ui/presenter/PresenterPreviewCache.cxx               |    4 -
 sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx              |   38 
+++++-----
 sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx              |   10 +-
 sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx         |   12 +--
 sd/source/ui/slidesorter/cache/SlsGenericPageCache.hxx         |    6 -
 sd/source/ui/slidesorter/cache/SlsPageCache.cxx                |    6 -
 sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx           |    2 
 sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx            |    6 -
 sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx     |    8 +-
 sd/source/ui/slidesorter/inc/view/SlsTheme.hxx                 |    4 -
 sd/source/ui/slidesorter/view/SlsFramePainter.cxx              |    8 +-
 sd/source/ui/slidesorter/view/SlsFramePainter.hxx              |    6 -
 sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx |    2 
 sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx         |   14 +--
 sd/source/ui/slidesorter/view/SlsTheme.cxx                     |    2 
 15 files changed, 65 insertions(+), 63 deletions(-)

New commits:
commit cddb99adc88eb79f6f7c52607c001cc98a59b87a
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Aug 29 11:52:53 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Aug 30 08:51:50 2025 +0200

    BitmapEx->Bitmap in BitmapCache
    
    now that Bitmap can handle transparency
    
    Change-Id: I310077cce89db92560bd4c52c362d4032935d20b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190389
    Reviewed-by: Noel Grandin <[email protected]>
    Tested-by: Jenkins

diff --git a/sd/source/ui/presenter/PresenterPreviewCache.cxx 
b/sd/source/ui/presenter/PresenterPreviewCache.cxx
index 84e53d4202f4..c678f0875877 100644
--- a/sd/source/ui/presenter/PresenterPreviewCache.cxx
+++ b/sd/source/ui/presenter/PresenterPreviewCache.cxx
@@ -131,13 +131,13 @@ Reference<rendering::XBitmap> 
PresenterPreviewCache::getSlidePreview (
     if (pPage == nullptr)
         throw RuntimeException();
 
-    const BitmapEx aPreview (mpCache->GetPreviewBitmap(pPage,true));
+    const Bitmap aPreview (mpCache->GetPreviewBitmap(pPage,true));
     if (aPreview.IsEmpty())
         return nullptr;
     else
         return cppcanvas::VCLFactory::createBitmap(
             pCanvas,
-            Bitmap(aPreview))->getUNOBitmap();
+            aPreview)->getUNOBitmap();
 }
 
 void PresenterPreviewCache::addPreviewCreationNotifyListener (
diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx 
b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx
index 51bdc2cd3db2..6861b8b03034 100644
--- a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx
@@ -40,7 +40,7 @@ namespace sd::slidesorter::cache {
 class BitmapCache::CacheEntry
 {
 public:
-    CacheEntry(const BitmapEx& rBitmap, sal_Int32 nLastAccessTime, bool 
bIsPrecious);
+    CacheEntry(const Bitmap& rBitmap, sal_Int32 nLastAccessTime, bool 
bIsPrecious);
     CacheEntry(sal_Int32 nLastAccessTime, bool bIsPrecious);
     inline void Recycle (const CacheEntry& rEntry);
     inline sal_Int32 GetMemorySize() const;
@@ -52,12 +52,12 @@ public:
     sal_Int32 GetAccessTime() const { return mnLastAccessTime; }
     void SetAccessTime (sal_Int32 nAccessTime) { mnLastAccessTime = 
nAccessTime; }
 
-    const BitmapEx& GetPreview() const { return maPreview; }
-    inline void SetPreview (const BitmapEx& rPreview);
+    const Bitmap& GetPreview() const { return maPreview; }
+    inline void SetPreview (const Bitmap& rPreview);
     bool HasPreview() const;
 
-    const BitmapEx& GetMarkedPreview() const { return maMarkedPreview; }
-    inline void SetMarkedPreview (const BitmapEx& rMarkePreview);
+    const Bitmap& GetMarkedPreview() const { return maMarkedPreview; }
+    inline void SetMarkedPreview (const Bitmap& rMarkePreview);
 
     bool HasReplacement() const { return (mpReplacement != nullptr); }
     inline bool HasLosslessReplacement() const;
@@ -66,8 +66,8 @@ public:
     void SetPrecious (bool bIsPrecious) { mbIsPrecious = bIsPrecious; }
 
 private:
-    BitmapEx maPreview;
-    BitmapEx maMarkedPreview;
+    Bitmap maPreview;
+    Bitmap maMarkedPreview;
     std::shared_ptr<BitmapReplacement> mpReplacement;
     std::shared_ptr<BitmapCompressor> mpCompressor;
     bool mbIsUpToDate;
@@ -168,7 +168,7 @@ bool BitmapCache::BitmapIsUpToDate (const CacheKey& rKey)
     return bIsUpToDate;
 }
 
-BitmapEx BitmapCache::GetBitmap (const CacheKey& rKey)
+Bitmap BitmapCache::GetBitmap (const CacheKey& rKey)
 {
     std::unique_lock aGuard (maMutex);
 
@@ -177,7 +177,7 @@ BitmapEx BitmapCache::GetBitmap (const CacheKey& rKey)
     {
         // Create an empty bitmap for the given key that acts as placeholder
         // until we are given the real one.  Mark it as not being up to date.
-        SetBitmap(aGuard, rKey, BitmapEx(), false);
+        SetBitmap(aGuard, rKey, Bitmap(), false);
         iEntry = mpBitmapContainer->find(rKey);
         iEntry->second.SetUpToDate(false);
     }
@@ -196,7 +196,7 @@ BitmapEx BitmapCache::GetBitmap (const CacheKey& rKey)
     return iEntry->second.GetPreview();
 }
 
-BitmapEx BitmapCache::GetMarkedBitmap (const CacheKey& rKey)
+Bitmap BitmapCache::GetMarkedBitmap (const CacheKey& rKey)
 {
     std::unique_lock aGuard (maMutex);
 
@@ -207,7 +207,7 @@ BitmapEx BitmapCache::GetMarkedBitmap (const CacheKey& rKey)
         return iEntry->second.GetMarkedPreview();
     }
     else
-        return BitmapEx();
+        return Bitmap();
 }
 
 void BitmapCache::ReleaseBitmap (const CacheKey& rKey)
@@ -258,7 +258,7 @@ void BitmapCache::InvalidateCache()
 
 void BitmapCache::SetBitmap (
     const CacheKey& rKey,
-    const BitmapEx& rPreview,
+    const Bitmap& rPreview,
     bool bIsPrecious)
 {
     std::unique_lock aGuard (maMutex);
@@ -268,7 +268,7 @@ void BitmapCache::SetBitmap (
 void BitmapCache::SetBitmap (
     std::unique_lock<std::mutex>& rGuard,
     const CacheKey& rKey,
-    const BitmapEx& rPreview,
+    const Bitmap& rPreview,
     bool bIsPrecious)
 {
     CacheBitmapContainer::iterator iEntry (mpBitmapContainer->find(rKey));
@@ -293,7 +293,7 @@ void BitmapCache::SetBitmap (
 
 void BitmapCache::SetMarkedBitmap (
     const CacheKey& rKey,
-    const BitmapEx& rPreview)
+    const Bitmap& rPreview)
 {
     std::unique_lock aGuard (maMutex);
 
@@ -325,7 +325,7 @@ void BitmapCache::SetPrecious (const CacheKey& rKey, bool 
bIsPrecious)
     {
         iEntry = mpBitmapContainer->emplace(
             rKey,
-            CacheEntry(BitmapEx(), mnCurrentAccessTime++, bIsPrecious)
+            CacheEntry(Bitmap(), mnCurrentAccessTime++, bIsPrecious)
             ).first;
         UpdateCacheSize(aGuard, iEntry->second, ADD);
     }
@@ -463,7 +463,7 @@ BitmapCache::CacheEntry::CacheEntry(
 }
 
 BitmapCache::CacheEntry::CacheEntry(
-    const BitmapEx& rPreview,
+    const Bitmap& rPreview,
     sal_Int32 nLastAccessTime,
     bool bIsPrecious)
     : maPreview(rPreview),
@@ -504,7 +504,7 @@ void BitmapCache::CacheEntry::Compress (const 
std::shared_ptr<BitmapCompressor>&
 
     if (mpReplacement == nullptr)
     {
-        mpReplacement = rpCompressor->Compress(Bitmap(maPreview));
+        mpReplacement = rpCompressor->Compress(maPreview);
 
 #ifdef DEBUG_SD_SLSBITMAPCACHE
         sal_uInt32 nOldSize (maPreview.GetSizeBytes());
@@ -533,7 +533,7 @@ inline void BitmapCache::CacheEntry::Decompress()
     }
 }
 
-inline void BitmapCache::CacheEntry::SetPreview (const BitmapEx& rPreview)
+inline void BitmapCache::CacheEntry::SetPreview (const Bitmap& rPreview)
 {
     maPreview = rPreview;
     maMarkedPreview.SetEmpty();
@@ -546,7 +546,7 @@ bool BitmapCache::CacheEntry::HasPreview() const
     return ! maPreview.IsEmpty();
 }
 
-inline void BitmapCache::CacheEntry::SetMarkedPreview (const BitmapEx& 
rMarkedPreview)
+inline void BitmapCache::CacheEntry::SetMarkedPreview (const Bitmap& 
rMarkedPreview)
 {
     maMarkedPreview = rMarkedPreview;
 }
diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx 
b/sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx
index cf527832497c..d1c071e40648 100644
--- a/sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx
+++ b/sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx
@@ -92,11 +92,11 @@ public:
 
     /** Return the preview bitmap for the given contact object.
     */
-    BitmapEx GetBitmap(const CacheKey& rKey);
+    Bitmap GetBitmap(const CacheKey& rKey);
 
     /** Return the marked preview bitmap for the given contact object.
     */
-    BitmapEx GetMarkedBitmap(const CacheKey& rKey);
+    Bitmap GetMarkedBitmap(const CacheKey& rKey);
 
     /** Release the reference to the preview bitmap that is associated with
         the given key.
@@ -118,11 +118,11 @@ public:
 
     /** Add or replace a bitmap for the given key.
     */
-    void SetBitmap(const CacheKey& rKey, const BitmapEx& rPreview, bool 
bIsPrecious);
+    void SetBitmap(const CacheKey& rKey, const Bitmap& rPreview, bool 
bIsPrecious);
 
     /** Add or replace a marked bitmap for the given key.
     */
-    void SetMarkedBitmap(const CacheKey& rKey, const BitmapEx& rPreview);
+    void SetMarkedBitmap(const CacheKey& rKey, const Bitmap& rPreview);
 
     /** Mark the specified preview bitmap as precious, i.e. that it must not
         be compressed or otherwise removed from the cache.
@@ -206,7 +206,7 @@ private:
     void ReCalculateTotalCacheSize(std::unique_lock<std::mutex>& rGuard);
 
     void SetBitmap(std::unique_lock<std::mutex>& rGuard, const CacheKey& rKey,
-                   const BitmapEx& rPreview, bool bIsPrecious);
+                   const Bitmap& rPreview, bool bIsPrecious);
 };
 
 } // end of namespace ::sd::slidesorter::cache
diff --git a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx 
b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx
index 7676dac2e390..fb2cffb1e275 100644
--- a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx
@@ -100,13 +100,13 @@ void GenericPageCache::ChangePreviewSize (
     mbDoSuperSampling = bDoSuperSampling;
 }
 
-BitmapEx GenericPageCache::GetPreviewBitmap (
+Bitmap GenericPageCache::GetPreviewBitmap (
     const CacheKey aKey,
     const bool bResize)
 {
     assert(aKey != nullptr);
 
-    BitmapEx aPreview;
+    Bitmap aPreview;
     bool bMayBeUpToDate = true;
     ProvideCacheAndProcessor();
     const SdrPage* pPage = mpCacheContext->GetPage(aKey);
@@ -138,21 +138,21 @@ BitmapEx GenericPageCache::GetPreviewBitmap (
     return aPreview;
 }
 
-BitmapEx GenericPageCache::GetMarkedPreviewBitmap (
+Bitmap GenericPageCache::GetMarkedPreviewBitmap (
     const CacheKey aKey)
 {
     assert(aKey != nullptr);
 
     ProvideCacheAndProcessor();
     const SdrPage* pPage = mpCacheContext->GetPage(aKey);
-    BitmapEx aMarkedPreview (mpBitmapCache->GetMarkedBitmap(pPage));
+    Bitmap aMarkedPreview (mpBitmapCache->GetMarkedBitmap(pPage));
 
     return aMarkedPreview;
 }
 
 void GenericPageCache::SetMarkedPreviewBitmap (
     const CacheKey aKey,
-    const BitmapEx& rMarkedBitmap)
+    const Bitmap& rMarkedBitmap)
 {
     assert(aKey != nullptr);
 
@@ -177,7 +177,7 @@ void GenericPageCache::RequestPreviewBitmap (
         bIsUpToDate = mpBitmapCache->BitmapIsUpToDate (pPage);
     if (bIsUpToDate)
     {
-        const BitmapEx aPreview (mpBitmapCache->GetBitmap(pPage));
+        const Bitmap aPreview (mpBitmapCache->GetBitmap(pPage));
         if (aPreview.IsEmpty() || aPreview.GetSizePixel()!=maPreviewSize)
               bIsUpToDate = false;
     }
diff --git a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.hxx 
b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.hxx
index a47846884c60..798eb58cbe74 100644
--- a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.hxx
+++ b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.hxx
@@ -77,14 +77,14 @@ public:
             Returns a bitmap that is either empty, contains a scaled (up or
             down) version or is the requested bitmap.
     */
-    BitmapEx GetPreviewBitmap (
+    Bitmap GetPreviewBitmap (
         const CacheKey aKey,
         const bool bResize);
-    BitmapEx GetMarkedPreviewBitmap (
+    Bitmap GetMarkedPreviewBitmap (
         const CacheKey aKey);
     void SetMarkedPreviewBitmap (
         const CacheKey aKey,
-        const BitmapEx& rMarkedBitmap);
+        const Bitmap& rMarkedBitmap);
 
     /** When the requested preview bitmap does not yet exist or is not
         up-to-date then the rendering of one is scheduled.  Otherwise this
diff --git a/sd/source/ui/slidesorter/cache/SlsPageCache.cxx 
b/sd/source/ui/slidesorter/cache/SlsPageCache.cxx
index 76c1f14e812c..776edac0663c 100644
--- a/sd/source/ui/slidesorter/cache/SlsPageCache.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsPageCache.cxx
@@ -50,14 +50,14 @@ void PageCache::ChangeSize (
     mpImplementation->ChangePreviewSize(rPreviewSize, bDoSuperSampling);
 }
 
-BitmapEx PageCache::GetPreviewBitmap (
+Bitmap PageCache::GetPreviewBitmap (
     const CacheKey aKey,
     const bool bResize)
 {
     return mpImplementation->GetPreviewBitmap(aKey, bResize);
 }
 
-BitmapEx PageCache::GetMarkedPreviewBitmap (
+Bitmap PageCache::GetMarkedPreviewBitmap (
     const CacheKey aKey)
 {
     return mpImplementation->GetMarkedPreviewBitmap(aKey);
@@ -65,7 +65,7 @@ BitmapEx PageCache::GetMarkedPreviewBitmap (
 
 void PageCache::SetMarkedPreviewBitmap (
     const CacheKey aKey,
-    const BitmapEx& rMarkedBitmap)
+    const Bitmap& rMarkedBitmap)
 {
     mpImplementation->SetMarkedPreviewBitmap(aKey, rMarkedBitmap);
 }
diff --git a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx 
b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx
index 1c0598df3d27..b8c8340145ac 100644
--- a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx
@@ -135,7 +135,7 @@ void QueueProcessor::ProcessOneRequest (
             const SdPage* pSdPage = dynamic_cast<const 
SdPage*>(mpCacheContext->GetPage(aKey));
             if (pSdPage != nullptr)
             {
-                const BitmapEx aPreview (
+                const Bitmap aPreview (
                     maBitmapFactory.CreateBitmap(*pSdPage, maPreviewSize, 
mbDoSuperSampling));
                 mpCache->SetBitmap (pSdPage, aPreview, 
ePriorityClass!=NOT_VISIBLE);
 
diff --git a/sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx 
b/sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx
index 509b9951097e..a74e722c1d85 100644
--- a/sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx
+++ b/sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx
@@ -97,10 +97,10 @@ public:
             Returns a bitmap that is either empty, contains a scaled (up or
             down) version or is the requested bitmap.
     */
-    BitmapEx GetPreviewBitmap(const CacheKey aKey, const bool bResize);
+    Bitmap GetPreviewBitmap(const CacheKey aKey, const bool bResize);
 
-    BitmapEx GetMarkedPreviewBitmap(const CacheKey aKey);
-    void SetMarkedPreviewBitmap(const CacheKey aKey, const BitmapEx& rBitmap);
+    Bitmap GetMarkedPreviewBitmap(const CacheKey aKey);
+    void SetMarkedPreviewBitmap(const CacheKey aKey, const Bitmap& rBitmap);
 
     /** When the requested preview bitmap does not yet exist or is not
         up-to-date then the rendering of one is scheduled.  Otherwise this
diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx 
b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
index 076970ba3d43..c6d5595d268d 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
@@ -60,7 +60,7 @@ public:
         @return
             The returned bitmap may have a different size then the preview 
area.
     */
-    BitmapEx GetPreviewBitmap (
+    Bitmap GetPreviewBitmap (
         const model::SharedPageDescriptor& rpDescriptor,
         const OutputDevice* pReferenceDevice) const;
 
@@ -101,9 +101,9 @@ private:
         OutputDevice& rDevice,
         const model::SharedPageDescriptor& rpDescriptor) const;
 
-    static BitmapEx CreateMarkedPreview(
+    static Bitmap CreateMarkedPreview(
         const Size& rSize,
-        const BitmapEx& rPreview,
+        const Bitmap& rPreview,
         const Bitmap& rOverlay,
         const OutputDevice* pReferenceDevice);
 
diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx 
b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
index e75b1cce6d49..131dce76e66c 100644
--- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
+++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
@@ -152,7 +152,7 @@ Point InsertionIndicatorOverlay::PaintRepresentatives (
     // Paint the pages.
     Point aPageOffset (0,0);
     double nTransparency (0);
-    const BitmapEx aExclusionOverlay 
(mrSlideSorter.GetTheme()->GetIcon(Theme::Icon_HideSlideOverlay));
+    const Bitmap aExclusionOverlay 
(mrSlideSorter.GetTheme()->GetIcon(Theme::Icon_HideSlideOverlay));
     for (sal_Int32 nIndex=2; nIndex>=0; --nIndex)
     {
         if (rRepresentatives.size() <= o3tl::make_unsigned(nIndex))
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx 
b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index 7366e6073a17..7ba95637d895 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -139,7 +139,7 @@ void PageObjectPainter::PaintPreview (
     const SdrPage* pPage = rpDescriptor->GetPage();
     mpCache->SetPreciousFlag(pPage, true);
 
-    const BitmapEx aPreview (GetPreviewBitmap(rpDescriptor, &rDevice));
+    const Bitmap aPreview (GetPreviewBitmap(rpDescriptor, &rDevice));
     if ( ! aPreview.IsEmpty())
     {
         if (aPreview.GetSizePixel() != aBox.GetSize())
@@ -149,9 +149,9 @@ void PageObjectPainter::PaintPreview (
     }
 }
 
-BitmapEx PageObjectPainter::CreateMarkedPreview (
+Bitmap PageObjectPainter::CreateMarkedPreview (
     const Size& rSize,
-    const BitmapEx& rPreview,
+    const Bitmap& rPreview,
     const Bitmap& rOverlay,
     const OutputDevice* pReferenceDevice)
 {
@@ -173,10 +173,10 @@ BitmapEx PageObjectPainter::CreateMarkedPreview (
             for (::tools::Long nY=0; nY<rSize.Height(); nY+=nIconHeight)
                 pDevice->DrawBitmapEx(Point(nX,nY), rOverlay);
     }
-    return BitmapEx(pDevice->GetBitmap(Point(0,0), rSize));
+    return pDevice->GetBitmap(Point(0,0), rSize);
 }
 
-BitmapEx PageObjectPainter::GetPreviewBitmap (
+Bitmap PageObjectPainter::GetPreviewBitmap (
     const model::SharedPageDescriptor& rpDescriptor,
     const OutputDevice* pReferenceDevice) const
 {
@@ -187,7 +187,7 @@ BitmapEx PageObjectPainter::GetPreviewBitmap (
     {
         PageObjectLayouter *pPageObjectLayouter = 
mrLayouter.GetPageObjectLayouter();
 
-        BitmapEx aMarkedPreview (mpCache->GetMarkedPreviewBitmap(pPage));
+        Bitmap aMarkedPreview (mpCache->GetMarkedPreviewBitmap(pPage));
         const ::tools::Rectangle aPreviewBox 
(pPageObjectLayouter->GetBoundingBox(
             rpDescriptor,
             PageObjectLayouter::Part::Preview,
commit 4b8f18a80813b8eed83a980ac4d9521950ca60a1
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Aug 29 10:06:35 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Aug 30 08:51:37 2025 +0200

    BitmapEx->Bitmap in FramePainter
    
    now that Bitmap supports transparency
    
    This flushes out an interesting bug. FramePainter::AdaptColor()
    will set maCenter.maBitmap to empty. On a Bitmap that means
    that the bitmap becomes 0x0 pixels. On a BitmapEx that means
    that it has no data, but it thinks it still has the
    same size.
    Which in turns triggers a infinite loop in
    OffsetBitmap::PaintCenter, so add a check for empty
    there.
    
    Change-Id: Iabe383818da9f38578e40ccfc452501a6c7da50d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190387
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx 
b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
index 747c09500cff..076970ba3d43 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
@@ -104,7 +104,7 @@ private:
     static BitmapEx CreateMarkedPreview(
         const Size& rSize,
         const BitmapEx& rPreview,
-        const BitmapEx& rOverlay,
+        const Bitmap& rOverlay,
         const OutputDevice* pReferenceDevice);
 
     /** Update the local pointer to the page object layouter to the
diff --git a/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx 
b/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx
index efb7b2a3eb9a..d38490163cc2 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx
@@ -107,7 +107,7 @@ public:
         Icon_FocusBorder,
         IconType_Size_
     };
-    const BitmapEx& GetIcon (const IconType eType);
+    const Bitmap& GetIcon (const IconType eType);
 
 private:
     class GradientDescriptor
@@ -120,7 +120,7 @@ private:
     };
     Color maBackgroundColor;
     ::std::vector<GradientDescriptor> maGradients;
-    ::std::vector<BitmapEx> maIcons;
+    ::std::vector<Bitmap> maIcons;
     ::std::vector<Color> maColor;
 
     GradientDescriptor& GetGradient (const GradientColorType eType);
diff --git a/sd/source/ui/slidesorter/view/SlsFramePainter.cxx 
b/sd/source/ui/slidesorter/view/SlsFramePainter.cxx
index 31c301868a93..f68087b66d38 100644
--- a/sd/source/ui/slidesorter/view/SlsFramePainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsFramePainter.cxx
@@ -23,7 +23,7 @@
 
 namespace sd::slidesorter::view {
 
-FramePainter::FramePainter (const BitmapEx& rShadowBitmap)
+FramePainter::FramePainter (const Bitmap& rShadowBitmap)
     : maTopLeft(rShadowBitmap,-1,-1),
       maTop(rShadowBitmap,0,-1),
       maTopRight(rShadowBitmap,+1,-1),
@@ -98,7 +98,7 @@ void FramePainter::AdaptColor (
 //===== FramePainter::OffsetBitmap ============================================
 
 FramePainter::OffsetBitmap::OffsetBitmap (
-    const BitmapEx& rBitmap,
+    const Bitmap& rBitmap,
     const sal_Int32 nHorizontalPosition,
     const sal_Int32 nVerticalPosition)
 {
@@ -115,7 +115,7 @@ FramePainter::OffsetBitmap::OffsetBitmap (
     const Size aSize(
         nHorizontalPosition==0 ? nS : nC,
         nVerticalPosition==0 ? nS : nC);
-    maBitmap = BitmapEx(rBitmap, aOrigin, aSize);
+    maBitmap = Bitmap(rBitmap, aOrigin, aSize);
     if (maBitmap.IsEmpty())
         return;
     maOffset = Point(
@@ -209,6 +209,8 @@ void FramePainter::OffsetBitmap::PaintCenter (
     OutputDevice& rDevice,
     const ::tools::Rectangle& rBox) const
 {
+    if (maBitmap.IsEmpty())
+        return;
     const Size aBitmapSize (maBitmap.GetSizePixel());
     for (::tools::Long nY=rBox.Top(); nY<=rBox.Bottom(); 
nY+=aBitmapSize.Height())
         for (::tools::Long nX=rBox.Left(); nX<=rBox.Right(); 
nX+=aBitmapSize.Width())
diff --git a/sd/source/ui/slidesorter/view/SlsFramePainter.hxx 
b/sd/source/ui/slidesorter/view/SlsFramePainter.hxx
index 9398cb94ecd5..24f61321cd69 100644
--- a/sd/source/ui/slidesorter/view/SlsFramePainter.hxx
+++ b/sd/source/ui/slidesorter/view/SlsFramePainter.hxx
@@ -26,7 +26,7 @@ namespace sd::slidesorter::view {
 class FramePainter
 {
 public:
-    explicit FramePainter (const BitmapEx& rBitmap);
+    explicit FramePainter (const Bitmap& rBitmap);
     ~FramePainter();
 
     /** Paint a border around the given box by using a set of bitmaps for
@@ -46,7 +46,7 @@ private:
     */
     class OffsetBitmap {
     public:
-        BitmapEx maBitmap;
+        Bitmap maBitmap;
         Point maOffset;
 
         /** Create one of the eight shadow bitmaps from one that combines
@@ -65,7 +65,7 @@ private:
                 Valid values are -1 (top), 0 (center), and +1 (bottom).
         */
         OffsetBitmap (
-            const BitmapEx& rBitmap,
+            const Bitmap& rBitmap,
             const sal_Int32 nHorizontalPosition,
             const sal_Int32 nVerticalPosition);
 
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx 
b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index 85e65ded7598..7366e6073a17 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -152,7 +152,7 @@ void PageObjectPainter::PaintPreview (
 BitmapEx PageObjectPainter::CreateMarkedPreview (
     const Size& rSize,
     const BitmapEx& rPreview,
-    const BitmapEx& rOverlay,
+    const Bitmap& rOverlay,
     const OutputDevice* pReferenceDevice)
 {
     ScopedVclPtr<VirtualDevice> pDevice;
diff --git a/sd/source/ui/slidesorter/view/SlsTheme.cxx 
b/sd/source/ui/slidesorter/view/SlsTheme.cxx
index 4bd66946e52b..c80d5793c135 100644
--- a/sd/source/ui/slidesorter/view/SlsTheme.cxx
+++ b/sd/source/ui/slidesorter/view/SlsTheme.cxx
@@ -199,7 +199,7 @@ void Theme::SetGradient (
     rGradient.maBorderColor2 = ChangeLuminance(aColor, nBorderEndOffset);
 }
 
-const BitmapEx& Theme::GetIcon (const IconType eType)
+const Bitmap& Theme::GetIcon (const IconType eType)
 {
     if (size_t(eType)<maIcons.size())
         return maIcons[eType];

Reply via email to