[Libreoffice-commits] .: ucb/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Thu Jun 14 01:09:28 PDT 2012


 ucb/source/ucp/cmis/cmis_content.cxx |   35 +++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)

New commits:
commit 4f5c523b97542bdbfe69fb7695bcb9699c66f89f
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Tue Jun 5 13:00:06 2012 +0200

    CMIS UCP: fixed Save As into a CMIS repo
    
    Change-Id: I8ab65f917e9442f8871a39d7d25a63336065bee6

diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index b25e1ac..9159c64 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -271,20 +271,26 @@ namespace cmis
 
             if ( rProp.Name == "IsDocument" )
             {
-                if ( getObject()->getBaseType( ) == "cmis:document" )
-                    xRow->appendBoolean( rProp, true );
+                if ( getObject( ).get( ) )
+                    xRow->appendBoolean( rProp, getObject()->getBaseType( ) == "cmis:document" );
+                else if ( m_pObjectType.get( ) )
+                    xRow->appendBoolean( rProp, m_pObjectType->getBaseType()->getId( ) == "cmis:document" );
                 else
                     xRow->appendVoid( rProp );
             }
             else if ( rProp.Name == "IsFolder" )
             {
-                sal_Bool bFolder = getObject()->getBaseType( ) == "cmis:folder";
-                xRow->appendBoolean( rProp, bFolder );
+                if ( getObject( ).get( ) )
+                    xRow->appendBoolean( rProp, getObject()->getBaseType( ) == "cmis:folder" );
+                else if ( m_pObjectType.get( ) )
+                    xRow->appendBoolean( rProp, m_pObjectType->getBaseType()->getId( ) == "cmis:folder" );
+                else
+                    xRow->appendVoid( rProp );
             }
             else if ( rProp.Name == "Title" )
             {
                 rtl::OUString sTitle;
-                if ( getObject() )
+                if ( getObject().get() )
                     sTitle = rtl::OUString::createFromAscii( getObject()->getName().c_str( ) );
                 else if ( m_pObjectProps.size() > 0 )
                 {
@@ -308,7 +314,7 @@ namespace cmis
 
                     // Get the last segment
                     sal_Int32 nPos = sPath.lastIndexOf( '/' );
-                    if ( nPos > 0 )
+                    if ( nPos >= 0 )
                         sTitle = sPath.copy( nPos + 1 );
                 }
 
@@ -320,13 +326,18 @@ namespace cmis
             else if ( rProp.Name == "TitleOnServer" )
             {
                 string path;
-                vector< string > paths = getObject( )->getPaths( );
-                if ( paths.size( ) > 0 )
-                    path = paths.front( );
-                else
-                    path = getObject()->getName( );
+                if ( getObject().get( ) )
+                {
+                    vector< string > paths = getObject( )->getPaths( );
+                    if ( paths.size( ) > 0 )
+                        path = paths.front( );
+                    else
+                        path = getObject()->getName( );
 
-                xRow->appendString( rProp, rtl::OUString::createFromAscii( path.c_str() ) );
+                    xRow->appendString( rProp, rtl::OUString::createFromAscii( path.c_str() ) );
+                }
+                else
+                    xRow->appendVoid( rProp );
             }
             else if ( rProp.Name == "IsReadOnly" )
             {


More information about the Libreoffice-commits mailing list