[Libreoffice-commits] core.git: svtools/source
Armin Le Grand
alg at apache.org
Sat Apr 13 01:11:57 PDT 2013
svtools/source/misc/embedhlp.cxx | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
New commits:
commit 3c85fde4f96ae3ce550a4adb822f4a3c946c0178
Author: Armin Le Grand <alg at apache.org>
Date: Mon Aug 13 11:44:08 2012 +0000
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
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index e074a30..d4cbc53 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;
More information about the Libreoffice-commits
mailing list