[Libreoffice-commits] core.git: framework/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 6 19:35:00 UTC 2021


 framework/source/uielement/recentfilesmenucontroller.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit b5b27f017b08ad4fbc67222a36f71933aa5a47dd
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Tue Apr 6 16:54:51 2021 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Tue Apr 6 21:34:17 2021 +0200

    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 at yahoo.fr>

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);
             }


More information about the Libreoffice-commits mailing list