From ce3406e93f0de0946d2abed6179579caf1433d4e Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 30 Jan 2022 08:18:04 -0500 Subject: JSONHandler: pass JSON object to dict start function If some keys depend on others, we have to check up front since there is no control of what order key handlers will be called. Anyway, keys are unordered in json, so we don't want to depend on ordering. --- libqpdf/JSONHandler.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libqpdf/JSONHandler.cc') diff --git a/libqpdf/JSONHandler.cc b/libqpdf/JSONHandler.cc index 28e97218..121ae8a2 100644 --- a/libqpdf/JSONHandler.cc +++ b/libqpdf/JSONHandler.cc @@ -49,7 +49,7 @@ JSONHandler::addBoolHandler(bool_handler_t fn) } void -JSONHandler::addDictHandlers(void_handler_t start_fn, void_handler_t end_fn) +JSONHandler::addDictHandlers(json_handler_t start_fn, void_handler_t end_fn) { this->m->h.dict_start_handler = start_fn; this->m->h.dict_end_handler = end_fn; @@ -111,7 +111,7 @@ JSONHandler::handle(std::string const& path, JSON j) } if (this->m->h.dict_start_handler && j.isDictionary()) { - this->m->h.dict_start_handler(path); + this->m->h.dict_start_handler(path, j); std::string path_base = path; if (path_base != ".") { -- cgit v1.2.3-54-g00ecf