mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-05 08:02:11 +00:00
Revert non-binary-compatible handleWarning change -- see TODO (ABI)
This commit is contained in:
parent
f68e25c7f2
commit
0b77f2cf26
@ -51,10 +51,6 @@
|
|||||||
bugs where it removes unreferenced resources that it isn't
|
bugs where it removes unreferenced resources that it isn't
|
||||||
supposed to.
|
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
|
* Add QPDF::numWarnings() -- useful to tell whether any warnings
|
||||||
were issued by a specific bit of code.
|
were issued by a specific bit of code.
|
||||||
|
|
||||||
|
5
TODO
5
TODO
@ -164,6 +164,11 @@ Comments appear in the code prefixed by "ABI"
|
|||||||
* Consider having addArrayItem, replaceKey, etc. return the new value
|
* Consider having addArrayItem, replaceKey, etc. return the new value
|
||||||
so you can say
|
so you can say
|
||||||
auto oh = dict.replaceKey("/Key", QPDFObjectHandle::newSomething());
|
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
|
Page splitting/merging
|
||||||
======================
|
======================
|
||||||
|
@ -224,16 +224,7 @@ class QPDFObjectHandle
|
|||||||
virtual void handleObject(
|
virtual void handleObject(
|
||||||
QPDFObjectHandle, size_t offset, size_t length);
|
QPDFObjectHandle, size_t offset, size_t length);
|
||||||
|
|
||||||
// handleWarning is called if a warning was issued during the
|
virtual void handleEOF() = 0;
|
||||||
// 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();
|
|
||||||
|
|
||||||
// Override this if you want to know the full size of the
|
// Override this if you want to know the full size of the
|
||||||
// contents, possibly after concatenation of multiple streams.
|
// contents, possibly after concatenation of multiple streams.
|
||||||
|
@ -151,16 +151,6 @@ QPDFObjectHandle::ParserCallbacks::handleObject(
|
|||||||
handleObject(oh);
|
handleObject(oh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
QPDFObjectHandle::ParserCallbacks::handleWarning()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
QPDFObjectHandle::ParserCallbacks::handleEOF()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
QPDFObjectHandle::ParserCallbacks::contentSize(size_t)
|
QPDFObjectHandle::ParserCallbacks::contentSize(size_t)
|
||||||
{
|
{
|
||||||
@ -1983,15 +1973,9 @@ QPDFObjectHandle::parseContentStream_data(
|
|||||||
tokenizer.readToken(input, "content", true);
|
tokenizer.readToken(input, "content", true);
|
||||||
qpdf_offset_t offset = input->getLastOffset();
|
qpdf_offset_t offset = input->getLastOffset();
|
||||||
input->seek(offset, SEEK_SET);
|
input->seek(offset, SEEK_SET);
|
||||||
size_t before_nwarnings = (context ? context->numWarnings() : 0);
|
|
||||||
QPDFObjectHandle obj =
|
QPDFObjectHandle obj =
|
||||||
parseInternal(input, "content", tokenizer,
|
parseInternal(input, "content", tokenizer,
|
||||||
empty, 0, context, true);
|
empty, 0, context, true);
|
||||||
size_t after_nwarnings = (context ? context->numWarnings() : 0);
|
|
||||||
if (after_nwarnings > before_nwarnings)
|
|
||||||
{
|
|
||||||
callbacks->handleWarning();
|
|
||||||
}
|
|
||||||
if (! obj.isInitialized())
|
if (! obj.isInitialized())
|
||||||
{
|
{
|
||||||
// EOF
|
// EOF
|
||||||
@ -2018,7 +2002,6 @@ QPDFObjectHandle::parseContentStream_data(
|
|||||||
QPDFExc(qpdf_e_damaged_pdf, input->getName(),
|
QPDFExc(qpdf_e_damaged_pdf, input->getName(),
|
||||||
"stream data", input->tell(),
|
"stream data", input->tell(),
|
||||||
"EOF found while reading inline image"));
|
"EOF found while reading inline image"));
|
||||||
callbacks->handleWarning();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -5125,15 +5125,6 @@ print "\n";
|
|||||||
<filename>ChangeLog</filename> file for details.
|
<filename>ChangeLog</filename> file for details.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</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>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The method <function>QPDF::numWarnings</function> was added
|
The method <function>QPDF::numWarnings</function> was added
|
||||||
|
Loading…
Reference in New Issue
Block a user