diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-04-06 16:54:51 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-04-06 21:34:17 +0200 |
commit | b5b27f017b08ad4fbc67222a36f71933aa5a47dd (patch) | |
tree | 83dad7126e3fe83364d62f3b047de5832458a266 /framework | |
parent | 765e42d4c3c0d992343790c53625623bb6cfa4ac (diff) |
Following 6fcabbd6199869753fd6a266f23901962a77f556
...tdf#129153: Show MIME type icon in main menu File>Recent documents list
No need to call n times aIconSettings ctr + GetUseImagesInMenus() since it won't change in the loop
+ rename "aIsIconsAllowed" to "bIsIconsAllowed" since it's a bool
Change-Id: I5729f0cdba9a0973afe4d0188f11361877300193
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113682
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uielement/recentfilesmenucontroller.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index ee22dd306a5e..343d719c1741 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -158,6 +158,9 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > if ( !m_aRecentFilesItems.empty() ) { const sal_uInt32 nCount = m_aRecentFilesItems.size(); + StyleSettings aIconSettings; + bool bIsIconsAllowed = aIconSettings.GetUseImagesInMenus(); + for ( sal_uInt32 i = 0; i < nCount; i++ ) { @@ -185,9 +188,6 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > INetURLObject aURL( m_aRecentFilesItems[i] ); OUString aTipHelpText( aURL.getFSysPath( FSysStyle::Detect ) ); - StyleSettings aIconSettings; - bool aIsIconsAllowed = aIconSettings.GetUseImagesInMenus(); - if ( aURL.GetProtocol() == INetProtocol::File ) { // Do handle file URL differently: don't show the protocol, just the file name @@ -203,7 +203,7 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > pVCLPopupMenu->InsertItem( sal_uInt16( i+1 ), aMenuShortCut.makeStringAndClear() ); - if ( aIsIconsAllowed ) { + if ( bIsIconsAllowed ) { Image aThumbnail = SvFileInformationManager::GetImage(aURL); pVCLPopupMenu->SetItemImage(sal_uInt16 ( i+1 ), aThumbnail); } |