fpicker/source/office/RemoteFilesDialog.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
New commits: commit 0c0c8de9b2df98c7d6394e703fc2fcb9e97e20c0 Author: Giuseppe Castagno <giuseppe.casta...@acca-esse.eu> Date: Fri Jan 1 12:49:22 2016 +0100 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 <c...@libreoffice.org> Reviewed-by: jan iversen <j...@documentfoundation.org> Tested-by: jan iversen <j...@documentfoundation.org> diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index e62dd62..e4b0e1d 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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits