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
This commit is contained in:
parent
53780882f1
commit
a33439a89b
2 changed files with 18 additions and 9 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue