Kaydet (Commit) 0c0c8de9 authored tarafından Giuseppe Castagno's avatar Giuseppe Castagno Kaydeden (comit) jan iversen

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/21041Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarjan iversen <jani@documentfoundation.org>
Tested-by: 's avatarjan iversen <jani@documentfoundation.org>
üst 5fc2910f
...@@ -1327,16 +1327,21 @@ void RemoteFilesDialog::UpdateControls( const OUString& rURL ) ...@@ -1327,16 +1327,21 @@ void RemoteFilesDialog::UpdateControls( const OUString& rURL )
for( ::std::vector< SvtContentEntry >::size_type i = 0; i < rFolders.size(); i++ ) 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 ) if( nTitleStart != -1 )
{ {
OUString sTitle( INetURLObject::decode( OUString sTitle( INetURLObject::decode(
rFolders[i].maURL.copy( nTitleStart + 1 ), aFolderName.copy( nTitleStart + 1 ),
INetURLObject::DECODE_WITH_CHARSET ) ); INetURLObject::DECODE_WITH_CHARSET ) );
if( rFolders[i].mbIsFolder ) 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 // add entries to the autocompletion mechanism
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment