Commit 6c0af0844c587c64079d345e67cf1de1d5606495
1 parent
b6bdc0f5
Switch some code to use empty newArray/newDictionary
Showing
4 changed files
with
5 additions
and
10 deletions
examples/pdf-mod-info.cc
| ... | ... | @@ -190,8 +190,7 @@ int main(int argc, char* argv[]) |
| 190 | 190 | else |
| 191 | 191 | { |
| 192 | 192 | QTC::TC("examples", "pdf-mod-info file no info"); |
| 193 | - std::map<std::string, QPDFObjectHandle> vacant; | |
| 194 | - fileinfo = fileinfo.newDictionary(vacant); | |
| 193 | + fileinfo = QPDFObjectHandle::newDictionary(); | |
| 195 | 194 | filetrailer.replaceKey("/Info", fileinfo); |
| 196 | 195 | } |
| 197 | 196 | } | ... | ... |
libqpdf/QPDFObjectHandle.cc
| ... | ... | @@ -655,8 +655,7 @@ QPDFObjectHandle |
| 655 | 655 | QPDFObjectHandle::newStream(QPDF* qpdf) |
| 656 | 656 | { |
| 657 | 657 | QTC::TC("qpdf", "QPDFObjectHandle newStream"); |
| 658 | - std::map<std::string, QPDFObjectHandle> keys; | |
| 659 | - QPDFObjectHandle stream_dict = newDictionary(keys); | |
| 658 | + QPDFObjectHandle stream_dict = newDictionary(); | |
| 660 | 659 | QPDFObjectHandle result = qpdf->makeIndirectObject( |
| 661 | 660 | QPDFObjectHandle( |
| 662 | 661 | new QPDF_Stream(qpdf, 0, 0, stream_dict, 0, 0))); | ... | ... |
libqpdf/qpdf-c.cc
| ... | ... | @@ -340,9 +340,7 @@ void qpdf_set_info_key(qpdf_data qpdf, char const* key, char const* value) |
| 340 | 340 | QTC::TC("qpdf", "qpdf-c add info to trailer"); |
| 341 | 341 | trailer.replaceKey( |
| 342 | 342 | "/Info", |
| 343 | - qpdf->qpdf->makeIndirectObject( | |
| 344 | - QPDFObjectHandle::newDictionary( | |
| 345 | - std::map<std::string, QPDFObjectHandle>()))); | |
| 343 | + qpdf->qpdf->makeIndirectObject(QPDFObjectHandle::newDictionary())); | |
| 346 | 344 | } |
| 347 | 345 | else |
| 348 | 346 | { | ... | ... |
qpdf/test_driver.cc
| ... | ... | @@ -597,9 +597,8 @@ void runtest(int n, char const* filename) |
| 597 | 597 | QPDFObjectHandle qarray = trailer.getKey("/QArray"); |
| 598 | 598 | // Force qdict but not qarray to resolve |
| 599 | 599 | qdict.isDictionary(); |
| 600 | - std::map<std::string, QPDFObjectHandle> dict_keys; | |
| 601 | - dict_keys["/NewDict"] = QPDFObjectHandle::newInteger(2); | |
| 602 | - QPDFObjectHandle new_dict = QPDFObjectHandle::newDictionary(dict_keys); | |
| 600 | + QPDFObjectHandle new_dict = QPDFObjectHandle::newDictionary(); | |
| 601 | + new_dict.replaceKey("/NewDict", QPDFObjectHandle::newInteger(2)); | |
| 603 | 602 | try |
| 604 | 603 | { |
| 605 | 604 | // Do it wrong first... | ... | ... |