aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-04-16 01:54:34 +0200
committerJay Berkenbilt <ejb@ql.org>2022-04-16 16:41:46 +0200
commit2a7d2b63c2a7284d1b1179eefbf64f5dd29aa510 (patch)
tree12ed9d6f504f7a5aa72cb5c487d7cb4f926c4d91 /include
parentdd3596636756c089532f1642c4d63666b5544855 (diff)
downloadqpdf-2a7d2b63c2a7284d1b1179eefbf64f5dd29aa510.tar.zst
Make ABI-breaking changes that don't modify API at all
* Merge overloaded functions by adding default values * Remove non-const methods that are identical to const methods
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDF.hh9
-rw-r--r--include/qpdf/QPDFMatrix.hh7
-rw-r--r--include/qpdf/QPDFNameTreeObjectHelper.hh1
-rw-r--r--include/qpdf/QPDFObjectHandle.hh29
-rw-r--r--include/qpdf/QPDFPageObjectHelper.hh10
-rw-r--r--include/qpdf/QUtil.hh9
6 files changed, 12 insertions, 53 deletions
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.