[Libreoffice-commits] core.git: fpicker/source

Giuseppe Castagno giuseppe.castagno at acca-esse.eu
Fri Jan 8 02:52:38 PST 2016


 fpicker/source/office/RemoteFilesDialog.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 0c0c8de9b2df98c7d6394e703fc2fcb9e97e20c0
Author: Giuseppe Castagno <giuseppe.castagno at 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 <ci at libreoffice.org>
    Reviewed-by: jan iversen <jani at documentfoundation.org>
    Tested-by: jan iversen <jani at 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


More information about the Libreoffice-commits mailing list