Kaydet (Commit) 1a508b26 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

oox: use GraphicLoader to load from external URL

Change-Id: Iff267f53ccc33105ff35149b1fde688616ad0b4f
Reviewed-on: https://gerrit.libreoffice.org/50870Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 87dd0866
......@@ -26,6 +26,7 @@
#include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx>
#include <sfx2/docfile.hxx>
#include <vcl/GraphicLoader.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
......@@ -160,11 +161,8 @@ BlipContext::BlipContext( ContextHandler2Helper const & rParent,
// code rework.
OUString aRelId = rAttribs.getString( R_TOKEN( link ), OUString() );
OUString aTargetLink = getFilter().getAbsoluteUrl( getRelations().getExternalTargetFromRelId( aRelId ) );
SfxMedium aMed( aTargetLink, StreamMode::STD_READ );
aMed.Download();
Reference< io::XInputStream > xInStrm = aMed.GetInputStream();
if ( xInStrm.is() )
mrBlipProps.mxFillGraphic = getFilter().getGraphicHelper().importGraphic( xInStrm );
Graphic aGraphic = vcl::graphic::loadFromURL(aTargetLink);
mrBlipProps.mxFillGraphic = aGraphic.GetXGraphic();
}
}
......
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