From 56f1b411feeb58b55e92ee77daffaa49c51b7dad Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Tue, 17 May 2022 18:28:50 -0400 Subject: Back out fluent QPDFObjectHandle methods. Keep the andGet methods. I decided these were confusing and inconsistent with how JSON works. They muddle the API rather than improving it. --- libqpdf/QPDFObjectHandle.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'libqpdf/QPDFObjectHandle.cc') diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 4a0a69ae..f3d1883a 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -959,7 +959,7 @@ QPDFObjectHandle::setArrayFromVector(std::vector const& items) } } -QPDFObjectHandle& +void QPDFObjectHandle::insertItem(int at, QPDFObjectHandle const& item) { if (isArray()) { @@ -968,7 +968,6 @@ QPDFObjectHandle::insertItem(int at, QPDFObjectHandle const& item) typeWarning("array", "ignoring attempt to insert item"); QTC::TC("qpdf", "QPDFObjectHandle array ignoring insert item"); } - return *this; } QPDFObjectHandle @@ -978,7 +977,7 @@ QPDFObjectHandle::insertItemAndGet(int at, QPDFObjectHandle const& item) return item; } -QPDFObjectHandle& +void QPDFObjectHandle::appendItem(QPDFObjectHandle const& item) { if (isArray()) { @@ -988,7 +987,6 @@ QPDFObjectHandle::appendItem(QPDFObjectHandle const& item) typeWarning("array", "ignoring attempt to append item"); QTC::TC("qpdf", "QPDFObjectHandle array ignoring append item"); } - return *this; } QPDFObjectHandle @@ -998,7 +996,7 @@ QPDFObjectHandle::appendItemAndGet(QPDFObjectHandle const& item) return item; } -QPDFObjectHandle& +void QPDFObjectHandle::eraseItem(int at) { if (isArray() && (at < getArrayNItems()) && (at >= 0)) { @@ -1012,7 +1010,6 @@ QPDFObjectHandle::eraseItem(int at) QTC::TC("qpdf", "QPDFObjectHandle array ignoring erase item"); } } - return *this; } QPDFObjectHandle @@ -1289,7 +1286,7 @@ QPDFObjectHandle::getOwningQPDF() // Dictionary mutators -QPDFObjectHandle& +void QPDFObjectHandle::replaceKey( std::string const& key, QPDFObjectHandle const& value) { @@ -1300,7 +1297,6 @@ QPDFObjectHandle::replaceKey( typeWarning("dictionary", "ignoring key replacement request"); QTC::TC("qpdf", "QPDFObjectHandle dictionary ignoring replaceKey"); } - return *this; } QPDFObjectHandle @@ -1311,7 +1307,7 @@ QPDFObjectHandle::replaceKeyAndGet( return value; } -QPDFObjectHandle& +void QPDFObjectHandle::removeKey(std::string const& key) { if (isDictionary()) { @@ -1320,7 +1316,6 @@ QPDFObjectHandle::removeKey(std::string const& key) typeWarning("dictionary", "ignoring key removal request"); QTC::TC("qpdf", "QPDFObjectHandle dictionary ignoring removeKey"); } - return *this; } QPDFObjectHandle -- cgit v1.2.3-54-g00ecf