summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-01-01 12:49:22 +0100
committerjan iversen <jani@documentfoundation.org>2016-01-08 10:52:16 +0000
commit0c0c8de9b2df98c7d6394e703fc2fcb9e97e20c0 (patch)
tree0e76a76db59cc194eb70b78176f51924b49ebee2 /fpicker
parent5fc2910fc872bbd1184aaab7c842dff593d2449b (diff)
Related tdf#96833: display WebDAV path in remote files dialog
Folder WebDAV paths have the '/' at the end, this needs to be removed in RemoteDialog logic while filling the treeview. Change-Id: I8336de3e08ff030b27b1e48594448ff66106cff6 Reviewed-on: https://gerrit.libreoffice.org/21041 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/office/RemoteFilesDialog.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index e62dd6236775..e4b0e1dfb095 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -1327,16 +1327,21 @@ void RemoteFilesDialog::UpdateControls( const OUString& rURL )
for( ::std::vector< SvtContentEntry >::size_type i = 0; i < rFolders.size(); i++ )
{
- int nTitleStart = rFolders[i].maURL.lastIndexOf( '/' );
+ //WebDAV folders path ends in '/', so strip it
+ OUString aFolderName = rFolders[i].maURL;
+ if( rFolders[i].mbIsFolder && ( ( aFolderName.lastIndexOf( '/' ) + 1 ) == aFolderName.getLength() ) )
+ aFolderName = aFolderName.copy( 0, aFolderName.getLength() - 1 );
+
+ int nTitleStart = aFolderName.lastIndexOf( '/' );
if( nTitleStart != -1 )
{
OUString sTitle( INetURLObject::decode(
- rFolders[i].maURL.copy( nTitleStart + 1 ),
+ aFolderName.copy( nTitleStart + 1 ),
INetURLObject::DECODE_WITH_CHARSET ) );
if( rFolders[i].mbIsFolder )
{
- aFolders.push_back( std::pair< OUString, OUString > ( sTitle, rFolders[i].maURL ) );
+ aFolders.push_back( std::pair< OUString, OUString > ( sTitle, aFolderName ) );
}
// add entries to the autocompletion mechanism