diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-27 09:17:30 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-27 09:48:02 +0000 |
commit | 044e8d795276cc495c1f796a14ad36e6a5f9cdb9 (patch) | |
tree | 0d8ae233397681b8a2f366d7671abbf238e96677 /include/vcl | |
parent | be94475414c878d1e3228da577b496985a4a6a8c (diff) |
tdf#106693 vcl PDF export, norefxobj: copy array objects
So far only the dictionary and the stream of the object was copied, see
if it has an array, and take care of that as well.
Also check if the array contains a reference and act accordingly.
Change-Id: I7f3bb12ec0bbc6f6e1db4f43625c7768b862c895
Reviewed-on: https://gerrit.libreoffice.org/35744
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'include/vcl')
-rw-r--r-- | include/vcl/filter/pdfdocument.hxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/vcl/filter/pdfdocument.hxx b/include/vcl/filter/pdfdocument.hxx index fbfb81ed10a2..9ccbb43d0225 100644 --- a/include/vcl/filter/pdfdocument.hxx +++ b/include/vcl/filter/pdfdocument.hxx @@ -32,6 +32,7 @@ class PDFDocument; class PDFDictionaryElement; class PDFArrayElement; class PDFStreamElement; +class PDFNumberElement; /// A byte range in a PDF file. class VCL_DLLPUBLIC PDFElement @@ -54,6 +55,10 @@ class VCL_DLLPUBLIC PDFObjectElement : public PDFElement /// Length of the dictionary buffer till (before) the '>>' token. sal_uInt64 m_nDictionaryLength; PDFDictionaryElement* m_pDictionaryElement; + /// Position after the '[' token, if m_pArrayElement is set. + sal_uInt64 m_nArrayOffset; + /// Length of the array buffer till (before) the ']' token. + sal_uInt64 m_nArrayLength; /// The contained direct array, if any. PDFArrayElement* m_pArrayElement; /// The stream of this object, used when this is an object stream. @@ -83,6 +88,10 @@ public: void SetStream(PDFStreamElement* pStreamElement); /// Access to the stream of the object, if it has any. PDFStreamElement* GetStream() const; + void SetArrayOffset(sal_uInt64 nArrayOffset); + sal_uInt64 GetArrayOffset(); + void SetArrayLength(sal_uInt64 nArrayLength); + sal_uInt64 GetArrayLength(); PDFArrayElement* GetArray() const; /// Parse objects stored in this object stream. void ParseStoredObjects(); @@ -113,9 +122,11 @@ class VCL_DLLPUBLIC PDFReferenceElement : public PDFElement int m_fGenerationValue; /// Location after the 'R' token. sal_uInt64 m_nOffset = 0; + /// The element providing the object number. + PDFNumberElement& m_rObject; public: - PDFReferenceElement(PDFDocument& rDoc, int fObjectValue, int fGenerationValue); + PDFReferenceElement(PDFDocument& rDoc, PDFNumberElement& rObject, PDFNumberElement& rGeneration); bool Read(SvStream& rStream) override; /// Assuming the reference points to a number object, return its value. double LookupNumber(SvStream& rStream) const; @@ -124,6 +135,7 @@ public: int GetObjectValue() const; int GetGenerationValue() const; sal_uInt64 GetOffset() const; + PDFNumberElement& GetObjectElement() const; }; /// Stream object: a byte array with a known length. |