summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-12-16 16:51:12 +0100
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2021-12-22 19:59:40 +0100
commit8d111cee975a1a8f9f3ed1773e93fb63c7565a7a (patch)
treeeda43baa52bbb423cd993340f772867ac30b2f49
parent156f2e3bac9ba2cfe517ea14e7cce961bd0e7ceb (diff)
tdf#146219: don't try to detect if a recent file is a directory
This avoids accessing (possibly unavailable) remote URLs, when we already know that MRU items are files. Change-Id: I97e07f007d4129b93b4939311c67cf95de6ff836 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126943 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127004 (cherry picked from commit c247023dfd10bef22b9ff5a85cc44febfc90e951) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126974 (cherry picked from commit 37c617af996bf5f9c4be08a1245940d00668a64b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126980 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r--framework/source/uielement/recentfilesmenucontroller.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index b25c84256cc2..6bf9c1f99858 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -204,8 +204,10 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
pVCLPopupMenu->InsertItem( sal_uInt16( i+1 ), aMenuShortCut.makeStringAndClear() );
if ( bIsIconsAllowed ) {
- Image aThumbnail = SvFileInformationManager::GetImage(aURL, false, {});
- pVCLPopupMenu->SetItemImage(sal_uInt16 ( i+1 ), aThumbnail);
+ // tdf#146219: don't use SvFileInformationManager::GetImageId,
+ // which needs to access the URL to detect if it's a directory
+ BitmapEx aThumbnail(SvFileInformationManager::GetFileImageId(aURL));
+ pVCLPopupMenu->SetItemImage(sal_uInt16 ( i+1 ), Image(aThumbnail));
}
pVCLPopupMenu->SetTipHelpText( sal_uInt16( i+1 ), aTipHelpText );