Commit a603c1e395d039e71ca8e4c70bc43f2f9d2d604b
1 parent
c810f0f2
Run format-code
Showing
9 changed files
with
16 additions
and
16 deletions
include/qpdf/QPDFObjectHandle.hh
| @@ -1466,7 +1466,7 @@ class QPDFObjectHandle | @@ -1466,7 +1466,7 @@ class QPDFObjectHandle | ||
| 1466 | { | 1466 | { |
| 1467 | if (!o.dereference()) { | 1467 | if (!o.dereference()) { |
| 1468 | throw std::logic_error("attempted to dereference an" | 1468 | throw std::logic_error("attempted to dereference an" |
| 1469 | - " uninitialized QPDFObjectHandle"); | 1469 | + " uninitialized QPDFObjectHandle"); |
| 1470 | }; | 1470 | }; |
| 1471 | return o.obj; | 1471 | return o.obj; |
| 1472 | } | 1472 | } |
libqpdf/QPDFObjectHandle.cc
| @@ -284,8 +284,8 @@ QPDFObjectHandle::isInitialized() const | @@ -284,8 +284,8 @@ QPDFObjectHandle::isInitialized() const | ||
| 284 | QPDFObject::object_type_e | 284 | QPDFObject::object_type_e |
| 285 | QPDFObjectHandle::getTypeCode() | 285 | QPDFObjectHandle::getTypeCode() |
| 286 | { | 286 | { |
| 287 | - return dereference() ? | ||
| 288 | - this->obj->getTypeCode() : QPDFObject::ot_uninitialized; | 287 | + return dereference() ? this->obj->getTypeCode() |
| 288 | + : QPDFObject::ot_uninitialized; | ||
| 289 | } | 289 | } |
| 290 | 290 | ||
| 291 | char const* | 291 | char const* |
| @@ -407,8 +407,7 @@ QPDFObjectHandle::isArray() | @@ -407,8 +407,7 @@ QPDFObjectHandle::isArray() | ||
| 407 | bool | 407 | bool |
| 408 | QPDFObjectHandle::isDictionary() | 408 | QPDFObjectHandle::isDictionary() |
| 409 | { | 409 | { |
| 410 | - return dereference() && | ||
| 411 | - QPDFObjectTypeAccessor<QPDF_Dictionary>::check(obj); | 410 | + return dereference() && QPDFObjectTypeAccessor<QPDF_Dictionary>::check(obj); |
| 412 | } | 411 | } |
| 413 | 412 | ||
| 414 | bool | 413 | bool |
| @@ -2803,11 +2802,7 @@ QPDFObjectHandle::copyObject( | @@ -2803,11 +2802,7 @@ QPDFObjectHandle::copyObject( | ||
| 2803 | 2802 | ||
| 2804 | std::shared_ptr<QPDFObject> new_obj; | 2803 | std::shared_ptr<QPDFObject> new_obj; |
| 2805 | 2804 | ||
| 2806 | - if (isBool() || | ||
| 2807 | - isInteger() || | ||
| 2808 | - isName() || | ||
| 2809 | - isNull() || | ||
| 2810 | - isReal() || | 2805 | + if (isBool() || isInteger() || isName() || isNull() || isReal() || |
| 2811 | isString()) { | 2806 | isString()) { |
| 2812 | new_obj = obj->shallowCopy(); | 2807 | new_obj = obj->shallowCopy(); |
| 2813 | } else if (isArray()) { | 2808 | } else if (isArray()) { |
libqpdf/QPDF_Stream.cc
| @@ -144,7 +144,7 @@ QPDF_Stream::create( | @@ -144,7 +144,7 @@ QPDF_Stream::create( | ||
| 144 | size_t length) | 144 | size_t length) |
| 145 | { | 145 | { |
| 146 | return do_create( | 146 | return do_create( |
| 147 | - new QPDF_Stream(qpdf, objid, generation, stream_dict, offset,length)); | 147 | + new QPDF_Stream(qpdf, objid, generation, stream_dict, offset, length)); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | std::shared_ptr<QPDFObject> | 150 | std::shared_ptr<QPDFObject> |
libqpdf/qpdf/QPDF_Array.hh
| @@ -11,7 +11,8 @@ class QPDF_Array: public QPDFObject | @@ -11,7 +11,8 @@ class QPDF_Array: public QPDFObject | ||
| 11 | { | 11 | { |
| 12 | public: | 12 | public: |
| 13 | virtual ~QPDF_Array() = default; | 13 | virtual ~QPDF_Array() = default; |
| 14 | - static std::shared_ptr<QPDFObject> create(std::vector<QPDFObjectHandle> const& items); | 14 | + static std::shared_ptr<QPDFObject> |
| 15 | + create(std::vector<QPDFObjectHandle> const& items); | ||
| 15 | static std::shared_ptr<QPDFObject> create(SparseOHArray const& items); | 16 | static std::shared_ptr<QPDFObject> create(SparseOHArray const& items); |
| 16 | virtual std::shared_ptr<QPDFObject> shallowCopy(); | 17 | virtual std::shared_ptr<QPDFObject> shallowCopy(); |
| 17 | virtual std::string unparse(); | 18 | virtual std::string unparse(); |
libqpdf/qpdf/QPDF_Dictionary.hh
| @@ -12,7 +12,8 @@ class QPDF_Dictionary: public QPDFObject | @@ -12,7 +12,8 @@ class QPDF_Dictionary: public QPDFObject | ||
| 12 | { | 12 | { |
| 13 | public: | 13 | public: |
| 14 | virtual ~QPDF_Dictionary() = default; | 14 | virtual ~QPDF_Dictionary() = default; |
| 15 | - static std::shared_ptr<QPDFObject> create(std::map<std::string, QPDFObjectHandle> const& items); | 15 | + static std::shared_ptr<QPDFObject> |
| 16 | + create(std::map<std::string, QPDFObjectHandle> const& items); | ||
| 16 | virtual std::shared_ptr<QPDFObject> shallowCopy(); | 17 | virtual std::shared_ptr<QPDFObject> shallowCopy(); |
| 17 | virtual std::string unparse(); | 18 | virtual std::string unparse(); |
| 18 | virtual JSON getJSON(int json_version); | 19 | virtual JSON getJSON(int json_version); |
libqpdf/qpdf/QPDF_Null.hh
| @@ -13,6 +13,7 @@ class QPDF_Null: public QPDFObject | @@ -13,6 +13,7 @@ class QPDF_Null: public QPDFObject | ||
| 13 | virtual JSON getJSON(int json_version); | 13 | virtual JSON getJSON(int json_version); |
| 14 | virtual QPDFObject::object_type_e getTypeCode() const; | 14 | virtual QPDFObject::object_type_e getTypeCode() const; |
| 15 | virtual char const* getTypeName() const; | 15 | virtual char const* getTypeName() const; |
| 16 | + | ||
| 16 | private: | 17 | private: |
| 17 | QPDF_Null() = default; | 18 | QPDF_Null() = default; |
| 18 | }; | 19 | }; |
libqpdf/qpdf/QPDF_Real.hh
| @@ -8,8 +8,8 @@ class QPDF_Real: public QPDFObject | @@ -8,8 +8,8 @@ class QPDF_Real: public QPDFObject | ||
| 8 | public: | 8 | public: |
| 9 | virtual ~QPDF_Real() = default; | 9 | virtual ~QPDF_Real() = default; |
| 10 | static std::shared_ptr<QPDFObject> create(std::string const& val); | 10 | static std::shared_ptr<QPDFObject> create(std::string const& val); |
| 11 | - static std::shared_ptr<QPDFObject> create( | ||
| 12 | - double value, int decimal_places, bool trim_trailing_zeroes); | 11 | + static std::shared_ptr<QPDFObject> |
| 12 | + create(double value, int decimal_places, bool trim_trailing_zeroes); | ||
| 13 | virtual std::shared_ptr<QPDFObject> shallowCopy(); | 13 | virtual std::shared_ptr<QPDFObject> shallowCopy(); |
| 14 | virtual std::string unparse(); | 14 | virtual std::string unparse(); |
| 15 | virtual JSON getJSON(int json_version); | 15 | virtual JSON getJSON(int json_version); |
libqpdf/qpdf/QPDF_Reserved.hh
| @@ -13,6 +13,7 @@ class QPDF_Reserved: public QPDFObject | @@ -13,6 +13,7 @@ class QPDF_Reserved: public QPDFObject | ||
| 13 | virtual JSON getJSON(int json_version); | 13 | virtual JSON getJSON(int json_version); |
| 14 | virtual QPDFObject::object_type_e getTypeCode() const; | 14 | virtual QPDFObject::object_type_e getTypeCode() const; |
| 15 | virtual char const* getTypeName() const; | 15 | virtual char const* getTypeName() const; |
| 16 | + | ||
| 16 | private: | 17 | private: |
| 17 | QPDF_Reserved() = default; | 18 | QPDF_Reserved() = default; |
| 18 | }; | 19 | }; |
libqpdf/qpdf/QPDF_String.hh
| @@ -12,7 +12,8 @@ class QPDF_String: public QPDFObject | @@ -12,7 +12,8 @@ class QPDF_String: public QPDFObject | ||
| 12 | public: | 12 | public: |
| 13 | virtual ~QPDF_String() = default; | 13 | virtual ~QPDF_String() = default; |
| 14 | static std::shared_ptr<QPDFObject> create(std::string const& val); | 14 | static std::shared_ptr<QPDFObject> create(std::string const& val); |
| 15 | - static std::shared_ptr<QPDFObject> create_utf16(std::string const& utf8_val); | 15 | + static std::shared_ptr<QPDFObject> |
| 16 | + create_utf16(std::string const& utf8_val); | ||
| 16 | virtual std::shared_ptr<QPDFObject> shallowCopy(); | 17 | virtual std::shared_ptr<QPDFObject> shallowCopy(); |
| 17 | virtual std::string unparse(); | 18 | virtual std::string unparse(); |
| 18 | virtual QPDFObject::object_type_e getTypeCode() const; | 19 | virtual QPDFObject::object_type_e getTypeCode() const; |