2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-01-03 07:12:28 +00:00

Run format-code

This commit is contained in:
Jay Berkenbilt 2022-06-27 12:50:35 -04:00
parent c810f0f21e
commit a603c1e395
9 changed files with 16 additions and 16 deletions

View File

@ -1466,7 +1466,7 @@ class QPDFObjectHandle
{ {
if (!o.dereference()) { if (!o.dereference()) {
throw std::logic_error("attempted to dereference an" throw std::logic_error("attempted to dereference an"
" uninitialized QPDFObjectHandle"); " uninitialized QPDFObjectHandle");
}; };
return o.obj; return o.obj;
} }

View File

@ -284,8 +284,8 @@ QPDFObjectHandle::isInitialized() const
QPDFObject::object_type_e QPDFObject::object_type_e
QPDFObjectHandle::getTypeCode() QPDFObjectHandle::getTypeCode()
{ {
return dereference() ? return dereference() ? this->obj->getTypeCode()
this->obj->getTypeCode() : QPDFObject::ot_uninitialized; : QPDFObject::ot_uninitialized;
} }
char const* char const*
@ -407,8 +407,7 @@ QPDFObjectHandle::isArray()
bool bool
QPDFObjectHandle::isDictionary() QPDFObjectHandle::isDictionary()
{ {
return dereference() && return dereference() && QPDFObjectTypeAccessor<QPDF_Dictionary>::check(obj);
QPDFObjectTypeAccessor<QPDF_Dictionary>::check(obj);
} }
bool bool
@ -2803,11 +2802,7 @@ QPDFObjectHandle::copyObject(
std::shared_ptr<QPDFObject> new_obj; std::shared_ptr<QPDFObject> new_obj;
if (isBool() || if (isBool() || isInteger() || isName() || isNull() || isReal() ||
isInteger() ||
isName() ||
isNull() ||
isReal() ||
isString()) { isString()) {
new_obj = obj->shallowCopy(); new_obj = obj->shallowCopy();
} else if (isArray()) { } else if (isArray()) {

View File

@ -144,7 +144,7 @@ QPDF_Stream::create(
size_t length) size_t length)
{ {
return do_create( 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<QPDFObject> std::shared_ptr<QPDFObject>

View File

@ -11,7 +11,8 @@ class QPDF_Array: public QPDFObject
{ {
public: public:
virtual ~QPDF_Array() = default; virtual ~QPDF_Array() = default;
static std::shared_ptr<QPDFObject> create(std::vector<QPDFObjectHandle> const& items); static std::shared_ptr<QPDFObject>
create(std::vector<QPDFObjectHandle> const& items);
static std::shared_ptr<QPDFObject> create(SparseOHArray const& items); static std::shared_ptr<QPDFObject> create(SparseOHArray const& items);
virtual std::shared_ptr<QPDFObject> shallowCopy(); virtual std::shared_ptr<QPDFObject> shallowCopy();
virtual std::string unparse(); virtual std::string unparse();

View File

@ -12,7 +12,8 @@ class QPDF_Dictionary: public QPDFObject
{ {
public: public:
virtual ~QPDF_Dictionary() = default; virtual ~QPDF_Dictionary() = default;
static std::shared_ptr<QPDFObject> create(std::map<std::string, QPDFObjectHandle> const& items); static std::shared_ptr<QPDFObject>
create(std::map<std::string, QPDFObjectHandle> const& items);
virtual std::shared_ptr<QPDFObject> shallowCopy(); virtual std::shared_ptr<QPDFObject> shallowCopy();
virtual std::string unparse(); virtual std::string unparse();
virtual JSON getJSON(int json_version); virtual JSON getJSON(int json_version);

View File

@ -13,6 +13,7 @@ class QPDF_Null: public QPDFObject
virtual JSON getJSON(int json_version); virtual JSON getJSON(int json_version);
virtual QPDFObject::object_type_e getTypeCode() const; virtual QPDFObject::object_type_e getTypeCode() const;
virtual char const* getTypeName() const; virtual char const* getTypeName() const;
private: private:
QPDF_Null() = default; QPDF_Null() = default;
}; };

View File

@ -8,8 +8,8 @@ class QPDF_Real: public QPDFObject
public: public:
virtual ~QPDF_Real() = default; virtual ~QPDF_Real() = default;
static std::shared_ptr<QPDFObject> create(std::string const& val); static std::shared_ptr<QPDFObject> create(std::string const& val);
static std::shared_ptr<QPDFObject> create( static std::shared_ptr<QPDFObject>
double value, int decimal_places, bool trim_trailing_zeroes); create(double value, int decimal_places, bool trim_trailing_zeroes);
virtual std::shared_ptr<QPDFObject> shallowCopy(); virtual std::shared_ptr<QPDFObject> shallowCopy();
virtual std::string unparse(); virtual std::string unparse();
virtual JSON getJSON(int json_version); virtual JSON getJSON(int json_version);

View File

@ -13,6 +13,7 @@ class QPDF_Reserved: public QPDFObject
virtual JSON getJSON(int json_version); virtual JSON getJSON(int json_version);
virtual QPDFObject::object_type_e getTypeCode() const; virtual QPDFObject::object_type_e getTypeCode() const;
virtual char const* getTypeName() const; virtual char const* getTypeName() const;
private: private:
QPDF_Reserved() = default; QPDF_Reserved() = default;
}; };

View File

@ -12,7 +12,8 @@ class QPDF_String: public QPDFObject
public: public:
virtual ~QPDF_String() = default; virtual ~QPDF_String() = default;
static std::shared_ptr<QPDFObject> create(std::string const& val); static std::shared_ptr<QPDFObject> create(std::string const& val);
static std::shared_ptr<QPDFObject> create_utf16(std::string const& utf8_val); static std::shared_ptr<QPDFObject>
create_utf16(std::string const& utf8_val);
virtual std::shared_ptr<QPDFObject> shallowCopy(); virtual std::shared_ptr<QPDFObject> shallowCopy();
virtual std::string unparse(); virtual std::string unparse();
virtual QPDFObject::object_type_e getTypeCode() const; virtual QPDFObject::object_type_e getTypeCode() const;