Commit 1174cd2c8dffa9d4fd5b8a075d4575dfb3f3775a
1 parent
db288584
Refactor `QPDFObjectHandle` and `QPDF_Array` to simplify object access and manipulation.
Showing
2 changed files
with
3 additions
and
3 deletions
libqpdf/QPDFObjectHandle.cc
| @@ -486,7 +486,7 @@ BaseHandle::write_json(int json_version, JSON::Writer& p) const | @@ -486,7 +486,7 @@ BaseHandle::write_json(int json_version, JSON::Writer& p) const | ||
| 486 | } else { | 486 | } else { |
| 487 | for (auto const& item: a.elements) { | 487 | for (auto const& item: a.elements) { |
| 488 | p.writeNext(); | 488 | p.writeNext(); |
| 489 | - auto item_og = item.getObj()->getObjGen(); | 489 | + auto item_og = item.id_gen(); |
| 490 | if (item_og.isIndirect()) { | 490 | if (item_og.isIndirect()) { |
| 491 | p << "\"" << item_og.unparse(' ') << " R\""; | 491 | p << "\"" << item_og.unparse(' ') << " R\""; |
| 492 | } else { | 492 | } else { |
libqpdf/QPDF_Array.cc
| @@ -253,10 +253,10 @@ Array::insert(int at_i, QPDFObjectHandle const& item) | @@ -253,10 +253,10 @@ Array::insert(int at_i, QPDFObjectHandle const& item) | ||
| 253 | break; | 253 | break; |
| 254 | } | 254 | } |
| 255 | } | 255 | } |
| 256 | - a->sp->elements[at] = item.getObj(); | 256 | + a->sp->elements[at] = item; |
| 257 | ++a->sp->size; | 257 | ++a->sp->size; |
| 258 | } else { | 258 | } else { |
| 259 | - a->elements.insert(a->elements.cbegin() + at_i, item.getObj()); | 259 | + a->elements.insert(a->elements.cbegin() + at_i, item); |
| 260 | } | 260 | } |
| 261 | return true; | 261 | return true; |
| 262 | } | 262 | } |