summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-06-28 17:25:31 +0200
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-06-28 17:27:39 +0200
commit2009ee83ba068ec45654a4c8e4efa6c18a543a76 (patch)
tree5c6d4b6294bf39a4d892d9a57103deac4a688764 /ucb
parentdb21b52e446d43624a9ee829300b42f6906999a8 (diff)
CMIS UCP: fixed save as which was broken by bad exceptions catching
Change-Id: I81bb45279b23d0c8d77f8e7aa366d038efa13d89
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/cmis/cmis_content.cxx80
1 files changed, 50 insertions, 30 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index f4f73e59158c..6c4152149abb 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -276,41 +276,56 @@ namespace cmis
for( sal_Int32 n = 0; n < nProps; ++n )
{
+ const beans::Property& rProp = pProps[ n ];
+
try
{
- const beans::Property& rProp = pProps[ n ];
-
if ( rProp.Name == "IsDocument" )
{
- if ( getObject( ).get( ) )
+ try
+ {
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 );
+ }
+ 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( ) )
- xRow->appendBoolean( rProp, m_pObjectType->getBaseType()->getId( ) == "cmis:folder" );
- else
- xRow->appendVoid( rProp );
+ }
+ 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& )
{
- map< string, libcmis::PropertyPtr >::iterator it = m_pObjectProps.find( "cmis:name" );
- if ( it != m_pObjectProps.end( ) )
+ if ( m_pObjectProps.size() > 0 )
{
- vector< string > values = it->second->getStrings( );
- if ( values.size() > 0 )
- sTitle = STD_TO_OUSTR( values.front( ) );
+ map< string, libcmis::PropertyPtr >::iterator it = m_pObjectProps.find( "cmis:name" );
+ if ( it != m_pObjectProps.end( ) )
+ {
+ vector< string > values = it->second->getStrings( );
+ if ( values.size() > 0 )
+ sTitle = STD_TO_OUSTR( values.front( ) );
+ }
}
}
@@ -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,8 +362,10 @@ namespace cmis
xRow->appendString( rProp, STD_TO_OUSTR( path ) );
}
- else
+ catch ( const libcmis::Exception& )
+ {
xRow->appendVoid( rProp );
+ }
}
else if ( rProp.Name == "IsReadOnly" )
{
@@ -371,11 +388,18 @@ namespace cmis
}
else if ( rProp.Name == "Size" )
{
- libcmis::Document* document = dynamic_cast< libcmis::Document* >( getObject().get( ) );
- if ( NULL != document )
- xRow->appendLong( rProp, document->getContentLength() );
- else
+ try
+ {
+ libcmis::Document* document = dynamic_cast< libcmis::Document* >( getObject().get( ) );
+ if ( NULL != document )
+ xRow->appendLong( rProp, document->getContentLength() );
+ else
+ xRow->appendVoid( rProp );
+ }
+ catch ( const libcmis::Exception& )
+ {
xRow->appendVoid( rProp );
+ }
}
else if ( rProp.Name == "CreatableContentsInfo" )
{
@@ -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 );
}
}