diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-05-23 15:26:14 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-05-23 16:36:38 +0200 |
commit | 6a91ea82502c0b9e6632d625962bf9da006c4a2f (patch) | |
tree | c3696fcd29d3583ef5d718664cb2b8d6f1a8b5e9 /vcl/source | |
parent | f11cbcb60d546ce9c7a840a67458c5c88f8a8531 (diff) |
vcl GraphicFilter: add ImportGraphics()
This is similar to ImportGraphic(), but can handle multiple streams with
one function call.
Change-Id: I8d5dc8de64321c3c1fb9e1037527b411fd68dca8
Reviewed-on: https://gerrit.libreoffice.org/37953
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index d17f77027d32..da1396aa31f3 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1316,6 +1316,23 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat return ImportGraphic( rGraphic, rPath, rIStream, nFormat, pDeterminedFormat, nImportFlags, nullptr, pExtHeader ); } +void GraphicFilter::ImportGraphics(std::vector< std::shared_ptr<Graphic> >& rGraphics, const std::vector< std::shared_ptr<SvStream> >& rStreams) +{ + for (const auto& pStream : rStreams) + { + Graphic* pGraphic = nullptr; + + if (pStream) + { + auto pG = o3tl::make_unique<Graphic>(); + if (ImportGraphic(*pG, "", *pStream) == GRFILTER_OK) + pGraphic = pG.release(); + } + + rGraphics.push_back(std::shared_ptr<Graphic>(pGraphic)); + } +} + sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, SvStream& rIStream, sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, GraphicFilterImportFlags nImportFlags, css::uno::Sequence< css::beans::PropertyValue >* pFilterData, |