2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 10:58:58 +00:00

Remove QPDFObjectHandle::Factory::newStream

This commit is contained in:
m-holger 2022-09-27 11:42:47 +01:00 committed by Jay Berkenbilt
parent 743a735ee0
commit bf347dfb73
3 changed files with 6 additions and 39 deletions

View File

@ -1496,17 +1496,6 @@ class QPDFObjectHandle
{
return QPDFObjectHandle(obj);
}
static QPDFObjectHandle
newStream(
QPDF* qpdf,
QPDFObjGen const& og,
QPDFObjectHandle stream_dict,
qpdf_offset_t offset,
size_t length)
{
return QPDFObjectHandle::newStream(
qpdf, og, stream_dict, offset, length);
}
};
friend class Factory;
@ -1621,14 +1610,6 @@ class QPDFObjectHandle
{
}
// Private object factory methods
static QPDFObjectHandle newStream(
QPDF* qpdf,
QPDFObjGen const& og,
QPDFObjectHandle stream_dict,
qpdf_offset_t offset,
size_t length);
QPDF_Array* asArray();
QPDF_Bool* asBool();
QPDF_Dictionary* asDictionary();

View File

@ -1534,8 +1534,10 @@ QPDF::readObject(
throw e;
}
}
object = QPDFObjectHandle::Factory::newStream(
this, og, object, stream_offset, length);
auto stream =
QPDF_Stream::create(this, og, object, stream_offset, length);
stream->setParsedOffset(stream_offset);
object = newIndirect(og, stream);
} else {
input->seek(cur_offset, SEEK_SET);
}
@ -2040,8 +2042,8 @@ QPDF::reserveObjectIfNotExists(QPDFObjGen const& og)
QPDFObjectHandle
QPDF::reserveStream(QPDFObjGen const& og)
{
return QPDFObjectHandle::Factory::newStream(
this, og, QPDFObjectHandle::newDictionary(), 0, 0);
return QPDFObjectHandle::Factory::newIndirect(
QPDF_Stream::create(this, og, QPDFObjectHandle::newDictionary(), 0, 0));
}
QPDFObjectHandle

View File

@ -2141,22 +2141,6 @@ QPDFObjectHandle::newDictionary(
return QPDFObjectHandle(QPDF_Dictionary::create(items));
}
QPDFObjectHandle
QPDFObjectHandle::newStream(
QPDF* qpdf,
QPDFObjGen const& og,
QPDFObjectHandle stream_dict,
qpdf_offset_t offset,
size_t length)
{
QPDFObjectHandle result = QPDFObjectHandle(
QPDF_Stream::create(qpdf, og, stream_dict, offset, length));
if (offset) {
result.setParsedOffset(offset);
}
return result;
}
QPDFObjectHandle
QPDFObjectHandle::newStream(QPDF* qpdf)
{