From f7feb4227d83f4f095597a44826277aaae2bc0df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Corrius?= Date: Sat, 3 Aug 2013 13:44:19 +0200 Subject: [PATCH] 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 Tested-by: Tor Lillqvist --- sfx2/source/appl/sfxpicklist.cxx | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 32b3ea561bad..c09f3604f3fa 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -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;