aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pdf-bookmarks.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2013-06-14 17:58:37 +0200
committerJay Berkenbilt <ejb@ql.org>2013-06-14 20:58:09 +0200
commit96eb96511557469d50bbd55d211ced16acc31e13 (patch)
tree05d2c094ed6df3c80314d6bc4a09691a6fef313c /examples/pdf-bookmarks.cc
parent5039da0b91a981b438cbb1c7a7325fde12e2632b (diff)
downloadqpdf-96eb96511557469d50bbd55d211ced16acc31e13.tar.zst
Use QPDFObjectHandle::getObjGen() where appropriate
In internal code and examples, replace calls to getObjectID() and getGeneration() with calls to getObjGen() where possible.
Diffstat (limited to 'examples/pdf-bookmarks.cc')
-rw-r--r--examples/pdf-bookmarks.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/pdf-bookmarks.cc b/examples/pdf-bookmarks.cc
index 802cdbac..5d11fb32 100644
--- a/examples/pdf-bookmarks.cc
+++ b/examples/pdf-bookmarks.cc
@@ -9,7 +9,7 @@ static char const* whoami = 0;
static enum { st_none, st_numbers, st_lines } style = st_none;
static bool show_open = false;
static bool show_targets = false;
-static std::map<int, int> page_map;
+static std::map<QPDFObjGen, int> page_map;
void usage()
{
@@ -50,7 +50,7 @@ void generate_page_map(QPDF& qpdf)
iter != pages.end(); ++iter)
{
QPDFObjectHandle& oh = *iter;
- page_map[oh.getObjectID()] = ++n;
+ page_map[oh.getObjGen()] = ++n;
}
}
@@ -121,10 +121,10 @@ void extract_bookmarks(QPDFObjectHandle outlines, std::vector<int>& numbers)
if ((dest.isArray()) && (dest.getArrayNItems() > 0))
{
QPDFObjectHandle first = dest.getArrayItem(0);
- int object_id = first.getObjectID();
- if (page_map.count(object_id))
+ QPDFObjGen og = first.getObjGen();
+ if (page_map.count(og))
{
- target = QUtil::int_to_string(page_map[object_id]);
+ target = QUtil::int_to_string(page_map[og]);
}
}