diff options
author | Michael Stahl <mstahl@redhat.com> | 2011-10-18 10:47:59 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-10-18 11:01:28 +0200 |
commit | 32d1dbdfadd0f3a3c71531c6f816568e7bd5d069 (patch) | |
tree | 65aa28e87ea3258213437ee2d658a0587cc9f277 /sfx2 | |
parent | 228051c11a5757507656460f7d28852aa9b5b540 (diff) |
CMIS: Fixed the smoketests failure by catching some exceptions
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index c335aea69ad4..cbd04f2f9eec 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3771,23 +3771,30 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium(); if ( pMedium ) { - ::ucbhelper::Content aContent( pMedium->GetName(), com::sun::star::uno::Reference < ucb::XCommandEnvironment >() ); - com::sun::star::uno::Reference < beans::XPropertySetInfo > xProps = aContent.getProperties(); - if ( xProps.is() ) - { - ::rtl::OUString aServerTitle( RTL_CONSTASCII_USTRINGPARAM("TitleOnServer") ); - if ( xProps->hasPropertyByName( aServerTitle ) ) + try { + ::ucbhelper::Content aContent( pMedium->GetName(), + uno::Reference<ucb::XCommandEnvironment>() ); + const uno::Reference < beans::XPropertySetInfo > xProps + = aContent.getProperties(); + if ( xProps.is() ) { - uno::Any aAny = aContent.getPropertyValue( aServerTitle ); - aAny >>= aResult; + ::rtl::OUString aServerTitle( RTL_CONSTASCII_USTRINGPARAM("TitleOnServer") ); + if ( xProps->hasPropertyByName( aServerTitle ) ) + { + uno::Any aAny = aContent.getPropertyValue( aServerTitle ); + aAny >>= aResult; + } } } - else + catch (ucb::ContentCreationException &) + { + } + catch (ucb::CommandAbortedException &) { - SFX_ITEMSET_ARG( pMedium->GetItemSet(), pRepairedDocItem, SfxBoolItem, SID_REPAIRPACKAGE, sal_False ); - if ( pRepairedDocItem && pRepairedDocItem->GetValue() ) - aResult += String( SfxResId(STR_REPAIREDDOCUMENT) ); } + SFX_ITEMSET_ARG( pMedium->GetItemSet(), pRepairedDocItem, SfxBoolItem, SID_REPAIRPACKAGE, sal_False ); + if ( pRepairedDocItem && pRepairedDocItem->GetValue() ) + aResult += String( SfxResId(STR_REPAIREDDOCUMENT) ); } if ( m_pData->m_pObjectShell->IsReadOnlyUI() || (pMedium && pMedium->IsReadOnly()) ) |