}
}
- private void renderBookmark(Bookmark bookmark, PDFOutline parent) {
+ private void renderBookmark(Bookmark bookmark, PDFOutline parent) throws IFException {
if (parent == null) {
parent = getPDFDoc().getOutlineRoot();
}
}
}
- private PDFAction getAction(AbstractAction action) {
+ private PDFAction getAction(AbstractAction action) throws IFException {
if (action == null) {
return null;
}
}
}
- private void updateTargetLocation(PDFGoTo pdfGoTo, GoToXYAction action) {
+ private void updateTargetLocation(PDFGoTo pdfGoTo, GoToXYAction action)
+ throws IFException {
PageReference pageRef = this.documentHandler.getPageReference(action.getPageIndex());
- //Convert target location from millipoints to points and adjust for different
- //page origin
- Point2D p2d = null;
- p2d = new Point2D.Double(
- action.getTargetLocation().x / 1000.0,
- (pageRef.getPageDimension().height - action.getTargetLocation().y) / 1000.0);
- String pdfPageRef = pageRef.getPageRef();
- pdfGoTo.setPageReference(pdfPageRef);
- pdfGoTo.setPosition(p2d);
-
- //Queue this object now that it's complete
- getPDFDoc().addObject(pdfGoTo);
- this.completeActions.put(action.getID(), pdfGoTo);
+ if ( pageRef == null ) {
+ throw new
+ IFException("Can't resolve page reference @ index: " + action.getPageIndex(), null);
+ } else {
+ //Convert target location from millipoints to points and adjust for different
+ //page origin
+ Point2D p2d = null;
+ p2d = new Point2D.Double(
+ action.getTargetLocation().x / 1000.0,
+ (pageRef.getPageDimension().height - action.getTargetLocation().y) / 1000.0);
+ String pdfPageRef = pageRef.getPageRef();
+ pdfGoTo.setPageReference(pdfPageRef);
+ pdfGoTo.setPosition(p2d);
+
+ //Queue this object now that it's complete
+ getPDFDoc().addObject(pdfGoTo);
+ this.completeActions.put(action.getID(), pdfGoTo);
+ }
}
}
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="FOP Trunk" date="TBD">
+ <action context="Code" dev="GA" type="fix" fixes-bug="51836" due-to="Melanie Drake">
+ Throw IFException instead of NPE if navigation target (page reference) doesn't exist.
+ </action>
<action context="Code" dev="GA" type="fix" fixes-bug="51808" due-to="Sergey Vladimirov">
Fixed memory waste in traits map.
</action>