summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-17 16:10:42 +0100
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-12-05 08:17:48 -0500
commit9493d3f11ba1f9e08e23ea7a1ffce1654dc264a9 (patch)
tree1fcb08be6c62792ce26092acd2c59bb674268acf /svtools
parent31997f54ed2652a5401f8c7e7026eb83316604e8 (diff)
move the exception handling
Change-Id: Ie61a424a78be85c1dc54dd56451319356227f443 (cherry picked from commit ce0e70fdd643b88b70cbcfa55847f0285116273a) (cherry picked from commit 0b50531a401f405edd9f1c889512171d3273169a)
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/graphic/grfmgr.cxx59
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;