summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-06-10 09:46:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-06-10 10:48:41 +0100
commitfea4482ea8bfcb79c2ad83c5402ee84c4d9c3580 (patch)
treefdb4890bb1757f8e21227294e3c0407d64da2d84 /sfx2
parentac4d9437b317def515c5d7493d294f47d4102d93 (diff)
coverity#706615 Uncaught exception
and hopefully a boat load more Change-Id: I31cd4e530bd38dda845478a36d8216b7b3f9d7fd
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objxtor.cxx49
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]