diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-04-30 02:21:07 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-04-30 02:28:02 +0200 |
commit | d8fdf632a979a7adb4a6423fd55ef1971fb06afd (patch) | |
tree | 5a736f66733a3b4fa52f5519e1877d4841d3a8a3 /libqpdf/QPDFEmbeddedFileDocumentHelper.cc | |
parent | e80fad86e95af978ada2a6cc5c4b209a1f65f7c0 (diff) | |
download | qpdf-d8fdf632a979a7adb4a6423fd55ef1971fb06afd.tar.zst |
Use replaceKeyAndGet in a few places in existing code
Diffstat (limited to 'libqpdf/QPDFEmbeddedFileDocumentHelper.cc')
-rw-r--r-- | libqpdf/QPDFEmbeddedFileDocumentHelper.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libqpdf/QPDFEmbeddedFileDocumentHelper.cc b/libqpdf/QPDFEmbeddedFileDocumentHelper.cc index 826e0d87..4b61dfe3 100644 --- a/libqpdf/QPDFEmbeddedFileDocumentHelper.cc +++ b/libqpdf/QPDFEmbeddedFileDocumentHelper.cc @@ -62,8 +62,8 @@ QPDFEmbeddedFileDocumentHelper::initEmbeddedFiles() auto root = qpdf.getRoot(); auto names = root.getKey("/Names"); if (!names.isDictionary()) { - names = QPDFObjectHandle::newDictionary(); - root.replaceKey("/Names", names); + names = + root.replaceKeyAndGet("/Names", QPDFObjectHandle::newDictionary()); } auto embedded_files = names.getKey("/EmbeddedFiles"); if (!embedded_files.isDictionary()) { |