summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-01-01 12:49:22 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-01-14 13:36:09 +0000
commit55062c4d358ae94a35ac0454d24c39b39ba4e489 (patch)
treeb9e572d6ede4f1dcf5d55c36db714469dc8234f0
parent15791e7c288e6ed134b06065771fbf9aed964467 (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> (cherry picked from commit 0c0c8de9b2df98c7d6394e703fc2fcb9e97e20c0) Reviewed-on: https://gerrit.libreoffice.org/21256 Reviewed-by: Giuseppe Castagno <giuseppe.castagno@acca-esse.eu> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-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 b5de1d9cde94..91d2bc61c1cd 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