Kaydet (Commit) 4f5c523b authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

CMIS UCP: fixed Save As into a CMIS repo

Change-Id: I8ab65f917e9442f8871a39d7d25a63336065bee6
üst e5fdaa25
...@@ -271,20 +271,26 @@ namespace cmis ...@@ -271,20 +271,26 @@ namespace cmis
if ( rProp.Name == "IsDocument" ) if ( rProp.Name == "IsDocument" )
{ {
if ( getObject()->getBaseType( ) == "cmis:document" ) if ( getObject( ).get( ) )
xRow->appendBoolean( rProp, true ); xRow->appendBoolean( rProp, getObject()->getBaseType( ) == "cmis:document" );
else if ( m_pObjectType.get( ) )
xRow->appendBoolean( rProp, m_pObjectType->getBaseType()->getId( ) == "cmis:document" );
else else
xRow->appendVoid( rProp ); xRow->appendVoid( rProp );
} }
else if ( rProp.Name == "IsFolder" ) else if ( rProp.Name == "IsFolder" )
{ {
sal_Bool bFolder = getObject()->getBaseType( ) == "cmis:folder"; if ( getObject( ).get( ) )
xRow->appendBoolean( rProp, bFolder ); 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" ) else if ( rProp.Name == "Title" )
{ {
rtl::OUString sTitle; rtl::OUString sTitle;
if ( getObject() ) if ( getObject().get() )
sTitle = rtl::OUString::createFromAscii( getObject()->getName().c_str( ) ); sTitle = rtl::OUString::createFromAscii( getObject()->getName().c_str( ) );
else if ( m_pObjectProps.size() > 0 ) else if ( m_pObjectProps.size() > 0 )
{ {
...@@ -308,7 +314,7 @@ namespace cmis ...@@ -308,7 +314,7 @@ namespace cmis
// Get the last segment // Get the last segment
sal_Int32 nPos = sPath.lastIndexOf( '/' ); sal_Int32 nPos = sPath.lastIndexOf( '/' );
if ( nPos > 0 ) if ( nPos >= 0 )
sTitle = sPath.copy( nPos + 1 ); sTitle = sPath.copy( nPos + 1 );
} }
...@@ -320,13 +326,18 @@ namespace cmis ...@@ -320,13 +326,18 @@ namespace cmis
else if ( rProp.Name == "TitleOnServer" ) else if ( rProp.Name == "TitleOnServer" )
{ {
string path; string path;
vector< string > paths = getObject( )->getPaths( ); if ( getObject().get( ) )
if ( paths.size( ) > 0 ) {
path = paths.front( ); vector< string > paths = getObject( )->getPaths( );
else if ( paths.size( ) > 0 )
path = getObject()->getName( ); 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" ) else if ( rProp.Name == "IsReadOnly" )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment