[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sfx2/inc sfx2/source

Petr Mladek pmladek at kemper.freedesktop.org
Thu Apr 28 09:29:28 PDT 2011


 sfx2/inc/sfx2/objsh.hxx     |    3 +++
 sfx2/source/doc/objstor.cxx |   24 +++++++++++++++---------
 2 files changed, 18 insertions(+), 9 deletions(-)

New commits:
commit cb6ae22ff25de0f2edc7057688358314e4e692a4
Author: Radek Doulik <rodo at novell.com>
Date:   Thu Apr 28 18:28:06 2011 +0200

    sfx2-add-to-recently-used-after-save.diff: improve recently use list hadling
    
    add an entry to recently used list when document is saved; it helps with
    thumbnail generation in file managers

diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 50ab650..b21f773 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -228,6 +228,9 @@ protected:
     /// template method, called by FlushDocInfo; this implementation is empty
     virtual void                DoFlushDocInfo();
 
+    // helper method
+    void AddToRecentlyUsedList();
+
 public:
                                 TYPEINFO();
                                 SFX_DECL_INTERFACE(SFX_INTERFACE_SFXDOCSH)
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 7844db9..f0db081 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -797,15 +797,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
             && !( pPreviewItem && pPreviewItem->GetValue() )
             && !( pHiddenItem && pHiddenItem->GetValue() ) )
             {
-                INetURLObject aUrl( pMedium->GetOrigURL() );
-
-                if ( aUrl.GetProtocol() == INET_PROT_FILE )
-                {
-                    const SfxFilter* pOrgFilter = pMedium->GetOrigFilter();
-                    Application::AddToRecentDocumentList(
-                        aUrl.GetURLNoPass( INetURLObject::NO_DECODE ),
-                        (pOrgFilter) ? pOrgFilter->GetMimeType() : String() );
-                }
+                AddToRecentlyUsedList();
             }
         }
 
@@ -2121,9 +2113,23 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed )
     pMedium->ClearBackup_Impl();
     pMedium->LockOrigFileOnDemand( sal_True, sal_False );
 
+    AddToRecentlyUsedList();
+
     return bOk;
 }
 
+void SfxObjectShell::AddToRecentlyUsedList()
+{
+    INetURLObject aUrl( pMedium->GetOrigURL() );
+
+    if ( aUrl.GetProtocol() == INET_PROT_FILE )
+    {
+        const SfxFilter* pOrgFilter = pMedium->GetOrigFilter();
+        Application::AddToRecentDocumentList( aUrl.GetURLNoPass( INetURLObject::NO_DECODE ),
+                                              (pOrgFilter) ? pOrgFilter->GetMimeType() : String() );
+    }
+}
+
 //-------------------------------------------------------------------------
 
 sal_Bool SfxObjectShell::ConvertFrom


More information about the Libreoffice-commits mailing list