diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-10-16 18:15:21 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-12-02 17:41:05 +0100 |
commit | be9f6bccbaa2a447f9a3053e46027c42e9c3018d (patch) | |
tree | 87746852c53f719f3bb1caed3580ab28a9661195 /vcl/source | |
parent | 1dc6340da19a1abcad11b3d919561c4780f3a30b (diff) |
vcl pdf tokenizer: fix handling of dict -> array -> dict tokens
Needed to be able to parse the /Reference key of signatures.
(cherry picked from commit 056c1284d6a68525002c54bef10834cc135385db)
Conflicts:
vcl/qa/cppunit/filter/ipdf/ipdf.cxx
Change-Id: I6b81089a3f58a2de461ad92ca5a891c284f8686a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105626
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 8f46af565680bef0ff8ca32781e6d813a7446543)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107061
Tested-by: Michael Stahl <michael.stahl@cib.de>
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/filter/ipdf/pdfdocument.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx index 1afc3167ae91..ec286721ec16 100644 --- a/vcl/source/filter/ipdf/pdfdocument.cxx +++ b/vcl/source/filter/ipdf/pdfdocument.cxx @@ -2229,8 +2229,17 @@ size_t PDFDictionaryElement::Parse(const std::vector<std::unique_ptr<PDFElement> if (nexti >= i) // ensure we go forwards and not endlessly loop { i = nexti; - rDictionary[aName] = pDictionary; - aName.clear(); + if (pArray) + { + // Dictionary value inside an array. + pArray->PushBack(pDictionary); + } + else + { + // Dictionary toplevel value. + rDictionary[aName] = pDictionary; + aName.clear(); + } } } } |