aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-08-18 04:28:19 +0200
committerJay Berkenbilt <ejb@ql.org>2019-08-18 15:00:40 +0200
commit522d2b2227cbc8edc1b7404f2e3980a28d216988 (patch)
treee41408f860be3d0ae1c7fd4e6d632af914d60924 /libqpdf/qpdf
parent5187a3ec85f1a83cbde9e77227e215a2dbcfccb0 (diff)
downloadqpdf-522d2b2227cbc8edc1b7404f2e3980a28d216988.tar.zst
Improve efficiency of fixDanglingReferences
Diffstat (limited to 'libqpdf/qpdf')
-rw-r--r--libqpdf/qpdf/QPDF_Array.hh5
-rw-r--r--libqpdf/qpdf/SparseOHArray.hh6
2 files changed, 11 insertions, 0 deletions
diff --git a/libqpdf/qpdf/QPDF_Array.hh b/libqpdf/qpdf/QPDF_Array.hh
index eb0b594b..7ea111a9 100644
--- a/libqpdf/qpdf/QPDF_Array.hh
+++ b/libqpdf/qpdf/QPDF_Array.hh
@@ -4,6 +4,7 @@
#include <qpdf/QPDFObject.hh>
#include <vector>
+#include <list>
#include <qpdf/SparseOHArray.hh>
class QPDF_Array: public QPDFObject
@@ -28,7 +29,11 @@ class QPDF_Array: public QPDFObject
void appendItem(QPDFObjectHandle const& item);
void eraseItem(int at);
+ // Helper methods for QPDF and QPDFObjectHandle -- these are
+ // public methods since the whole class is not part of the public
+ // API. Otherwise, these would be wrapped in accessor classes.
SparseOHArray const& getElementsForShallowCopy() const;
+ void addExplicitElementsToList(std::list<QPDFObjectHandle>&) const;
protected:
virtual void releaseResolved();
diff --git a/libqpdf/qpdf/SparseOHArray.hh b/libqpdf/qpdf/SparseOHArray.hh
index 2e3f334c..6cd30ece 100644
--- a/libqpdf/qpdf/SparseOHArray.hh
+++ b/libqpdf/qpdf/SparseOHArray.hh
@@ -26,6 +26,12 @@ class SparseOHArray
QPDF_DLL
void insert(size_t idx, QPDFObjectHandle oh);
+ typedef std::map<size_t, QPDFObjectHandle>::const_iterator const_iterator;
+ QPDF_DLL
+ const_iterator begin() const;
+ QPDF_DLL
+ const_iterator end() const;
+
private:
std::map<size_t, QPDFObjectHandle> elements;
size_t n_elements;