summaryrefslogtreecommitdiff
path: root/sfx2/source/control
diff options
context:
space:
mode:
authorPatrick Luby <guibmacdev@gmail.com>2024-09-21 21:09:33 -0400
committerPatrick Luby <guibomacdev@gmail.com>2024-09-22 17:14:19 +0200
commit13a42d5c2d433da6c2c69159bfc6df0e37643333 (patch)
treec2266723bd0729825de118d77d7bef9b2f34bc32 /sfx2/source/control
parentac38f7d53755459a6fdc4cc9064b93e07501fe56 (diff)
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 <guibomacdev@gmail.com>
Diffstat (limited to 'sfx2/source/control')
-rw-r--r--sfx2/source/control/recentdocsviewitem.cxx15
1 files changed, 15 insertions, 0 deletions
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