From a164040a67faa144709d0c4ffbf6ee37bb189f1a Mon Sep 17 00:00:00 2001 From: Maximilian Berger Date: Tue, 15 Sep 2009 14:35:28 +0000 Subject: [PATCH] no page index requires no location to satisfy identity junit test git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@815346 13f79535-47bb-0310-9956-ffa450edef68 --- .../extensions/DocumentNavigationHandler.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/fop/render/intermediate/extensions/DocumentNavigationHandler.java b/src/java/org/apache/fop/render/intermediate/extensions/DocumentNavigationHandler.java index 8516277c5..376130838 100644 --- a/src/java/org/apache/fop/render/intermediate/extensions/DocumentNavigationHandler.java +++ b/src/java/org/apache/fop/render/intermediate/extensions/DocumentNavigationHandler.java @@ -106,9 +106,17 @@ public class DocumentNavigationHandler extends DefaultHandler } else { String id = attributes.getValue("id"); int pageIndex = XMLUtil.getAttributeAsInt(attributes, "page-index"); - int x = XMLUtil.getAttributeAsInt(attributes, "x"); - int y = XMLUtil.getAttributeAsInt(attributes, "y"); - action = new GoToXYAction(id, pageIndex, new Point(x, y)); + final Point location; + if (pageIndex < 0) { + location = null; + } else { + final int x = XMLUtil + .getAttributeAsInt(attributes, "x"); + final int y = XMLUtil + .getAttributeAsInt(attributes, "y"); + location = new Point(x, y); + } + action = new GoToXYAction(id, pageIndex, location); } objectStack.push(action); } else if (GOTO_URI.getLocalName().equals(localName)) { -- 2.39.5