diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-06-15 14:07:04 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-06-20 14:24:01 +0200 |
commit | 03f0ea92bc381ef5a8df7de1ae9edf4aed45a3b2 (patch) | |
tree | 5f2eea79b2db6582650a42e3af16d2e55fd3229c /include/vcl/pdfread.hxx | |
parent | bbc326841a833596c46b9b716fdf15d49c7578ee (diff) |
vcl: add PDFGraphicResult instead of std::pair in ImportPDFUnloaded
ImportPDFUnloaded returned graphics as a vector of std::pair with
Graphic and Size. Instead, use a new struct PDFGraphicResult, so
it can be extended in the future.
Change-Id: Idda00a3b98a8efcbd9b8c8d0ee3982becfdc1d7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96755
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/vcl/pdfread.hxx')
-rw-r--r-- | include/vcl/pdfread.hxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/vcl/pdfread.hxx b/include/vcl/pdfread.hxx index ba0eb1ca85be..a65d230279b9 100644 --- a/include/vcl/pdfread.hxx +++ b/include/vcl/pdfread.hxx @@ -13,13 +13,13 @@ #include <vector> #include <tools/gen.hxx> #include <tools/stream.hxx> +#include <vcl/graph.hxx> namespace com::sun::star::uno { template <typename> class Sequence; } class Bitmap; -class Graphic; namespace vcl { @@ -31,10 +31,24 @@ VCL_DLLPUBLIC size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vecto /// Imports a PDF stream into rGraphic as VectorGraphicData. VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Graphic& rGraphic); +struct PDFGraphicResult +{ + Graphic maGraphic; + + // Size in HMM + Size maSize; + + PDFGraphicResult(Graphic const& rGraphic, Size const& rSize) + : maGraphic(rGraphic) + , maSize(rSize) + { + } +}; + /// Import PDF as Graphic images (1 per page), but not loaded yet. /// Returns the number of pages read. VCL_DLLPUBLIC size_t ImportPDFUnloaded(const OUString& rURL, - std::vector<std::pair<Graphic, Size>>& rGraphics); + std::vector<PDFGraphicResult>& rGraphics); } #endif // INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX |