2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-01-31 02:48:31 +00:00

Switch some code to use empty newArray/newDictionary

This commit is contained in:
Jay Berkenbilt 2012-06-22 10:09:42 -04:00
parent b6bdc0f595
commit 6c0af0844c
4 changed files with 5 additions and 10 deletions

View File

@ -190,8 +190,7 @@ int main(int argc, char* argv[])
else
{
QTC::TC("examples", "pdf-mod-info file no info");
std::map<std::string, QPDFObjectHandle> vacant;
fileinfo = fileinfo.newDictionary(vacant);
fileinfo = QPDFObjectHandle::newDictionary();
filetrailer.replaceKey("/Info", fileinfo);
}
}

View File

@ -655,8 +655,7 @@ QPDFObjectHandle
QPDFObjectHandle::newStream(QPDF* qpdf)
{
QTC::TC("qpdf", "QPDFObjectHandle newStream");
std::map<std::string, QPDFObjectHandle> keys;
QPDFObjectHandle stream_dict = newDictionary(keys);
QPDFObjectHandle stream_dict = newDictionary();
QPDFObjectHandle result = qpdf->makeIndirectObject(
QPDFObjectHandle(
new QPDF_Stream(qpdf, 0, 0, stream_dict, 0, 0)));

View File

@ -340,9 +340,7 @@ void qpdf_set_info_key(qpdf_data qpdf, char const* key, char const* value)
QTC::TC("qpdf", "qpdf-c add info to trailer");
trailer.replaceKey(
"/Info",
qpdf->qpdf->makeIndirectObject(
QPDFObjectHandle::newDictionary(
std::map<std::string, QPDFObjectHandle>())));
qpdf->qpdf->makeIndirectObject(QPDFObjectHandle::newDictionary()));
}
else
{

View File

@ -597,9 +597,8 @@ void runtest(int n, char const* filename)
QPDFObjectHandle qarray = trailer.getKey("/QArray");
// Force qdict but not qarray to resolve
qdict.isDictionary();
std::map<std::string, QPDFObjectHandle> dict_keys;
dict_keys["/NewDict"] = QPDFObjectHandle::newInteger(2);
QPDFObjectHandle new_dict = QPDFObjectHandle::newDictionary(dict_keys);
QPDFObjectHandle new_dict = QPDFObjectHandle::newDictionary();
new_dict.replaceKey("/NewDict", QPDFObjectHandle::newInteger(2));
try
{
// Do it wrong first...