diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-02-06 11:15:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-06 11:57:49 +0000 |
commit | 90f4e15a2c7d7d9120e300032d7aa1cab227d7be (patch) | |
tree | a0f0253181cb4201e29c2966e551a3a5cab7b01a /sc | |
parent | e31ce570aaea6eebfc7040e5d406bc4c43cb55c1 (diff) |
coverity#1038441 Uncaught exception
Change-Id: I4257734fbff8e54c9f69bc9ec7fbc63fb6c4fa17
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/unoobj/drdefuno.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sc/source/ui/unoobj/drdefuno.cxx b/sc/source/ui/unoobj/drdefuno.cxx index 5a969871aae2..d97cf37ca3ec 100644 --- a/sc/source/ui/unoobj/drdefuno.cxx +++ b/sc/source/ui/unoobj/drdefuno.cxx @@ -53,14 +53,22 @@ void ScDrawDefaultsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) SfxItemPool* ScDrawDefaultsObj::getModelPool( sal_Bool bReadOnly ) throw() { SfxItemPool* pRet = NULL; - if ( pDocShell ) + + try + { + if ( pDocShell ) + { + ScDrawLayer* pModel = bReadOnly ? + pDocShell->GetDocument()->GetDrawLayer() : + pDocShell->MakeDrawLayer(); + if ( pModel ) + pRet = &pModel->GetItemPool(); + } + } + catch (...) { - ScDrawLayer* pModel = bReadOnly ? - pDocShell->GetDocument()->GetDrawLayer() : - pDocShell->MakeDrawLayer(); - if ( pModel ) - pRet = &pModel->GetItemPool(); } + if ( !pRet ) pRet = SvxUnoDrawPool::getModelPool( bReadOnly ); // uses default pool |