summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-17 16:10:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-04-17 19:07:10 +0100
commitce0e70fdd643b88b70cbcfa55847f0285116273a (patch)
tree8c84088a386be87d6dc7bd5fa09f3ed098afafd3 /svtools
parentd20da7bd658e1ebaff74658334cbd5d633df7f3b (diff)
move the exception handling
Change-Id: Ie61a424a78be85c1dc54dd56451319356227f443
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 07ec46fc0b5d..c271fd4d5720 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;