diff options
author | Chr. Rossmanith <ChrRossmanith@gmx.de> | 2014-06-03 22:33:25 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-06-06 11:13:07 +0200 |
commit | 8b46d5c849a24e67fb2807a80164caf9001d9544 (patch) | |
tree | 50c98b15074dfdfd65e7ce225315f46348f07ffb /sw | |
parent | 44f422048754c5fe3540750eec996c8a63bf6da4 (diff) |
new method INetURLObject::getData() for data urls
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Conflicts:
tools/source/fsys/urlobj.cxx
Change-Id: I59b5b95cf9b65920ec04922fdb25e4228fd22995
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 30d9dd18164b..18cdf936e5cf 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -67,8 +67,8 @@ #include <numrule.hxx> #include <boost/shared_ptr.hpp> -#include <sax/tools/converter.hxx> #include <vcl/graphicfilter.hxx> +#include <tools/urlobj.hxx> using namespace ::com::sun::star; @@ -695,16 +695,18 @@ IMAGE_SETEVENT: aFrmSet.Put( aFrmSize ); Graphic aEmptyGrf; - if( sGrfNm.startsWith("data:") ) + INetURLObject aGraphicURL( sGrfNm ); + if( aGraphicURL.GetProtocol() == INET_PROT_DATA ) { - // use embedded base64 encoded data - ::com::sun::star::uno::Sequence< sal_Int8 > aPass; - OUString sBase64Data = sGrfNm.replaceAt(0,22,""); - ::sax::Converter::decodeBase64(aPass, sBase64Data); - if( aPass.hasElements() ) + SvMemoryStream* aStream = aGraphicURL.getData(); + if( aStream ) { - SvMemoryStream aStream(aPass.getArray(), aPass.getLength(), STREAM_READ); - GraphicFilter::GetGraphicFilter().ImportGraphic( aEmptyGrf, OUString(), aStream ); + GraphicFilter::GetGraphicFilter().ImportGraphic( aEmptyGrf, OUString(), *aStream ); + free( aStream ); + } + else + { + aEmptyGrf.SetDefaultType(); } } else |