Kaydet (Commit) 6fe84df4 authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

CMIS UCP: fixed save as which was broken by bad exceptions catching

Change-Id: I81bb45279b23d0c8d77f8e7aa366d038efa13d89
üst 64040dbb
......@@ -275,35 +275,49 @@ namespace cmis
pProps = rProperties.getConstArray();
for( sal_Int32 n = 0; n < nProps; ++n )
{
try
{
const beans::Property& rProp = pProps[ n ];
try
{
if ( rProp.Name == "IsDocument" )
{
if ( getObject( ).get( ) )
try
{
xRow->appendBoolean( rProp, getObject()->getBaseType( ) == "cmis:document" );
else if ( m_pObjectType.get( ) )
}
catch ( const libcmis::Exception& )
{
if ( m_pObjectType.get( ) )
xRow->appendBoolean( rProp, m_pObjectType->getBaseType()->getId( ) == "cmis:document" );
else
xRow->appendVoid( rProp );
}
}
else if ( rProp.Name == "IsFolder" )
{
if ( getObject( ).get( ) )
try
{
xRow->appendBoolean( rProp, getObject()->getBaseType( ) == "cmis:folder" );
else if ( m_pObjectType.get( ) )
}
catch ( const libcmis::Exception& )
{
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().get() )
try
{
sTitle = STD_TO_OUSTR( getObject()->getName() );
else if ( m_pObjectProps.size() > 0 )
}
catch ( const libcmis::Exception& )
{
if ( m_pObjectProps.size() > 0 )
{
map< string, libcmis::PropertyPtr >::iterator it = m_pObjectProps.find( "cmis:name" );
if ( it != m_pObjectProps.end( ) )
......@@ -313,6 +327,7 @@ namespace cmis
sTitle = STD_TO_OUSTR( values.front( ) );
}
}
}
// Nothing worked... get it from the path
if ( sTitle.isEmpty( ) )
......@@ -337,7 +352,7 @@ namespace cmis
else if ( rProp.Name == "TitleOnServer" )
{
string path;
if ( getObject().get( ) )
try
{
vector< string > paths = getObject( )->getPaths( );
if ( paths.size( ) > 0 )
......@@ -347,9 +362,11 @@ namespace cmis
xRow->appendString( rProp, STD_TO_OUSTR( path ) );
}
else
catch ( const libcmis::Exception& )
{
xRow->appendVoid( rProp );
}
}
else if ( rProp.Name == "IsReadOnly" )
{
boost::shared_ptr< libcmis::AllowableActions > allowableActions = getObject()->getAllowableActions( );
......@@ -370,6 +387,8 @@ namespace cmis
xRow->appendTimestamp( rProp, aTime );
}
else if ( rProp.Name == "Size" )
{
try
{
libcmis::Document* document = dynamic_cast< libcmis::Document* >( getObject().get( ) );
if ( NULL != document )
......@@ -377,6 +396,11 @@ namespace cmis
else
xRow->appendVoid( rProp );
}
catch ( const libcmis::Exception& )
{
xRow->appendVoid( rProp );
}
}
else if ( rProp.Name == "CreatableContentsInfo" )
{
xRow->appendObject( rProp, uno::makeAny( queryCreatableContentsInfo( xEnv ) ) );
......@@ -386,11 +410,7 @@ namespace cmis
}
catch ( const libcmis::Exception& e )
{
ucbhelper::cancelCommandExecution(
ucb::IOErrorCode_GENERAL,
uno::Sequence< uno::Any >( 0 ),
xEnv,
rtl::OUString::createFromAscii( e.what() ) );
xRow->appendVoid( rProp );
}
}
......
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