summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2012-08-13 11:44:08 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-04-13 09:10:29 +0100
commit3c85fde4f96ae3ce550a4adb822f4a3c946c0178 (patch)
tree0c869d41e046970e2dee22672c3f547276d376bc /svtools
parentfbc42f30bc0fbca4d12f34059f2b2b821921d849 (diff)
Secure EmbeddedObjectRef::GetGraphic to react when something goes wrong
when trying to get the replacement graphic, better fallback to default ole replacement graphic (cherry picked from commit 9dc64b4255ed0f2eda0df3a3bbf59fa47202788c) Conflicts: svtools/source/misc/embedhlp.cxx Change-Id: I31db9bf954cfca8f9c10163b03346c2b796ee0c8
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/misc/embedhlp.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index e074a30424de..d4cbc53220d8 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -439,11 +439,18 @@ void EmbeddedObjectRef::GetReplacement( bool bUpdate )
const Graphic* EmbeddedObjectRef::GetGraphic( OUString* pMediaType ) const
{
- if ( mpImpl->bNeedUpdate )
- // bNeedUpdate will be set to false while retrieving new replacement
- const_cast < EmbeddedObjectRef* >(this)->GetReplacement( true );
- else if ( !mpImpl->pGraphic )
- const_cast < EmbeddedObjectRef* >(this)->GetReplacement( false );
+ try
+ {
+ if ( mpImpl->bNeedUpdate )
+ // bNeedUpdate will be set to false while retrieving new replacement
+ const_cast < EmbeddedObjectRef* >(this)->GetReplacement(true);
+ else if ( !mpImpl->pGraphic )
+ const_cast < EmbeddedObjectRef* >(this)->GetReplacement(false);
+ }
+ catch( const uno::Exception& ex )
+ {
+ SAL_WARN("svtools.misc", "Something went wrong on getting the graphic: " << ex.Message);
+ }
if ( mpImpl->pGraphic && pMediaType )
*pMediaType = mpImpl->aMediaType;