From 03929cf9c67986207b0006dd3aeee27a4cb0de3b Mon Sep 17 00:00:00 2001 From: Masamichi Hosoda Date: Sat, 20 Aug 2016 20:40:18 +0900 Subject: [PATCH 2/3] Add functions for named destination name in name-tree Get the number of named destinations in name-tree int Catalog::numDestNameTree(); Get the i'th named destination name in name-tree GooString *Catalog::getDestNameTreeName(int i); Get the i'th named destination link destination in name-tree LinkDest *Catalog::getDestNameTreeDest(int i); --- poppler/Catalog.cc | 12 ++++++++++++ poppler/Catalog.h | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/poppler/Catalog.cc b/poppler/Catalog.cc index 13fbd93..783e28d 100644 --- a/poppler/Catalog.cc +++ b/poppler/Catalog.cc @@ -504,6 +504,18 @@ LinkDest *Catalog::constructLinkDest(Object *obj) return dest; } +LinkDest *Catalog::getDestNameTreeDest(int i) +{ + LinkDest *dest; + Object obj; + + getDestNameTree()->getValue(i).fetch(xref, &obj); + dest = constructLinkDest(&obj); + obj.free(); + + return dest; +} + FileSpec *Catalog::embeddedFile(int i) { Object efDict; diff --git a/poppler/Catalog.h b/poppler/Catalog.h index 577416a..cca43e0 100644 --- a/poppler/Catalog.h +++ b/poppler/Catalog.h @@ -151,6 +151,16 @@ public: Object *getDests(); + // Get the number of named destinations in name-tree + int numDestNameTree() { return getDestNameTree()->numEntries(); } + + // Get the i'th named destination name in name-tree + GooString *getDestNameTreeName(int i) + { return getDestNameTree()->getName(i); } + + // Get the i'th named destination link destination in name-tree + LinkDest *getDestNameTreeDest(int i); + // Get the number of embedded files int numEmbeddedFiles() { return getEmbeddedFileNameTree()->numEntries(); } -- 2.8.3