diff options
Diffstat (limited to 'libqpdf/QPDF_Dictionary.cc')
-rw-r--r-- | libqpdf/QPDF_Dictionary.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libqpdf/QPDF_Dictionary.cc b/libqpdf/QPDF_Dictionary.cc index ccaab4a8..838a37e6 100644 --- a/libqpdf/QPDF_Dictionary.cc +++ b/libqpdf/QPDF_Dictionary.cc @@ -92,3 +92,17 @@ QPDF_Dictionary::removeKey(std::string const& key) // no-op if key does not exist this->items.erase(key); } + +void +QPDF_Dictionary::replaceOrRemoveKey(std::string const& key, + QPDFObjectHandle value) +{ + if (value.isNull()) + { + removeKey(key); + } + else + { + replaceKey(key, value); + } +} |