diff options
author | Pierre Sauter <pierre.sauter@stwm.de> | 2015-12-01 17:28:48 +0000 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2015-12-07 13:07:32 +0000 |
commit | 1a032dcfebc2702f0612c470d6b9c3e3cf4fb637 (patch) | |
tree | f4c8996b73d19ff95fa77e71cd32b71ecd186379 | |
parent | 0abfcb735e60757ee64aa6d0fbb1b601c29813f3 (diff) |
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/20338
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 7 | ||||
-rw-r--r-- | sfx2/source/appl/sfxpicklist.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/control/recentdocsview.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/control/recentdocsviewitem.cxx | 5 |
4 files changed, 17 insertions, 3 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 7279a04b9dc5..b8d9828ec7ee 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -2079,6 +2079,13 @@ </constraints> <value>25</value> </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"> <info> <desc>Contains the most recently opened help documents.</desc> diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 9e9b16400ec6..6e07c1bdfe4b 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -31,6 +31,7 @@ #include <svl/eitem.hxx> #include <vcl/gdimtf.hxx> #include <vcl/pngwrite.hxx> +#include <officecfg/Office/Common.hxx> #include <osl/file.hxx> #include <unotools/localfilehelper.hxx> #include <cppuhelper/implbase.hxx> @@ -200,7 +201,9 @@ void SfxPickList::AddDocumentToPickList( SfxObjectShell* pDocSh ) boost::optional<OUString> aThumbnail; // 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 const SfxUnoAnyItem* pEncryptionDataItem = SfxItemSet::GetItem<SfxUnoAnyItem>(pMed->GetItemSet(), SID_ENCRYPTIONDATA, false); diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index e4f59320ba33..55f1c07fcbad 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -182,7 +182,8 @@ void RecentDocsView::Reload() a >>= aURL; else if (rRecentEntry[j].Name == "Title") 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; a >>= aBase64; diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index ea5169f1a959..abf4325021f0 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -15,6 +15,7 @@ #include <drawinglayer/primitive2d/discretebitmapprimitive2d.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <i18nutil/paper.hxx> +#include <officecfg/Office/Common.hxx> #include <sfx2/recentdocsview.hxx> #include <sfx2/sfxresid.hxx> #include <sfx2/templateabstractview.hxx> @@ -50,7 +51,9 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR aTitle = aURLObj.GetName(INetURLObject::DECODE_WITH_CHARSET); 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); if (aThumbnail.IsEmpty()) |