From a603c1e395d039e71ca8e4c70bc43f2f9d2d604b Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Mon, 27 Jun 2022 12:50:35 -0400 Subject: [PATCH] Run format-code --- include/qpdf/QPDFObjectHandle.hh | 2 +- libqpdf/QPDFObjectHandle.cc | 13 ++++--------- libqpdf/QPDF_Stream.cc | 2 +- libqpdf/qpdf/QPDF_Array.hh | 3 ++- libqpdf/qpdf/QPDF_Dictionary.hh | 3 ++- libqpdf/qpdf/QPDF_Null.hh | 1 + libqpdf/qpdf/QPDF_Real.hh | 4 ++-- libqpdf/qpdf/QPDF_Reserved.hh | 1 + libqpdf/qpdf/QPDF_String.hh | 3 ++- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index cda257f1..292397d4 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -1466,7 +1466,7 @@ class QPDFObjectHandle { if (!o.dereference()) { throw std::logic_error("attempted to dereference an" - " uninitialized QPDFObjectHandle"); + " uninitialized QPDFObjectHandle"); }; return o.obj; } diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index d39f93be..66087dd4 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -284,8 +284,8 @@ QPDFObjectHandle::isInitialized() const QPDFObject::object_type_e QPDFObjectHandle::getTypeCode() { - return dereference() ? - this->obj->getTypeCode() : QPDFObject::ot_uninitialized; + return dereference() ? this->obj->getTypeCode() + : QPDFObject::ot_uninitialized; } char const* @@ -407,8 +407,7 @@ QPDFObjectHandle::isArray() bool QPDFObjectHandle::isDictionary() { - return dereference() && - QPDFObjectTypeAccessor::check(obj); + return dereference() && QPDFObjectTypeAccessor::check(obj); } bool @@ -2803,11 +2802,7 @@ QPDFObjectHandle::copyObject( std::shared_ptr new_obj; - if (isBool() || - isInteger() || - isName() || - isNull() || - isReal() || + if (isBool() || isInteger() || isName() || isNull() || isReal() || isString()) { new_obj = obj->shallowCopy(); } else if (isArray()) { diff --git a/libqpdf/QPDF_Stream.cc b/libqpdf/QPDF_Stream.cc index c4c69659..0b06a7f5 100644 --- a/libqpdf/QPDF_Stream.cc +++ b/libqpdf/QPDF_Stream.cc @@ -144,7 +144,7 @@ QPDF_Stream::create( size_t length) { return do_create( - new QPDF_Stream(qpdf, objid, generation, stream_dict, offset,length)); + new QPDF_Stream(qpdf, objid, generation, stream_dict, offset, length)); } std::shared_ptr diff --git a/libqpdf/qpdf/QPDF_Array.hh b/libqpdf/qpdf/QPDF_Array.hh index e718c6e0..3e095637 100644 --- a/libqpdf/qpdf/QPDF_Array.hh +++ b/libqpdf/qpdf/QPDF_Array.hh @@ -11,7 +11,8 @@ class QPDF_Array: public QPDFObject { public: virtual ~QPDF_Array() = default; - static std::shared_ptr create(std::vector const& items); + static std::shared_ptr + create(std::vector const& items); static std::shared_ptr create(SparseOHArray const& items); virtual std::shared_ptr shallowCopy(); virtual std::string unparse(); diff --git a/libqpdf/qpdf/QPDF_Dictionary.hh b/libqpdf/qpdf/QPDF_Dictionary.hh index 3cd00c1e..cacc8961 100644 --- a/libqpdf/qpdf/QPDF_Dictionary.hh +++ b/libqpdf/qpdf/QPDF_Dictionary.hh @@ -12,7 +12,8 @@ class QPDF_Dictionary: public QPDFObject { public: virtual ~QPDF_Dictionary() = default; - static std::shared_ptr create(std::map const& items); + static std::shared_ptr + create(std::map const& items); virtual std::shared_ptr shallowCopy(); virtual std::string unparse(); virtual JSON getJSON(int json_version); diff --git a/libqpdf/qpdf/QPDF_Null.hh b/libqpdf/qpdf/QPDF_Null.hh index 8051e238..16833424 100644 --- a/libqpdf/qpdf/QPDF_Null.hh +++ b/libqpdf/qpdf/QPDF_Null.hh @@ -13,6 +13,7 @@ class QPDF_Null: public QPDFObject virtual JSON getJSON(int json_version); virtual QPDFObject::object_type_e getTypeCode() const; virtual char const* getTypeName() const; + private: QPDF_Null() = default; }; diff --git a/libqpdf/qpdf/QPDF_Real.hh b/libqpdf/qpdf/QPDF_Real.hh index bf61091c..f5ab4bd6 100644 --- a/libqpdf/qpdf/QPDF_Real.hh +++ b/libqpdf/qpdf/QPDF_Real.hh @@ -8,8 +8,8 @@ class QPDF_Real: public QPDFObject public: virtual ~QPDF_Real() = default; static std::shared_ptr create(std::string const& val); - static std::shared_ptr create( - double value, int decimal_places, bool trim_trailing_zeroes); + static std::shared_ptr + create(double value, int decimal_places, bool trim_trailing_zeroes); virtual std::shared_ptr shallowCopy(); virtual std::string unparse(); virtual JSON getJSON(int json_version); diff --git a/libqpdf/qpdf/QPDF_Reserved.hh b/libqpdf/qpdf/QPDF_Reserved.hh index 1a40447d..243a1728 100644 --- a/libqpdf/qpdf/QPDF_Reserved.hh +++ b/libqpdf/qpdf/QPDF_Reserved.hh @@ -13,6 +13,7 @@ class QPDF_Reserved: public QPDFObject virtual JSON getJSON(int json_version); virtual QPDFObject::object_type_e getTypeCode() const; virtual char const* getTypeName() const; + private: QPDF_Reserved() = default; }; diff --git a/libqpdf/qpdf/QPDF_String.hh b/libqpdf/qpdf/QPDF_String.hh index fc11d3ba..b6d77637 100644 --- a/libqpdf/qpdf/QPDF_String.hh +++ b/libqpdf/qpdf/QPDF_String.hh @@ -12,7 +12,8 @@ class QPDF_String: public QPDFObject public: virtual ~QPDF_String() = default; static std::shared_ptr create(std::string const& val); - static std::shared_ptr create_utf16(std::string const& utf8_val); + static std::shared_ptr + create_utf16(std::string const& utf8_val); virtual std::shared_ptr shallowCopy(); virtual std::string unparse(); virtual QPDFObject::object_type_e getTypeCode() const;