Kaydet (Commit) e026cf6e authored tarafından Michael Stahl's avatar Michael Stahl

xmloff: fix crash on exporting non-loadable external image URL

As seen on exporting rhbz739243-1.odt, the xGraphic is null in that case.

(regression from 4469b29f)

Change-Id: I535d67eeddc1b9bdf2562fc3b54a97e38ab0354c
üst 01bca619
......@@ -3024,9 +3024,12 @@ static OUString getMimeType(const OUString& sImageUrl)
Reference< XGraphic > xGraphic( xProvider->queryGraphic( aMediaProperties ) );
OUString aSourceMimeType;
Reference< XPropertySet > xGraphicPropertySet( xGraphic, UNO_QUERY_THROW );
if ( xGraphicPropertySet->getPropertyValue( "MimeType" ) >>= aSourceMimeType )
Reference<XPropertySet> const xGraphicPropertySet(xGraphic, UNO_QUERY);
if (xGraphicPropertySet.is() && // it's null if it's an external link
(xGraphicPropertySet->getPropertyValue("MimeType") >>= aSourceMimeType))
{
return aSourceMimeType;
}
return OUString("");
}
......
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