diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-02-17 08:34:48 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-02-18 08:56:07 +0100 |
commit | 233a6332500a30ba4bd44d09635ac7cbfe91beb7 (patch) | |
tree | 206864dc1795247a448798d3138311132a2ec94f /xmloff | |
parent | 7b1b7928d80efa3c6a99d6ce142fd679d6077d5f (diff) |
GetEmbeddedXGraphicStream to read XGraphic as stream
This is an alternative to GetEmbeddedGraphicObjectStream which
uses URL as parameter and will be removed soon.
Change-Id: I3c7431bdeed0bd4ed3c7f48517a52846d0944ed2
Reviewed-on: https://gerrit.libreoffice.org/49893
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 7f5df92e5875..4d3533ae4c09 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1926,6 +1926,23 @@ Reference< XInputStream > SvXMLExport::GetEmbeddedGraphicObjectStream( const OUS return nullptr; } +uno::Reference<io::XInputStream> SvXMLExport::GetEmbeddedXGraphicStream(uno::Reference<graphic::XGraphic> const & rxGraphic) +{ + uno::Reference<io::XInputStream> xInputStream; + + if ((getExportFlags() & SvXMLExportFlags::EMBEDDED) && mxGraphicResolver.is()) + { + uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler(mxGraphicResolver, uno::UNO_QUERY); + + if (xGraphicStorageHandler.is()) + { + xInputStream = xGraphicStorageHandler->createInputStream(rxGraphic); + } + } + + return xInputStream; +} + bool SvXMLExport::AddEmbeddedXGraphicAsBase64(uno::Reference<graphic::XGraphic> const & rxGraphic) { if ((getExportFlags() & SvXMLExportFlags::EMBEDDED) && |