Kaydet (Commit) 9dc64b42 authored tarafından Armin Le Grand's avatar Armin Le Grand

Secure EmbeddedObjectRef::GetGraphic to react when something gets wrong when…

Secure EmbeddedObjectRef::GetGraphic to react when something gets wrong when trying to get the replacement graphic, better fallback to default ole replacement graphic
üst 0bbde441
......@@ -482,11 +482,18 @@ void EmbeddedObjectRef::GetReplacement( sal_Bool bUpdate )
Graphic* EmbeddedObjectRef::GetGraphic( ::rtl::OUString* pMediaType ) const
{
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() const
}
catch ( uno::Exception& )
{
OSL_ENSURE( sal_False, "Something went wrong on getting the high contrast graphic!" );
}
if ( xInStream.is() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment