[Libreoffice-commits] core.git: oox/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Wed Mar 7 13:52:12 UTC 2018


 oox/source/drawingml/misccontexts.cxx |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 1a508b2670a3db135d5937dcafec7eb62feb7033
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Wed Mar 7 16:43:24 2018 +0900

    oox: use GraphicLoader to load from external URL
    
    Change-Id: Iff267f53ccc33105ff35149b1fde688616ad0b4f
    Reviewed-on: https://gerrit.libreoffice.org/50870
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

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();
     }
 }
 


More information about the Libreoffice-commits mailing list