Kaydet (Commit) 1a032dcf authored tarafından Pierre Sauter's avatar Pierre Sauter Kaydeden (comit) Samuel Mehrbrodt

tdf#74834 Expert Configuration option to disable thumbnails in StartCenter

If Office::Common::History::RecentDocsThumbnail is set to false, no new thumbnails
will be created and stored to registrymodifications.xcu. Existing thumbnails in
registrymodifications.xcu or the documents will not be read and displayed.

Change-Id: If9527aa0d336a6b77b4c9bb0cc09143ffa1725d8
Reviewed-on: https://gerrit.libreoffice.org/20338Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 0abfcb73
...@@ -2079,6 +2079,13 @@ ...@@ -2079,6 +2079,13 @@
</constraints> </constraints>
<value>25</value> <value>25</value>
</prop> </prop>
<prop oor:name="RecentDocsThumbnail" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Specifies whether to generate/show a thumbnail image for RecentDocsView.</desc>
<label>Store/show thumbnails in RecentDocs History</label>
</info>
<value>true</value>
</prop>
<set oor:name="HelpBookmarks" oor:node-type="HistoryType"> <set oor:name="HelpBookmarks" oor:node-type="HistoryType">
<info> <info>
<desc>Contains the most recently opened help documents.</desc> <desc>Contains the most recently opened help documents.</desc>
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <svl/eitem.hxx> #include <svl/eitem.hxx>
#include <vcl/gdimtf.hxx> #include <vcl/gdimtf.hxx>
#include <vcl/pngwrite.hxx> #include <vcl/pngwrite.hxx>
#include <officecfg/Office/Common.hxx>
#include <osl/file.hxx> #include <osl/file.hxx>
#include <unotools/localfilehelper.hxx> #include <unotools/localfilehelper.hxx>
#include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase.hxx>
...@@ -200,7 +201,9 @@ void SfxPickList::AddDocumentToPickList( SfxObjectShell* pDocSh ) ...@@ -200,7 +201,9 @@ void SfxPickList::AddDocumentToPickList( SfxObjectShell* pDocSh )
boost::optional<OUString> aThumbnail; boost::optional<OUString> aThumbnail;
// generate the thumbnail // generate the thumbnail
if (!pDocSh->IsModified() && !Application::IsHeadlessModeEnabled()) //fdo#74834: only generate thumbnail for history if the corresponding option is not disabled in the configuration
if (!pDocSh->IsModified() && !Application::IsHeadlessModeEnabled() &&
officecfg::Office::Common::History::RecentDocsThumbnail::get())
{ {
// not modified => the document matches what is in the shell // not modified => the document matches what is in the shell
const SfxUnoAnyItem* pEncryptionDataItem = SfxItemSet::GetItem<SfxUnoAnyItem>(pMed->GetItemSet(), SID_ENCRYPTIONDATA, false); const SfxUnoAnyItem* pEncryptionDataItem = SfxItemSet::GetItem<SfxUnoAnyItem>(pMed->GetItemSet(), SID_ENCRYPTIONDATA, false);
......
...@@ -182,7 +182,8 @@ void RecentDocsView::Reload() ...@@ -182,7 +182,8 @@ void RecentDocsView::Reload()
a >>= aURL; a >>= aURL;
else if (rRecentEntry[j].Name == "Title") else if (rRecentEntry[j].Name == "Title")
a >>= aTitle; a >>= aTitle;
else if (rRecentEntry[j].Name == "Thumbnail") //fdo#74834: only load thumbnail if the corresponding option is not disabled in the configuration
else if (rRecentEntry[j].Name == "Thumbnail" && officecfg::Office::Common::History::RecentDocsThumbnail::get())
{ {
OUString aBase64; OUString aBase64;
a >>= aBase64; a >>= aBase64;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <drawinglayer/primitive2d/discretebitmapprimitive2d.hxx> #include <drawinglayer/primitive2d/discretebitmapprimitive2d.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <i18nutil/paper.hxx> #include <i18nutil/paper.hxx>
#include <officecfg/Office/Common.hxx>
#include <sfx2/recentdocsview.hxx> #include <sfx2/recentdocsview.hxx>
#include <sfx2/sfxresid.hxx> #include <sfx2/sfxresid.hxx>
#include <sfx2/templateabstractview.hxx> #include <sfx2/templateabstractview.hxx>
...@@ -50,7 +51,9 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR ...@@ -50,7 +51,9 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR
aTitle = aURLObj.GetName(INetURLObject::DECODE_WITH_CHARSET); aTitle = aURLObj.GetName(INetURLObject::DECODE_WITH_CHARSET);
BitmapEx aThumbnail(rThumbnail); BitmapEx aThumbnail(rThumbnail);
if (aThumbnail.IsEmpty() && aURLObj.GetProtocol() == INetProtocol::File) //fdo#74834: only load thumbnail if the corresponding option is not disabled in the configuration
if (aThumbnail.IsEmpty() && aURLObj.GetProtocol() == INetProtocol::File &&
officecfg::Office::Common::History::RecentDocsThumbnail::get())
aThumbnail = ThumbnailView::readThumbnail(rURL); aThumbnail = ThumbnailView::readThumbnail(rURL);
if (aThumbnail.IsEmpty()) if (aThumbnail.IsEmpty())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment