diff options
author | Jay Berkenbilt <ejb@ql.org> | 2021-03-04 21:40:56 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2021-03-04 21:59:46 +0100 |
commit | 0b77f2cf2646019331d3adc21985052319bdba4c (patch) | |
tree | 1035d1a1afdb8cd2a26ba1a258c1297b1d6e41cc | |
parent | f68e25c7f278bbfee095d43d4405a74df0bd22ff (diff) | |
download | qpdf-0b77f2cf2646019331d3adc21985052319bdba4c.tar.zst |
Revert non-binary-compatible handleWarning change -- see TODO (ABI)
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | TODO | 5 | ||||
-rw-r--r-- | include/qpdf/QPDFObjectHandle.hh | 11 | ||||
-rw-r--r-- | libqpdf/QPDFObjectHandle.cc | 17 | ||||
-rw-r--r-- | manual/qpdf-manual.xml | 9 |
5 files changed, 6 insertions, 40 deletions
@@ -51,10 +51,6 @@ bugs where it removes unreferenced resources that it isn't supposed to. - * QPDFObjectHandle::ParserCallbacks: add virtual handleWarning - method, and provide default (empty) implementation of it and - handleEOF(). - * Add QPDF::numWarnings() -- useful to tell whether any warnings were issued by a specific bit of code. @@ -164,6 +164,11 @@ Comments appear in the code prefixed by "ABI" * Consider having addArrayItem, replaceKey, etc. return the new value so you can say auto oh = dict.replaceKey("/Key", QPDFObjectHandle::newSomething()); +* Added QPDFObjectHandle::ParserCallbacks::handleWarning but had to + revert because it was not binary compatible. Consider re-adding. The + commit that added this comment includes the reverting of the change. + The previous commit removes the code that was calling and using + handleWarning. Page splitting/merging ====================== diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index 238dd6e3..e57179b5 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -224,16 +224,7 @@ class QPDFObjectHandle virtual void handleObject( QPDFObjectHandle, size_t offset, size_t length); - // handleWarning is called if a warning was issued during the - // parsing of the most recent object. There's no good way to - // get information about the warning, but implementors can use - // this to become aware that there was some problem while - // parsing this content stream. - QPDF_DLL - virtual void handleWarning(); - - QPDF_DLL - virtual void handleEOF(); + virtual void handleEOF() = 0; // Override this if you want to know the full size of the // contents, possibly after concatenation of multiple streams. diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index e7d84b4c..27740f09 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -152,16 +152,6 @@ QPDFObjectHandle::ParserCallbacks::handleObject( } void -QPDFObjectHandle::ParserCallbacks::handleWarning() -{ -} - -void -QPDFObjectHandle::ParserCallbacks::handleEOF() -{ -} - -void QPDFObjectHandle::ParserCallbacks::contentSize(size_t) { // Ignore by default; overriding this is optional. @@ -1983,15 +1973,9 @@ QPDFObjectHandle::parseContentStream_data( tokenizer.readToken(input, "content", true); qpdf_offset_t offset = input->getLastOffset(); input->seek(offset, SEEK_SET); - size_t before_nwarnings = (context ? context->numWarnings() : 0); QPDFObjectHandle obj = parseInternal(input, "content", tokenizer, empty, 0, context, true); - size_t after_nwarnings = (context ? context->numWarnings() : 0); - if (after_nwarnings > before_nwarnings) - { - callbacks->handleWarning(); - } if (! obj.isInitialized()) { // EOF @@ -2018,7 +2002,6 @@ QPDFObjectHandle::parseContentStream_data( QPDFExc(qpdf_e_damaged_pdf, input->getName(), "stream data", input->tell(), "EOF found while reading inline image")); - callbacks->handleWarning(); } else { diff --git a/manual/qpdf-manual.xml b/manual/qpdf-manual.xml index d6098563..59d4dfb3 100644 --- a/manual/qpdf-manual.xml +++ b/manual/qpdf-manual.xml @@ -5127,15 +5127,6 @@ print "\n"; </listitem> <listitem> <para> - The virtual method - <function>QPDFObjectHandle::ParserCallbacks::handleWarning</function> - is now called whenever a warning is encountered while - parsing a content stream. Prior to this, the caller had no - way to know if this had happened. - </para> - </listitem> - <listitem> - <para> The method <function>QPDF::numWarnings</function> was added so that you can tell whether any warnings happened during a specific block of code. |