diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2015-07-20 14:19:54 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2015-07-24 12:28:49 +0200 |
commit | 7c4fe320e6c4aeb30a9801e1ec34255422e047e4 (patch) | |
tree | 81b004bfa06adbb073aa1f4362cdac70debb3a98 /fpicker | |
parent | 37e184911ef6cd19f9b7ede0407f9a60a3932b44 (diff) |
remember user name in recent files
Change-Id: I55b340e90d51b614b8f46c06e3dc1961b3bac2ba
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.cxx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 28200bb4c2cd..16627582cf53 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -696,8 +696,13 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectHdl ) if( ( pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_PATHDLG ) ) || ( !pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_FILEDLG ) ) ) { + // url must contain user info, because we need this info in recent files entry + // (to fill user field in login box by default) INetURLObject aURL( pData->maURL ); - m_sPath = pData->maURL; + INetURLObject aCurrentURL( m_sLastServiceUrl ); + aURL.SetUser( aCurrentURL.GetUser() ); + + m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE ); m_pName_ed->SetText( INetURLObject::decode( aURL.GetLastName(), INetURLObject::DECODE_WITH_CHARSET ) ); } @@ -815,6 +820,14 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) m_sPath = sCurrentPath; else m_sPath = sSelectedItem; + + // url must contain user info, because we need this info in recent files entry + // (to fill user field in login box by default) + INetURLObject aURL( m_sPath ); + INetURLObject aCurrentURL( m_sLastServiceUrl ); + aURL.SetUser( aCurrentURL.GetUser() ); + + m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE ); } bool bExists = false; @@ -973,7 +986,13 @@ std::vector<OUString> RemoteFilesDialog::GetPathList() const while( pEntry ) { - aList.push_back( SvtFileView::GetURL( pEntry ) ); + // url must contain user info, because we need this info in recent files entry + // (to fill user field in login box by default) + INetURLObject aURL( SvtFileView::GetURL( pEntry ) ); + INetURLObject aCurrentURL( m_sLastServiceUrl ); + aURL.SetUser( aCurrentURL.GetUser() ); + + aList.push_back( aURL.GetMainURL( INetURLObject::NO_DECODE ) ); pEntry = m_pFileView->NextSelected( pEntry ); } |