Call AddDocumentToPickList in SFX_EVENT_OPENDOC

Not only simplifies the code but makes the application more
coherent with other Windows and Linux applications as the
recent documents lists is populated when you open the file.
Also, for Windows 7 and higher, it makes a call to
Application::AddToRecentDocumentList. Tested on Windows
and Linux.

Change-Id: I360acc9723260d5827eb83e3c240ab0673352af6
Reviewed-on: https://gerrit.libreoffice.org/5266
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Tor Lillqvist <tml@iki.fi>
This commit is contained in:
Jesús Corrius
2013-08-03 13:44:19 +02:00
committed by Tor Lillqvist
parent 17664f377b
commit f7feb4227d

View File

@@ -379,32 +379,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
case SFX_EVENT_OPENDOC:
{
SfxMedium *pMed = pDocSh->GetMedium();
if( !pMed )
return;
// Unnamed Documents and embedded-Documents not in History
if ( !pDocSh->HasName() ||
SFX_CREATE_MODE_STANDARD != pDocSh->GetCreateMode() )
return;
// Help not in History
INetURLObject aURL( pDocSh->IsDocShared() ? pDocSh->GetSharedFileURL() : OUString( pMed->GetOrigURL() ) );
if ( aURL.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP )
return;
OUString aTitle = pDocSh->GetTitle(SFX_TITLE_PICKLIST);
OUString aFilter;
const SfxFilter* pFilter = pMed->GetOrigFilter();
if ( pFilter )
aFilter = pFilter->GetFilterName();
// add to svtool history options
SvtHistoryOptions().AppendItem( eHISTORY,
aURL.GetURLNoPass( INetURLObject::NO_DECODE ),
aFilter,
aTitle,
OUString() );
AddDocumentToPickList(pDocSh);
}
break;