diff options
author | sjacobi <Sven-Jacobi@gmx.de> | 2013-04-19 00:26:48 +0200 |
---|---|---|
committer | sjacobi <Sven-Jacobi@gmx.de> | 2013-04-19 00:28:52 +0200 |
commit | 4ec1ddec3e8b3b22741504b0eca7b74c3377bf49 (patch) | |
tree | c1c7ec6f2a060b3a74c8bc0c3e0c03d4d4461b32 /oox | |
parent | d4324078c4a446c6d4633237e7bf44e9dbd7d5cb (diff) |
oox import, added support for linked graphics (at least they are embedded now
Change-Id: I7fc8dcc989eb37d3a337f06137bb7361cce797d3
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/fillpropertiesgroupcontext.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx index beca78f30658..7e004eb8d1d8 100644 --- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx +++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx @@ -23,6 +23,7 @@ #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/fillproperties.hxx" +#include <sfx2/docfile.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -166,9 +167,17 @@ BlipContext::BlipContext( ContextHandler& rParent, else if( aAttribs.hasAttribute( R_TOKEN( link ) ) ) { // external URL - // OUString aRelId = aAttribs.getString( R_TOKEN( link ), OUString() ); - // OUString aTargetLink = getFilter().getAbsoluteUrl( getRelations().getExternalTargetFromRelId( aRelId ) ); - // TODO: load external picture + + // we will embed this link, this is better than just doing nothing.. + // TODO: import this graphic as real link, but this requires some + // code rework. + OUString aRelId = aAttribs.getString( R_TOKEN( link ), OUString() ); + OUString aTargetLink = getFilter().getAbsoluteUrl( getRelations().getExternalTargetFromRelId( aRelId ) ); + SfxMedium xMed( aTargetLink, STREAM_STD_READ ); + xMed.DownLoad(); + Reference< io::XInputStream > xInStrm = xMed.GetInputStream(); + if ( xInStrm.is() ) + mrBlipProps.mxGraphic = getFilter().getGraphicHelper().importGraphic( xInStrm ); } } |