summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-12-15 09:22:13 +0300
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2021-12-15 11:35:40 +0100
commit214364584d3a247a70eed42ca7101b675125bf43 (patch)
tree5afb042fc61856c62b61c79b19d14f817f9eeacb /sfx2
parent56186db93b7777f7b99a8fbfce82b775e24b7695 (diff)
tdf#131850: avoid encryption check for recent docs overlay
Change-Id: I673de978c39492bf9be78945ece95ade2a943ffc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126849 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 2f848eb5dc6f6f9344f250ac9860065130aaf436) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126869 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/recentdocsview.hxx2
-rw-r--r--sfx2/source/control/recentdocsview.cxx8
2 files changed, 6 insertions, 4 deletions
diff --git a/sfx2/inc/recentdocsview.hxx b/sfx2/inc/recentdocsview.hxx
index b87a0cce679c..b347fc25029a 100644
--- a/sfx2/inc/recentdocsview.hxx
+++ b/sfx2/inc/recentdocsview.hxx
@@ -65,7 +65,7 @@ public:
void insertItem(const OUString &rURL, const OUString &rTitle, const BitmapEx &rThumbnail, sal_uInt16 nId);
static bool typeMatchesExtension(ApplicationType type, std::u16string_view rExt);
- static BitmapEx getDefaultThumbnail(const OUString &rURL);
+ static BitmapEx getDefaultThumbnail(const OUString &rURL, bool bCheckEncrypted = true);
ApplicationType mnFileTypes;
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index f942b1ffbb15..0957cabbdc6f 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -206,13 +206,15 @@ bool RecentDocsView::isAcceptedFile(const OUString &rURL) const
(mnFileTypes & ApplicationType::TYPE_OTHER && typeMatchesExtension(ApplicationType::TYPE_OTHER, aExt));
}
-BitmapEx RecentDocsView::getDefaultThumbnail(const OUString &rURL)
+BitmapEx RecentDocsView::getDefaultThumbnail(const OUString &rURL, bool bCheckEncrypted)
{
BitmapEx aImg;
INetURLObject aUrl(rURL);
OUString aExt = aUrl.getExtension();
- const std::map<ApplicationType,OUString>& rWhichMap = IsDocEncrypted( rURL) ?
+ // tdf#131850: avoid reading the file to check if it's encrypted,
+ // if we only need its generic "module" thumbnail
+ const std::map<ApplicationType,OUString>& rWhichMap = bCheckEncrypted && IsDocEncrypted(rURL) ?
EncryptedBitmapForExtension : BitmapForExtension;
std::map<ApplicationType,OUString>::const_iterator mIt =
@@ -269,7 +271,7 @@ void RecentDocsView::Reload()
}
}
- aModule = getDefaultThumbnail(aURL);
+ aModule = getDefaultThumbnail(aURL, false); // We don't need an "encrypted" icon here
if (!aModule.IsEmpty() && !aThumbnail.IsEmpty()) {
ScopedVclPtr<VirtualDevice> m_pVirDev(VclPtr<VirtualDevice>::Create());
Size aSize(aThumbnail.GetSizePixel());