diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-06-05 13:00:06 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-06-27 10:15:22 +0200 |
commit | 056d7ff48c5485bce52063a0a7ade1fb9e6938b7 (patch) | |
tree | 0f518c9b8ea843ad22326e5151aa85aad68e0fb8 /ucb | |
parent | eee54a502d5279fe1f4e38a384e7182e88d34f34 (diff) |
CMIS UCP: fixed Save As into a CMIS repo
Change-Id: I8ab65f917e9442f8871a39d7d25a63336065bee6
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index b25e1acf5ecc..9159c64ff670 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" ) { |