From 8f06da75343a5e970ff7a6f275c319172e6292d0 Mon Sep 17 00:00:00 2001 From: Thorsten Schöning <6223655+ams-tschoening@users.noreply.github.com> Date: Wed, 3 Jul 2019 19:34:02 +0200 Subject: Change list to vector for outline helpers (fixes #297) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change works around STL problems with Embarcadero C++ Builder version 10.2, but std::vector is more common than std::list in qpdf, and this is a relatively new API, so an API change is tolerable. Thanks to Thorsten Schöning <6223655+ams-tschoening@users.noreply.github.com> for the fix. --- libqpdf/QPDFOutlineDocumentHelper.cc | 8 ++++---- libqpdf/QPDFOutlineObjectHelper.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'libqpdf') diff --git a/libqpdf/QPDFOutlineDocumentHelper.cc b/libqpdf/QPDFOutlineDocumentHelper.cc index 411ccf34..b736ff08 100644 --- a/libqpdf/QPDFOutlineDocumentHelper.cc +++ b/libqpdf/QPDFOutlineDocumentHelper.cc @@ -42,7 +42,7 @@ QPDFOutlineDocumentHelper::hasOutlines() return ! this->m->outlines.empty(); } -std::list +std::vector QPDFOutlineDocumentHelper::getTopLevelOutlines() { return this->m->outlines; @@ -59,19 +59,19 @@ QPDFOutlineDocumentHelper::initializeByPage() QPDFOutlineObjectHelper oh = queue.front(); queue.pop_front(); this->m->by_page[oh.getDestPage().getObjGen()].push_back(oh); - std::list kids = oh.getKids(); + std::vector kids = oh.getKids(); queue.insert(queue.end(), kids.begin(), kids.end()); } } -std::list +std::vector QPDFOutlineDocumentHelper::getOutlinesForPage(QPDFObjGen const& og) { if (this->m->by_page.empty()) { initializeByPage(); } - std::list result; + std::vector result; if (this->m->by_page.count(og)) { result = this->m->by_page[og]; diff --git a/libqpdf/QPDFOutlineObjectHelper.cc b/libqpdf/QPDFOutlineObjectHelper.cc index 6cdd182e..c06c63d8 100644 --- a/libqpdf/QPDFOutlineObjectHelper.cc +++ b/libqpdf/QPDFOutlineObjectHelper.cc @@ -45,7 +45,7 @@ QPDFOutlineObjectHelper::getParent() return this->m->parent; } -std::list +std::vector QPDFOutlineObjectHelper::getKids() { return this->m->kids; -- cgit v1.2.3-54-g00ecf