From 8a3cdfd2af4a95d8daede45bcb36eecdcdc8f964 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 9 Sep 2022 15:40:02 -0400 Subject: Change QPDFObjectHandle == to isSameObjectAs Replace operator== and operator!=, which were testing for the same underlying object, with isSameObjectAs. This change was motivated by the fact that pikepdf internally had its own operator== method for QPDFObjectHandle that did structural comparison. I backed out qpdf's operator== as a courtesy to pikepdf (in my own testing) but also because I think people might naturally assume that operator== does a structural comparison, and isSameObjectAs is clearer in its intent. --- include/qpdf/QPDFObjectHandle.hh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'include/qpdf') diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index 21f82e58..66fd4a5a 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -334,14 +334,13 @@ class QPDFObjectHandle QPDF_DLL inline bool isInitialized() const; - // Two QPDFObjectHandle objects are equal if they point to exactly - // the same underlying object, meaning that changes to one are - // reflected in the other, or "if you paint one, the other one - // changes color." + // This method returns true if the QPDFObjectHandle objects point + // to exactly the same underlying object, meaning that changes to + // one are reflected in the other, or "if you paint one, the other + // one changes color." This does not perform a structural + // comparison of the contents of the objects. QPDF_DLL - bool operator==(QPDFObjectHandle const&) const; - QPDF_DLL - bool operator!=(QPDFObjectHandle const&) const; + bool isSameObjectAs(QPDFObjectHandle const&) const; // Return type code and type name of underlying object. These are // useful for doing rapid type tests (like switch statements) or -- cgit v1.2.3-54-g00ecf