diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-03-07 16:43:24 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-03-07 14:51:47 +0100 |
commit | 1a508b2670a3db135d5937dcafec7eb62feb7033 (patch) | |
tree | 246328cb62505198d295a8e11b366b67ee5e3c32 /oox | |
parent | 87dd08660836bfe38d4ec309363d897210f4afb8 (diff) |
oox: use GraphicLoader to load from external URL
Change-Id: Iff267f53ccc33105ff35149b1fde688616ad0b4f
Reviewed-on: https://gerrit.libreoffice.org/50870
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/misccontexts.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/oox/source/drawingml/misccontexts.cxx b/oox/source/drawingml/misccontexts.cxx index a3ab1140a804..583c9d7c35d6 100644 --- a/oox/source/drawingml/misccontexts.cxx +++ b/oox/source/drawingml/misccontexts.cxx @@ -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(); } } |