Commit d11d75a9e7593596414ac9987928338859fb967d

Authored by m-holger
1 parent 7eda035b

Refactor `ObjUser` class: remove unused `ou_bad` type, delete default constructo…

…r,  and revise enum initialization. Clean up unused error handling in linearization logic.
libqpdf/QPDF_linearization.cc
@@ -1104,10 +1104,6 @@ QPDF::calculateLinearizationData(T const& object_stream_data) @@ -1104,10 +1104,6 @@ QPDF::calculateLinearizationData(T const& object_stream_data)
1104 case ObjUser::ou_root: 1104 case ObjUser::ou_root:
1105 is_root = true; 1105 is_root = true;
1106 break; 1106 break;
1107 -  
1108 - case ObjUser::ou_bad:  
1109 - stopOnError("INTERNAL ERROR: QPDF::calculateLinearizationData: invalid user type");  
1110 - break;  
1111 } 1107 }
1112 } 1108 }
1113 1109
libqpdf/qpdf/QPDF_private.hh
@@ -415,9 +415,9 @@ struct QPDF::CHSharedObject @@ -415,9 +415,9 @@ struct QPDF::CHSharedObject
415 class QPDF::ObjUser 415 class QPDF::ObjUser
416 { 416 {
417 public: 417 public:
418 - enum user_e { ou_bad, ou_page, ou_thumb, ou_trailer_key, ou_root_key, ou_root }; 418 + enum user_e {ou_page = 1, ou_thumb, ou_trailer_key, ou_root_key, ou_root };
419 419
420 - ObjUser() = default; 420 + ObjUser() = delete;
421 421
422 // type must be ou_root 422 // type must be ou_root
423 ObjUser(user_e type); 423 ObjUser(user_e type);
@@ -430,7 +430,7 @@ class QPDF::ObjUser @@ -430,7 +430,7 @@ class QPDF::ObjUser
430 430
431 bool operator<(ObjUser const&) const; 431 bool operator<(ObjUser const&) const;
432 432
433 - user_e ou_type{ou_bad}; 433 + user_e ou_type;
434 int pageno{0}; // if ou_page; 434 int pageno{0}; // if ou_page;
435 std::string key; // if ou_trailer_key or ou_root_key 435 std::string key; // if ou_trailer_key or ou_root_key
436 }; 436 };