[Libreoffice-commits] core.git: Branch 'feature/cmis' - comphelper/source sfx2/source ucb/source

Cao Cuong Ngo cao.cuong.ngo at gmail.com
Sun Sep 22 12:07:55 PDT 2013


 comphelper/source/misc/mediadescriptor.cxx |    3 +--
 sfx2/source/doc/docfile.cxx                |    5 +++--
 ucb/source/ucp/cmis/cmis_content.cxx       |   14 ++++++++------
 ucb/source/ucp/cmis/cmis_url.cxx           |    3 +--
 4 files changed, 13 insertions(+), 12 deletions(-)

New commits:
commit bae3c4fc5c82496561d2b156765ebf2257973437
Author: Cao Cuong Ngo <cao.cuong.ngo at gmail.com>
Date:   Sat Sep 21 23:36:06 2013 +0200

    CMIS file picker: it really does not like ID Mark
    
    The file picker can't go back folder if we use
    ID mark in the URL.
    
    Change-Id: I6985feec71dc23848ee022e0bab9e8515a21ffd2

diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx
index 21102f2..5ac52ca 100644
--- a/comphelper/source/misc/mediadescriptor.cxx
+++ b/comphelper/source/misc/mediadescriptor.cxx
@@ -470,8 +470,7 @@ sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool bLockFile )
                     css::uno::Reference< css::uno::XInterface >());
 
         // Parse URL! Only the main part has to be used further. E.g. a jumpmark can make trouble
-        // We need to keep the full URL with Mark to store the Object ID
-        // in CMIS UCB
+        OUString sNormalizedURL = impl_normalizeURL( sURL );
         return impl_openStreamWithURL( sURL, bLockFile );
     }
 #if OSL_DEBUG_LEVEL > 0
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index ebd03ea..c59675f 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2492,7 +2492,7 @@ void SfxMedium::Init_Impl()
         {
             if ( aUrl.HasMark() )
             {
-                // keep the Mark to store the Document ID
+                pImp->m_aLogicName = aUrl.GetURLNoMark( INetURLObject::NO_DECODE );
                 GetItemSet()->Put( SfxStringItem( SID_JUMPMARK, aUrl.GetMark() ) );
             }
 
@@ -3007,7 +3007,8 @@ const INetURLObject& SfxMedium::GetURLObject() const
     if (!pImp->m_pURLObj)
     {
         pImp->m_pURLObj = new INetURLObject( pImp->m_aLogicName );
-        // keep the Mark to store the Document ID
+        if (pImp->m_pURLObj->HasMark())
+            *pImp->m_pURLObj = INetURLObject( pImp->m_aLogicName ).GetURLNoMark();
     }
 
     return *pImp->m_pURLObj;
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 76d23b9..685cd4b 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -1222,8 +1222,6 @@ namespace cmis
                     m_pObjectType.reset( );
                     m_pObjectProps.clear( );
                     m_bTransient = false;
-                    uno::Reference< ucb::XContentIdentifier > xId(new ::ucbhelper::ContentIdentifier(m_sURL));
-                    m_xIdentifier = xId;
                     inserted();
                 }
             }
@@ -1501,10 +1499,14 @@ namespace cmis
             return parentUrl;
         else
         {
-            INetURLObject aParentUrl( m_sURL );
-            string sName = OUSTR_TO_STDSTR( aParentUrl.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ) );
-            aParentUrl.removeSegment( );
-            return aParentUrl.GetMainURL( INetURLObject::NO_DECODE );
+            INetURLObject aUrl( m_sURL );
+            if ( aUrl.getSegmentCount( ) > 0 )
+            {
+                URL aCmisUrl( m_sURL );
+                aUrl.removeSegment( );
+                aCmisUrl.setObjectPath( aUrl.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ) );
+                parentUrl = aCmisUrl.asString( );
+            }
         }
 
         return parentUrl;
diff --git a/ucb/source/ucp/cmis/cmis_url.cxx b/ucb/source/ucp/cmis/cmis_url.cxx
index 2468066..a30aeff 100644
--- a/ucb/source/ucp/cmis/cmis_url.cxx
+++ b/ucb/source/ucp/cmis/cmis_url.cxx
@@ -105,8 +105,7 @@ namespace cmis
             }
             while ( nPos != -1 );
             sUrl += sEncodedPath;
-        }
-        if ( !m_sId.isEmpty( ) )
+        } else if ( !m_sId.isEmpty( ) )
         {
             sUrl += "#" + rtl::Uri::encode( m_sId,
                 rtl_UriCharClassRelSegment,


More information about the Libreoffice-commits mailing list