From 522d2b2227cbc8edc1b7404f2e3980a28d216988 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 17 Aug 2019 22:28:19 -0400 Subject: Improve efficiency of fixDanglingReferences --- libqpdf/qpdf/QPDF_Array.hh | 5 +++++ libqpdf/qpdf/SparseOHArray.hh | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'libqpdf/qpdf') 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 #include +#include #include 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&) 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::const_iterator const_iterator; + QPDF_DLL + const_iterator begin() const; + QPDF_DLL + const_iterator end() const; + private: std::map elements; size_t n_elements; -- cgit v1.2.3-54-g00ecf