sfx2/source/control/recentdocsviewitem.cxx |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit 13a42d5c2d433da6c2c69159bfc6df0e37643333
Author:     Patrick Luby <guibmac...@gmail.com>
AuthorDate: Sat Sep 21 21:09:33 2024 -0400
Commit:     Patrick Luby <guibomac...@gmail.com>
CommitDate: Sun Sep 22 17:14:19 2024 +0200

    tdf#163086 downscale excessively large pinned document icons
    
    For some unknown reason to me, some of the SVG icon sets have their
    pinned document icons set to a viewport of 64x64. So downscale such
    icons to more closely match the size of the pinned document icons
    in the PNG icon sets.
    
    Change-Id: Ic7e51ff194968e09d13a5bff341ccbbf80cfb26a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173765
    Tested-by: Jenkins
    Reviewed-by: Patrick Luby <guibomac...@gmail.com>

diff --git a/sfx2/source/control/recentdocsviewitem.cxx 
b/sfx2/source/control/recentdocsviewitem.cxx
index d5ae52e297d8..f422a2ad40d7 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -147,6 +147,21 @@ 
RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView &rView, const OUStri
     if (aTitle.isEmpty())
         aTitle = 
aURLObj.GetLastName(INetURLObject::DecodeMechanism::WithCharset);
 
+    // tdf#163086 downscale excessively large pinned document icons
+    // For some unknown reason to me, some of the SVG icon sets have their
+    // pinned document icons set to a viewport of 64x64. So downscale such
+    // icons to more closely match the size of the pinned document icons
+    // in the PNG icon sets.
+    const double nMaxWidthAndHeight = 24;
+    const Size aPinnedBmpSize(m_aPinnedDocumentBitmap.GetSizePixel());
+    const double nPinnedBmpMaxWidthAndHeight = 
std::max(aPinnedBmpSize.Width(), aPinnedBmpSize.Height());
+    if (nPinnedBmpMaxWidthAndHeight > nMaxWidthAndHeight)
+    {
+        const double fScale = nMaxWidthAndHeight / nPinnedBmpMaxWidthAndHeight;
+        m_aPinnedDocumentBitmap.Scale(fScale, fScale);
+        m_aPinnedDocumentBitmapHiglighted.Scale(fScale, fScale);
+    }
+
     BitmapEx aThumbnail;
 
     //fdo#74834: only load thumbnail if the corresponding option is not 
disabled in the configuration

Reply via email to