diff options
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | include/qpdf/QPDF.hh | 9 | ||||
-rw-r--r-- | include/qpdf/QPDFMatrix.hh | 7 | ||||
-rw-r--r-- | include/qpdf/QPDFNameTreeObjectHelper.hh | 1 | ||||
-rw-r--r-- | include/qpdf/QPDFObjectHandle.hh | 29 | ||||
-rw-r--r-- | include/qpdf/QPDFPageObjectHelper.hh | 10 | ||||
-rw-r--r-- | include/qpdf/QUtil.hh | 9 | ||||
-rw-r--r-- | libqpdf/QPDFMatrix.cc | 12 | ||||
-rw-r--r-- | libqpdf/QPDFObjectHandle.cc | 25 | ||||
-rw-r--r-- | libqpdf/QPDFPageObjectHelper.cc | 12 | ||||
-rw-r--r-- | libqpdf/QPDF_optimization.cc | 6 | ||||
-rw-r--r-- | libqpdf/QUtil.cc | 6 |
12 files changed, 12 insertions, 116 deletions
@@ -481,12 +481,10 @@ Comments appear in the code prefixed by "ABI" * Search for ABI to find items not listed here. * Switch default --json to latest -* See PointerHolder to std::shared_ptr above. * See where anonymous namespaces can be used to keep things private to a source file. Search for `(class|struct)` in **/*.cc. * See if we can use constructor delegation instead of init() in classes with overloaded constructors. -* Merge two versions of QPDFObjectHandle::makeDirect per comment * After removing legacy QPDFNameTreeObjectHelper and QPDFNumberTreeObjectHelper constructors, NNTreeImpl can switch to having a QPDF reference and assume that the reference is always diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index bc65ee80..bc0096b7 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -619,13 +619,8 @@ class QPDF QPDF_DLL void optimize( std::map<int, int> const& object_stream_data, - bool allow_changes = true); - // ABI: make function optional and merge overloaded versions - QPDF_DLL - void optimize( - std::map<int, int> const& object_stream_data, - bool allow_changes, - std::function<int(QPDFObjectHandle&)> skip_stream_parameters); + bool allow_changes = true, + std::function<int(QPDFObjectHandle&)> skip_stream_parameters = nullptr); // Traverse page tree return all /Page objects. It also detects // and resolves cases in which the same /Page object is diff --git a/include/qpdf/QPDFMatrix.hh b/include/qpdf/QPDFMatrix.hh index f0516dbd..3dc26a7c 100644 --- a/include/qpdf/QPDFMatrix.hh +++ b/include/qpdf/QPDFMatrix.hh @@ -74,9 +74,6 @@ class QPDFMatrix // and take the first and second rows of the result as xp and yp. QPDF_DLL void transform(double x, double y, double& xp, double& yp) const; - // ABI: delete non-const version - QPDF_DLL - void transform(double x, double y, double& xp, double& yp); // Transform a rectangle by creating a new rectangle that tightly // bounds the polygon resulting from transforming the four @@ -84,10 +81,6 @@ class QPDFMatrix QPDF_DLL QPDFObjectHandle::Rectangle transformRectangle(QPDFObjectHandle::Rectangle r) const; - // ABI: delete non-const version - QPDF_DLL - QPDFObjectHandle::Rectangle - transformRectangle(QPDFObjectHandle::Rectangle r); // operator== tests for exact equality, not considering deltas for // floating point. diff --git a/include/qpdf/QPDFNameTreeObjectHelper.hh b/include/qpdf/QPDFNameTreeObjectHelper.hh index 2060579b..11d7b5a2 100644 --- a/include/qpdf/QPDFNameTreeObjectHelper.hh +++ b/include/qpdf/QPDFNameTreeObjectHelper.hh @@ -61,7 +61,6 @@ class QPDFNameTreeObjectHelper: public QPDFObjectHelper QPDF_DLL static QPDFNameTreeObjectHelper newEmpty(QPDF&, bool auto_repair = true); - // ABI: = default QPDF_DLL virtual ~QPDFNameTreeObjectHelper(); diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index b8b95f47..a09fd954 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -530,12 +530,8 @@ class QPDFObjectHandle QPDF_DLL static QPDFObjectHandle newReal(std::string const& value); QPDF_DLL - static QPDFObjectHandle newReal(double value, int decimal_places = 0); - // ABI: combine with other newReal by adding trim_trailing_zeroes - // above as an optional parameter with a default of true. - QPDF_DLL - static QPDFObjectHandle - newReal(double value, int decimal_places, bool trim_trailing_zeroes); + static QPDFObjectHandle newReal( + double value, int decimal_places = 0, bool trim_trailing_zeroes = true); // Note about name objects: qpdf's internal representation of a // PDF name is a sequence of bytes, excluding the NUL character, // and starting with a slash. Name objects as represented in the @@ -933,11 +929,8 @@ class QPDFObjectHandle QPDF_DLL void mergeResources( QPDFObjectHandle other, - std::map<std::string, std::map<std::string, std::string>>* conflicts); - // ABI: eliminate version without conflicts and make conflicts - // default to nullptr. - QPDF_DLL - void mergeResources(QPDFObjectHandle other); + std::map<std::string, std::map<std::string, std::string>>* conflicts = + nullptr); // Get all resource names from a resource dictionary. If this // object is a dictionary, this method returns a set of all the @@ -964,12 +957,7 @@ class QPDFObjectHandle std::string getUniqueResourceName( std::string const& prefix, int& min_suffix, - std::set<std::string>* resource_names); - // ABI: remove this version and make resource_names default to - // nullptr. - QPDF_DLL - std::string - getUniqueResourceName(std::string const& prefix, int& min_suffix); + std::set<std::string>* resource_names = nullptr); // Return the QPDF object that owns an indirect object. Returns // null for a direct object. @@ -1024,12 +1012,7 @@ class QPDFObjectHandle // to the original QPDF object after this call completes // successfully. QPDF_DLL - void makeDirect(bool allow_streams); - // Zero-arg version is equivalent to makeDirect(false). - // ABI: delete zero-arg version of makeDirect, and make - // allow_streams default to false. - QPDF_DLL - void makeDirect(); + void makeDirect(bool allow_streams = false); // Mutator methods for array objects QPDF_DLL diff --git a/include/qpdf/QPDFPageObjectHelper.hh b/include/qpdf/QPDFPageObjectHelper.hh index 7431a9b3..f35e4cf4 100644 --- a/include/qpdf/QPDFPageObjectHelper.hh +++ b/include/qpdf/QPDFPageObjectHelper.hh @@ -132,10 +132,7 @@ class QPDFPageObjectHelper: public QPDFObjectHelper // this behavior. Prior to qpdf 10.1, form XObjects were ignored, // but this was considered a bug. QPDF_DLL - void externalizeInlineImages(size_t min_size, bool shallow); - // ABI: make shallow optional (default false) and merge - QPDF_DLL - void externalizeInlineImages(size_t min_size = 0); + void externalizeInlineImages(size_t min_size = 0, bool shallow = false); // Return the annotations in the page's "/Annots" list, if any. If // only_subtype is non-empty, only include annotations of the @@ -344,10 +341,7 @@ class QPDFPageObjectHelper: public QPDFObjectHelper // rotated. If not, one will be created inside the function, which // is less efficient. QPDF_DLL - void flattenRotation(); - // ABI: merge versions and make afdh default to nullptr - QPDF_DLL - void flattenRotation(QPDFAcroFormDocumentHelper* afdh); + void flattenRotation(QPDFAcroFormDocumentHelper* afdh = nullptr); // Copy annotations from another page into this page. The other // page may be from the same QPDF or from a different QPDF. Each diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh index ce2f797f..2d0b7b56 100644 --- a/include/qpdf/QUtil.hh +++ b/include/qpdf/QUtil.hh @@ -51,13 +51,8 @@ namespace QUtil std::string uint_to_string_base(unsigned long long, int base, int length = 0); QPDF_DLL - std::string double_to_string(double, int decimal_places = 0); - // ABI: combine with other double_to_string by adding - // trim_trailing_zeroes above as an optional parameter with a - // default of true. - QPDF_DLL - std::string - double_to_string(double, int decimal_places, bool trim_trailing_zeroes); + std::string double_to_string( + double, int decimal_places = 0, bool trim_trailing_zeroes = true); // These string to number methods throw std::runtime_error on // underflow/overflow. diff --git a/libqpdf/QPDFMatrix.cc b/libqpdf/QPDFMatrix.cc index 75049130..9fb24888 100644 --- a/libqpdf/QPDFMatrix.cc +++ b/libqpdf/QPDFMatrix.cc @@ -110,12 +110,6 @@ QPDFMatrix::rotatex90(int angle) } void -QPDFMatrix::transform(double x, double y, double& xp, double& yp) -{ - const_cast<QPDFMatrix const*>(this)->transform(x, y, xp, yp); -} - -void QPDFMatrix::transform(double x, double y, double& xp, double& yp) const { xp = (this->a * x) + (this->c * y) + this->e; @@ -123,12 +117,6 @@ QPDFMatrix::transform(double x, double y, double& xp, double& yp) const } QPDFObjectHandle::Rectangle -QPDFMatrix::transformRectangle(QPDFObjectHandle::Rectangle r) -{ - return const_cast<QPDFMatrix const*>(this)->transformRectangle(r); -} - -QPDFObjectHandle::Rectangle QPDFMatrix::transformRectangle(QPDFObjectHandle::Rectangle r) const { std::vector<double> tx(4); diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index d6fe8b9e..59b4942d 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -1095,12 +1095,6 @@ QPDFObjectHandle::makeResourcesIndirect(QPDF& owning_qpdf) } void -QPDFObjectHandle::mergeResources(QPDFObjectHandle other) -{ - mergeResources(other, nullptr); -} - -void QPDFObjectHandle::mergeResources( QPDFObjectHandle other, std::map<std::string, std::map<std::string, std::string>>* conflicts) @@ -1226,13 +1220,6 @@ QPDFObjectHandle::getResourceNames() std::string QPDFObjectHandle::getUniqueResourceName( - std::string const& prefix, int& min_suffix) -{ - return getUniqueResourceName(prefix, min_suffix, nullptr); -} - -std::string -QPDFObjectHandle::getUniqueResourceName( std::string const& prefix, int& min_suffix, std::set<std::string>* namesp) { @@ -2540,12 +2527,6 @@ QPDFObjectHandle::newReal(std::string const& value) } QPDFObjectHandle -QPDFObjectHandle::newReal(double value, int decimal_places) -{ - return QPDFObjectHandle(new QPDF_Real(value, decimal_places, true)); -} - -QPDFObjectHandle QPDFObjectHandle::newReal( double value, int decimal_places, bool trim_trailing_zeroes) { @@ -2916,12 +2897,6 @@ QPDFObjectHandle::copyStream() } void -QPDFObjectHandle::makeDirect() -{ - makeDirect(false); -} - -void QPDFObjectHandle::makeDirect(bool allow_streams) { std::set<QPDFObjGen> visited; diff --git a/libqpdf/QPDFPageObjectHelper.cc b/libqpdf/QPDFPageObjectHelper.cc index 4706cb27..5ad67dea 100644 --- a/libqpdf/QPDFPageObjectHelper.cc +++ b/libqpdf/QPDFPageObjectHelper.cc @@ -411,12 +411,6 @@ QPDFPageObjectHelper::getFormXObjects() } void -QPDFPageObjectHelper::externalizeInlineImages(size_t min_size) -{ - externalizeInlineImages(min_size, false); -} - -void QPDFPageObjectHelper::externalizeInlineImages(size_t min_size, bool shallow) { if (shallow) { @@ -930,12 +924,6 @@ QPDFPageObjectHelper::placeFormXObject( } void -QPDFPageObjectHelper::flattenRotation() -{ - flattenRotation(nullptr); -} - -void QPDFPageObjectHelper::flattenRotation(QPDFAcroFormDocumentHelper* afdh) { QPDF* qpdf = this->oh.getOwningQPDF(); diff --git a/libqpdf/QPDF_optimization.cc b/libqpdf/QPDF_optimization.cc index 3d262b03..c76e255d 100644 --- a/libqpdf/QPDF_optimization.cc +++ b/libqpdf/QPDF_optimization.cc @@ -53,12 +53,6 @@ QPDF::ObjUser::operator<(ObjUser const& rhs) const } void -QPDF::optimize(std::map<int, int> const& object_stream_data, bool allow_changes) -{ - optimize(object_stream_data, allow_changes, nullptr); -} - -void QPDF::optimize( std::map<int, int> const& object_stream_data, bool allow_changes, diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index 711065df..6b9acb6d 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -327,12 +327,6 @@ QUtil::uint_to_string_base(unsigned long long num, int base, int length) } std::string -QUtil::double_to_string(double num, int decimal_places) -{ - return double_to_string(num, decimal_places, true); -} - -std::string QUtil::double_to_string( double num, int decimal_places, bool trim_trailing_zeroes) { |