Commit bf347dfb739f7012b570681d1260c9f6c0acc48b
Committed by
Jay Berkenbilt
1 parent
743a735e
Remove QPDFObjectHandle::Factory::newStream
Showing
3 changed files
with
6 additions
and
39 deletions
include/qpdf/QPDFObjectHandle.hh
| @@ -1496,17 +1496,6 @@ class QPDFObjectHandle | @@ -1496,17 +1496,6 @@ class QPDFObjectHandle | ||
| 1496 | { | 1496 | { |
| 1497 | return QPDFObjectHandle(obj); | 1497 | return QPDFObjectHandle(obj); |
| 1498 | } | 1498 | } |
| 1499 | - static QPDFObjectHandle | ||
| 1500 | - newStream( | ||
| 1501 | - QPDF* qpdf, | ||
| 1502 | - QPDFObjGen const& og, | ||
| 1503 | - QPDFObjectHandle stream_dict, | ||
| 1504 | - qpdf_offset_t offset, | ||
| 1505 | - size_t length) | ||
| 1506 | - { | ||
| 1507 | - return QPDFObjectHandle::newStream( | ||
| 1508 | - qpdf, og, stream_dict, offset, length); | ||
| 1509 | - } | ||
| 1510 | }; | 1499 | }; |
| 1511 | friend class Factory; | 1500 | friend class Factory; |
| 1512 | 1501 | ||
| @@ -1621,14 +1610,6 @@ class QPDFObjectHandle | @@ -1621,14 +1610,6 @@ class QPDFObjectHandle | ||
| 1621 | { | 1610 | { |
| 1622 | } | 1611 | } |
| 1623 | 1612 | ||
| 1624 | - // Private object factory methods | ||
| 1625 | - static QPDFObjectHandle newStream( | ||
| 1626 | - QPDF* qpdf, | ||
| 1627 | - QPDFObjGen const& og, | ||
| 1628 | - QPDFObjectHandle stream_dict, | ||
| 1629 | - qpdf_offset_t offset, | ||
| 1630 | - size_t length); | ||
| 1631 | - | ||
| 1632 | QPDF_Array* asArray(); | 1613 | QPDF_Array* asArray(); |
| 1633 | QPDF_Bool* asBool(); | 1614 | QPDF_Bool* asBool(); |
| 1634 | QPDF_Dictionary* asDictionary(); | 1615 | QPDF_Dictionary* asDictionary(); |
libqpdf/QPDF.cc
| @@ -1534,8 +1534,10 @@ QPDF::readObject( | @@ -1534,8 +1534,10 @@ QPDF::readObject( | ||
| 1534 | throw e; | 1534 | throw e; |
| 1535 | } | 1535 | } |
| 1536 | } | 1536 | } |
| 1537 | - object = QPDFObjectHandle::Factory::newStream( | ||
| 1538 | - this, og, object, stream_offset, length); | 1537 | + auto stream = |
| 1538 | + QPDF_Stream::create(this, og, object, stream_offset, length); | ||
| 1539 | + stream->setParsedOffset(stream_offset); | ||
| 1540 | + object = newIndirect(og, stream); | ||
| 1539 | } else { | 1541 | } else { |
| 1540 | input->seek(cur_offset, SEEK_SET); | 1542 | input->seek(cur_offset, SEEK_SET); |
| 1541 | } | 1543 | } |
| @@ -2040,8 +2042,8 @@ QPDF::reserveObjectIfNotExists(QPDFObjGen const& og) | @@ -2040,8 +2042,8 @@ QPDF::reserveObjectIfNotExists(QPDFObjGen const& og) | ||
| 2040 | QPDFObjectHandle | 2042 | QPDFObjectHandle |
| 2041 | QPDF::reserveStream(QPDFObjGen const& og) | 2043 | QPDF::reserveStream(QPDFObjGen const& og) |
| 2042 | { | 2044 | { |
| 2043 | - return QPDFObjectHandle::Factory::newStream( | ||
| 2044 | - this, og, QPDFObjectHandle::newDictionary(), 0, 0); | 2045 | + return QPDFObjectHandle::Factory::newIndirect( |
| 2046 | + QPDF_Stream::create(this, og, QPDFObjectHandle::newDictionary(), 0, 0)); | ||
| 2045 | } | 2047 | } |
| 2046 | 2048 | ||
| 2047 | QPDFObjectHandle | 2049 | QPDFObjectHandle |
libqpdf/QPDFObjectHandle.cc
| @@ -2142,22 +2142,6 @@ QPDFObjectHandle::newDictionary( | @@ -2142,22 +2142,6 @@ QPDFObjectHandle::newDictionary( | ||
| 2142 | } | 2142 | } |
| 2143 | 2143 | ||
| 2144 | QPDFObjectHandle | 2144 | QPDFObjectHandle |
| 2145 | -QPDFObjectHandle::newStream( | ||
| 2146 | - QPDF* qpdf, | ||
| 2147 | - QPDFObjGen const& og, | ||
| 2148 | - QPDFObjectHandle stream_dict, | ||
| 2149 | - qpdf_offset_t offset, | ||
| 2150 | - size_t length) | ||
| 2151 | -{ | ||
| 2152 | - QPDFObjectHandle result = QPDFObjectHandle( | ||
| 2153 | - QPDF_Stream::create(qpdf, og, stream_dict, offset, length)); | ||
| 2154 | - if (offset) { | ||
| 2155 | - result.setParsedOffset(offset); | ||
| 2156 | - } | ||
| 2157 | - return result; | ||
| 2158 | -} | ||
| 2159 | - | ||
| 2160 | -QPDFObjectHandle | ||
| 2161 | QPDFObjectHandle::newStream(QPDF* qpdf) | 2145 | QPDFObjectHandle::newStream(QPDF* qpdf) |
| 2162 | { | 2146 | { |
| 2163 | if (qpdf == nullptr) { | 2147 | if (qpdf == nullptr) { |