diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-24 15:16:32 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-24 20:32:51 +0000 |
commit | f135a8bdeba15cf72dd31c7d613d335bbfc7017b (patch) | |
tree | 79c4573ef171e449299e20bc038f936254a0c1e2 /vcl/source/filter | |
parent | 221247679bcbc2507d6f904f519040fc4467d4a1 (diff) |
tdf#106693 vcl PDF export, norefxobj: update XObject refs
Start copying referenced objects recursively, and also take care of
updating references to the object IDs as they appear in our output.
With this, the 4th image referenced from the PDF image has a correctly
updated reference in its dictionary's ColorSpace key.
Change-Id: I8b49701c1f60bd0ef5a097b24ce59164554c44fa
Reviewed-on: https://gerrit.libreoffice.org/35653
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'vcl/source/filter')
-rw-r--r-- | vcl/source/filter/ipdf/pdfdocument.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx index 900c5f281863..8744729fdd83 100644 --- a/vcl/source/filter/ipdf/pdfdocument.cxx +++ b/vcl/source/filter/ipdf/pdfdocument.cxx @@ -2224,7 +2224,10 @@ size_t PDFDictionaryElement::Parse(const std::vector< std::unique_ptr<PDFElement { rDictionary[aName] = pReference; if (pThisDictionary) + { pThisDictionary->SetKeyOffset(aName, nNameOffset); + pThisDictionary->SetKeyValueLength(aName, pReference->GetOffset() - nNameOffset); + } aName.clear(); } else @@ -2421,6 +2424,11 @@ void PDFObjectElement::SetDictionary(PDFDictionaryElement* pDictionaryElement) m_pDictionaryElement = pDictionaryElement; } +const std::map<OString, PDFElement*>& PDFObjectElement::GetDictionaryItems() const +{ + return m_aDictionary; +} + void PDFObjectElement::SetArray(PDFArrayElement* pArrayElement) { m_pArrayElement = pArrayElement; @@ -2598,12 +2606,18 @@ PDFReferenceElement::PDFReferenceElement(PDFDocument& rDoc, int fObjectValue, in { } -bool PDFReferenceElement::Read(SvStream& /*rStream*/) +bool PDFReferenceElement::Read(SvStream& rStream) { SAL_INFO("vcl.filter", "PDFReferenceElement::Read: " << m_fObjectValue << " " << m_fGenerationValue << " R"); + m_nOffset = rStream.Tell(); return true; } +sal_uInt64 PDFReferenceElement::GetOffset() const +{ + return m_nOffset; +} + double PDFReferenceElement::LookupNumber(SvStream& rStream) const { size_t nOffset = m_rDoc.GetObjectOffset(m_fObjectValue); |