diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-17 16:10:42 +0100 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2017-11-28 00:13:28 -0500 |
commit | 0b50531a401f405edd9f1c889512171d3273169a (patch) | |
tree | e6fb25b34692c4450c2dc1fea13a557741564b12 /svtools | |
parent | 3f447f4a613dc692f4775b2d8988711213b01b42 (diff) |
move the exception handling
Change-Id: Ie61a424a78be85c1dc54dd56451319356227f443
(cherry picked from commit ce0e70fdd643b88b70cbcfa55847f0285116273a)
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/graphic/grfmgr.cxx | 59 |
1 files changed, 36 insertions, 23 deletions
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index a7c9278409d0..d50453192f8a 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -943,43 +943,56 @@ bool GraphicObject::SwapOut() bool GraphicObject::SwapOut( SvStream* pOStm ) { - bool bRet = !mbAutoSwapped; - // swap out as a link - if( pOStm == GRFMGR_AUTOSWAPSTREAM_LINK ) + bool bRet = false; + try { - maGraphic.SwapOutAsLink(); + bRet = !mbAutoSwapped; + // swap out as a link + if( pOStm == GRFMGR_AUTOSWAPSTREAM_LINK ) + { + maGraphic.SwapOutAsLink(); + } + else + { + bRet = bRet && maGraphic.SwapOut( pOStm ); + } + + if (bRet) + mpGlobalMgr->ImplGraphicObjectWasSwappedOut(*this); } - else + catch(...) { - bRet = bRet && maGraphic.SwapOut( pOStm ); + SAL_WARN( "svtools", "GraphicObject::SwapIn exception"); } - - if (bRet) - mpGlobalMgr->ImplGraphicObjectWasSwappedOut(*this); - return bRet; } bool GraphicObject::SwapIn() { bool bRet = false; - - if( mbAutoSwapped ) + try { - ImplAutoSwapIn(); - bRet = true; - } - else - { - bRet = maGraphic.SwapIn(); + if( mbAutoSwapped ) + { + ImplAutoSwapIn(); + bRet = true; + } + else + { + bRet = maGraphic.SwapIn(); - if (bRet) - mpGlobalMgr->ImplGraphicObjectWasSwappedIn(*this); - } + if (bRet) + mpGlobalMgr->ImplGraphicObjectWasSwappedIn(*this); + } - if( bRet ) + if( bRet ) + { + ImplAssignGraphicData(); + } + } + catch (...) { - ImplAssignGraphicData(); + SAL_WARN( "svtools", "GraphicObject::SwapIn exception"); } return bRet; |