summaryrefslogtreecommitdiff
path: root/sfx2/source/appl/sfxpicklist.cxx
diff options
context:
space:
mode:
authorJesús Corrius <jcorrius@gmail.com>2013-08-03 13:44:19 +0200
committerTor Lillqvist <tml@iki.fi>2013-08-09 08:26:59 +0000
commitf7feb4227d83f4f095597a44826277aaae2bc0df (patch)
tree1adc3c022417f7a7b19add3c58036111aca40ec3 /sfx2/source/appl/sfxpicklist.cxx
parent17664f377bf499cfa3438c95bbf5ac16ec7d8674 (diff)
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>
Diffstat (limited to 'sfx2/source/appl/sfxpicklist.cxx')
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx27
1 files changed, 1 insertions, 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;