[Libreoffice-commits] core.git: officecfg/registry sfx2/source

Pierre Sauter pierre.sauter at stwm.de
Mon Dec 7 05:07:56 PST 2015


 officecfg/registry/schema/org/openoffice/Office/Common.xcs |    7 +++++++
 sfx2/source/appl/sfxpicklist.cxx                           |    5 ++++-
 sfx2/source/control/recentdocsview.cxx                     |    3 ++-
 sfx2/source/control/recentdocsviewitem.cxx                 |    5 ++++-
 4 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 1a032dcfebc2702f0612c470d6b9c3e3cf4fb637
Author: Pierre Sauter <pierre.sauter at stwm.de>
Date:   Tue Dec 1 17:28:48 2015 +0000

    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 at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 7279a04..b8d9828 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 9e9b164..6e07c1b 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 e4f5932..55f1c07 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 ea5169f..abf4325 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())


More information about the Libreoffice-commits mailing list