summaryrefslogtreecommitdiffstats
path: root/fpicker
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2015-08-10 12:02:55 +0200
committerSzymon Kłos <eszkadev@gmail.com>2015-08-14 08:45:41 +0200
commit2b0e0ffc1562e3f939833b9dfc3c52eea847bd4d (patch)
tree0511ce1516c1b914f700d39094227d81935f871d /fpicker
parentadded New Folder button (diff)
downloadcore-2b0e0ffc1562e3f939833b9dfc3c52eea847bd4d.tar.gz
core-2b0e0ffc1562e3f939833b9dfc3c52eea847bd4d.zip
when user typed a folder name, open it
Change-Id: I800f97bfd9f564c065ca7e59f5751768f2f2bd0d
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/office/RemoteFilesDialog.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 20ce343d056e..a85c40dc82d5 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -914,6 +914,9 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, NewFolderHdl )
IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
{
+ OUString sNameNoExt = m_pName_ed->GetText();
+ OUString sPathNoExt;
+
// auto extension
if( m_eMode == REMOTEDLG_MODE_SAVE )
AddFileExtension();
@@ -933,6 +936,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
if( !bSelected )
{
m_sPath = sCurrentPath + INetURLObject::encode( sName, INetURLObject::PART_FPATH, INetURLObject::ENCODE_ALL );
+ sPathNoExt = sCurrentPath + INetURLObject::encode( sNameNoExt, INetURLObject::PART_FPATH, INetURLObject::ENCODE_ALL );
}
else
{
@@ -953,11 +957,11 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
bool bExists = false;
if( bFileDlg )
- bExists = ContentIsDocument(m_sPath);
+ bExists = ContentIsDocument( m_sPath );
else
- bExists = ContentIsFolder(m_sPath);
+ bExists = ContentIsFolder( m_sPath );
- if ( bExists )
+ if( bExists )
{
if( m_eMode == REMOTEDLG_MODE_SAVE )
{
@@ -970,9 +974,15 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
}
else
{
- if( m_eMode == REMOTEDLG_MODE_OPEN )
+ if( ContentIsFolder( sPathNoExt ) )
+ {
+ OpenURL( sPathNoExt );
+ m_pName_ed->SetText( "" );
+
return 0;
- if( m_eMode == REMOTEDLG_MODE_SAVE && ContentIsFolder(m_sPath) )
+ }
+
+ if( m_eMode == REMOTEDLG_MODE_OPEN )
return 0;
}