summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-04-13 18:09:32 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-04-14 10:24:05 +0200
commit9697c0275a4c36117a95ccb702c16b3ff7716cfd (patch)
treec5b614bc5ec92698c4aa2321ff99d6bb26f09e10 /include
parent5387e8c8dc2484a6a30f0792e168c7621d1a5d50 (diff)
vcl PDF import: don't assume larger offset -> newer trailer
Usually when the PDF file contains incremental updates the updates are appended at the end of the document. But this is not required, the various trailers can be in any order. Make sure that we look at the last trailer (logically last, not the one with the largest file offset) when looking for pages. Reviewed-on: https://gerrit.libreoffice.org/36527 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit f15a69bd57e578ca607f14cb62f29a16986b96e6) Conflicts: xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx Change-Id: Idcd85a7c6bbf08c9436dd73933d79cdb683f482c
Diffstat (limited to 'include')
-rw-r--r--include/vcl/filter/pdfdocument.hxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/vcl/filter/pdfdocument.hxx b/include/vcl/filter/pdfdocument.hxx
index d83cb8308f11..5011504f13df 100644
--- a/include/vcl/filter/pdfdocument.hxx
+++ b/include/vcl/filter/pdfdocument.hxx
@@ -308,6 +308,10 @@ class VCL_DLLPUBLIC PDFDocument
std::map<size_t, PDFObjectElement*> m_aIDObjects;
/// List of xref offsets we know.
std::vector<size_t> m_aStartXRefs;
+ /// Offsets of trailers, from latest to oldest.
+ std::vector<size_t> m_aTrailerOffsets;
+ /// Trailer offset <-> Trailer pointer map.
+ std::map<size_t, PDFTrailerElement*> m_aOffsetTrailers;
/// List of EOF offsets we know.
std::vector<size_t> m_aEOFs;
PDFTrailerElement* m_pTrailer;