bernhardf-ro commented on code in PR #149:
URL: https://github.com/apache/pdfbox/pull/149#discussion_r1082619424
##########
pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java:
##########
@@ -1498,8 +1499,8 @@ private void updateStructParentEntries(PDPage page, int
structParentOffset) thro
List<PDAnnotation> newannots = new ArrayList<>(annots.size());
annots.forEach(annot ->
{
- int structParent = annot.getStructParent();
- if (structParent >= 0)
+ int structParent =
annot.getCOSObject().getInt(COSName.STRUCT_PARENT, Integer.MIN_VALUE); // allow
for negative struct parent values
Review Comment:
That would be an API change which would break all specific (i.e. positiv or
negative equals) checks for -1 in all integrations.
If a one-parameter method that defaults to `Integer.MIN_VALUE` is necessary
(IMHO it is not), it would have to be a new one, e.g. `getIntSigned(COSName)`
(and similar for array, possibly for other number types).
The only change in this regard that I consider necessary is improving the
API documentation of `getInt(COSName)` (and similar methods) to clarify that
they cannot be used if the result may be negative.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]