diff options
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 2a7e4c58a290..ef40d7335b32 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -757,52 +757,59 @@ namespace } #endif - Reference< XLibraryContainer > SfxObjectShell::GetDialogContainer() { #ifndef DISABLE_SCRIPTING - if ( !pImp->m_bNoBasicCapabilities ) - return lcl_getOrCreateLibraryContainer( false, pImp->xDialogLibraries, GetModel() ); + try + { + if ( !pImp->m_bNoBasicCapabilities ) + return lcl_getOrCreateLibraryContainer( false, pImp->xDialogLibraries, GetModel() ); - BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this ); - if ( pBasMgr ) - return pBasMgr->GetDialogLibraryContainer().get(); + BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this ); + if ( pBasMgr ) + return pBasMgr->GetDialogLibraryContainer().get(); + } + catch (const css::ucb::ContentCreationException& e) + { + SAL_WARN("sfx.doc", "caught exception " << e.Message); + } - OSL_FAIL( "SfxObjectShell::GetDialogContainer: falling back to the application - is this really expected here?" ); + SAL_WARN("sfx.doc", "SfxObjectShell::GetDialogContainer: falling back to the application - is this really expected here?"); #endif return SFX_APP()->GetDialogContainer(); } - - Reference< XLibraryContainer > SfxObjectShell::GetBasicContainer() { #ifndef DISABLE_SCRIPTING - if ( !pImp->m_bNoBasicCapabilities ) - return lcl_getOrCreateLibraryContainer( true, pImp->xBasicLibraries, GetModel() ); - - BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this ); - if ( pBasMgr ) - return pBasMgr->GetScriptLibraryContainer().get(); + try + { + if ( !pImp->m_bNoBasicCapabilities ) + return lcl_getOrCreateLibraryContainer( true, pImp->xBasicLibraries, GetModel() ); - OSL_FAIL( "SfxObjectShell::GetBasicContainer: falling back to the application - is this really expected here?" ); + BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this ); + if ( pBasMgr ) + return pBasMgr->GetScriptLibraryContainer().get(); + } + catch (const css::ucb::ContentCreationException& e) + { + SAL_WARN("sfx.doc", "caught exception " << e.Message); + } + SAL_WARN("sfx.doc", "SfxObjectShell::GetBasicContainer: falling back to the application - is this really expected here?"); #endif return SFX_APP()->GetBasicContainer(); } - - StarBASIC* SfxObjectShell::GetBasic() const { #ifdef DISABLE_SCRIPTING return NULL; #else - return GetBasicManager()->GetLib(0); + BasicManager * pMan = GetBasicManager(); + return pMan ? pMan->GetLib(0) : NULL; #endif } - - void SfxObjectShell::InitBasicManager_Impl() /* [Description] |