You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2012/08/13 14:44:08 UTC

svn commit: r1372401 - /incubator/ooo/trunk/main/svtools/source/misc/embedhlp.cxx

Author: alg
Date: Mon Aug 13 12:44:08 2012
New Revision: 1372401

URL: http://svn.apache.org/viewvc?rev=1372401&view=rev
Log:
Secure EmbeddedObjectRef::GetGraphic to react when something gets wrong when trying to get the replacement graphic, better fallback to default ole replacement graphic

Modified:
    incubator/ooo/trunk/main/svtools/source/misc/embedhlp.cxx

Modified: incubator/ooo/trunk/main/svtools/source/misc/embedhlp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/source/misc/embedhlp.cxx?rev=1372401&r1=1372400&r2=1372401&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svtools/source/misc/embedhlp.cxx (original)
+++ incubator/ooo/trunk/main/svtools/source/misc/embedhlp.cxx Mon Aug 13 12:44:08 2012
@@ -482,11 +482,18 @@ void EmbeddedObjectRef::GetReplacement( 
 
 Graphic* EmbeddedObjectRef::GetGraphic( ::rtl::OUString* pMediaType ) const
 {
-    if ( mpImp->bNeedUpdate )
-        // bNeedUpdate will be set to false while retrieving new replacement
-        const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_True );
-    else if ( !mpImp->pGraphic )
-        const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_False );
+    try
+    {
+        if ( mpImp->bNeedUpdate )
+            // bNeedUpdate will be set to false while retrieving new replacement
+            const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_True );
+        else if ( !mpImp->pGraphic )
+            const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_False );
+    }
+	catch( uno::Exception& )
+	{
+		OSL_ENSURE( sal_False, "Something went wrong on getting the graphic!" );
+	}
 
     if ( mpImp->pGraphic && pMediaType )
         *pMediaType = mpImp->aMediaType;
@@ -589,6 +596,7 @@ Graphic* EmbeddedObjectRef::GetHCGraphic
 		}
 		catch ( uno::Exception& )
 		{
+    		OSL_ENSURE( sal_False, "Something went wrong on getting the high contrast graphic!" );
 		}
 
 		if ( xInStream.is() )