[Libreoffice-commits] .: 2 commits - ucb/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Jul 11 09:31:12 PDT 2012


 ucb/source/ucp/cmis/cmis_content.cxx |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit aaddd17317ece20a46e7c3586ce43a95a5db2059
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Wed Jul 11 18:28:52 2012 +0200

    CMIS UCP: getChildren created wrong path if there is no trailing /
    
    Change-Id: I4cb4e691046c92303cab9f0b97fa19d9ad68d34f

diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 9125691..3349e0f 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -1179,7 +1179,11 @@ namespace cmis
                     // TODO Cache the objects
 
                     URL aUrl( m_sURL );
-                    aUrl.setObjectPath( m_sObjectPath + STD_TO_OUSTR( ( *it )->getName( ) ) );
+                    rtl::OUString sPath( m_sObjectPath );
+                    if ( sPath[sPath.getLength( ) - 1] != '/' )
+                        sPath += "/";
+                    sPath += STD_TO_OUSTR( ( *it )->getName( ) );
+                    aUrl.setObjectPath( sPath );
                     uno::Reference< ucb::XContentIdentifier > xId = new ucbhelper::ContentIdentifier( aUrl.asString( ) );
                     uno::Reference< ucb::XContent > xContent = new Content( m_xSMgr, m_pProvider, xId, *it );
 
commit 62949c26ba68e2ea74b526a6115b63cd2b379c69
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Wed Jul 11 18:22:23 2012 +0200

    CMIS UCP: guess the parent URL using the current path if needed
    
    Change-Id: I5bc6e557dcdfd3a396b363325971344ad90fdd85

diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index f046462..9125691 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -894,6 +894,17 @@ namespace cmis
             aUrl.setObjectPath( STD_TO_OUSTR( parentPath ) );
             sRet = aUrl.asString( );
         }
+        else
+        {
+            INetURLObject aUrl( m_sURL );
+            if ( aUrl.getSegmentCount( ) > 0 )
+            {
+                URL aCmisUrl( m_sURL );
+                aUrl.removeSegment( );
+                aCmisUrl.setObjectPath( aUrl.GetURLPath( INetURLObject::NO_DECODE ) );
+                sRet = aCmisUrl.asString( );
+            }
+        }
 
         return sRet;
     }


More information about the Libreoffice-commits mailing list