From 64bac5c0f005afd46bbf402c5d548e2ee6c9e5c4 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 27 Feb 2017 14:29:03 +0100 Subject: tdf#105093 vcl PDF export: add embedded video testcase Fails with commit 4ad249af88d15f2c8a09f0721a59d82718fcc201 (tdf#105093 sd PDF export: handle embedded videos, 2017-01-04) reverted. Change-Id: I413ec9a5da3c0783541dcd28fb9a62dd896f955b Reviewed-on: https://gerrit.libreoffice.org/34681 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- include/xmlsecurity/pdfio/pdfdocument.hxx | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'include') diff --git a/include/xmlsecurity/pdfio/pdfdocument.hxx b/include/xmlsecurity/pdfio/pdfdocument.hxx index 5a8ea6c2c71d..5f64b650ed17 100644 --- a/include/xmlsecurity/pdfio/pdfdocument.hxx +++ b/include/xmlsecurity/pdfio/pdfdocument.hxx @@ -90,6 +90,37 @@ public: void SetStreamBuffer(std::unique_ptr& pStreamBuffer); }; +/// Array object: a list. +class XMLSECURITY_DLLPUBLIC PDFArrayElement : public PDFElement +{ + /// Location after the '[' token. + sal_uInt64 m_nOffset = 0; + std::vector m_aElements; +public: + PDFArrayElement(); + bool Read(SvStream& rStream) override; + void PushBack(PDFElement* pElement); + const std::vector& GetElements(); +}; + +/// Reference object: something with a unique ID. +class XMLSECURITY_DLLPUBLIC PDFReferenceElement : public PDFElement +{ + PDFDocument& m_rDoc; + int m_fObjectValue; + int m_fGenerationValue; + +public: + PDFReferenceElement(PDFDocument& rDoc, int fObjectValue, int fGenerationValue); + bool Read(SvStream& rStream) override; + /// Assuming the reference points to a number object, return its value. + double LookupNumber(SvStream& rStream) const; + /// Lookup referenced object, without assuming anything about its contents. + PDFObjectElement* LookupObject(); + int GetObjectValue() const; + int GetGenerationValue() const; +}; + /// Stream object: a byte array with a known length. class XMLSECURITY_DLLPUBLIC PDFStreamElement : public PDFElement { @@ -146,6 +177,8 @@ public: const std::map& GetItems() const; /// Looks up an object which is only referenced in this dictionary. PDFObjectElement* LookupObject(const OString& rDictionaryKey); + /// Looks up an element which is contained in this dictionary. + PDFElement* LookupElement(const OString& rDictionaryKey); }; enum class TokenizeMode -- cgit