diff options
author | Radek Doulik <rodo@novell.com> | 2011-04-28 18:28:06 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2011-04-28 18:28:06 +0200 |
commit | a33439a89b4901159823006b32dcff6d25e81dcb (patch) | |
tree | 2fad96ffb4861885d253516887d18a0c0b0d5599 /sfx2 | |
parent | 53780882f1dc8890d819361fed681f554c724b59 (diff) |
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
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/objsh.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 24 |
2 files changed, 18 insertions, 9 deletions
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index a3ad4fbf917c..48f938626e6e 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 d570e0b3e028..954df88eb949 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 |