diff options
-rw-r--r-- | sfx2/inc/recentdocsview.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/recentdocsview.cxx | 8 |
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()); |