diff options
author | Chris Bowditch <cbowditch@apache.org> | 2009-03-21 08:47:34 +0000 |
---|---|---|
committer | Chris Bowditch <cbowditch@apache.org> | 2009-03-21 08:47:34 +0000 |
commit | 085000aa2a34f78a73b6ed23112d6ad16e707ec2 (patch) | |
tree | ccf9e789edcbb679ed2eaaac77e8b0e1bad4615b /src/java | |
parent | 6dfb589f8b4217771daedbac864ad31cf67e6f24 (diff) | |
download | xmlgraphics-fop-085000aa2a34f78a73b6ed23112d6ad16e707ec2.tar.gz xmlgraphics-fop-085000aa2a34f78a73b6ed23112d6ad16e707ec2.zip |
bug fix: 46867: afp:invoke-medium-map extension not working in the AFP Renderer
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@756894 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java b/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java index 1c45911a9..1a8cfdf47 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java @@ -41,7 +41,7 @@ public class AFPExtensionHandler extends DefaultHandler private StringBuffer content = new StringBuffer(); private Attributes lastAttributes; - private AFPPageSetup returnedObject; + private AFPExtensionAttachment returnedObject; private ObjectBuiltListener listener; /** {@inheritDoc} */ @@ -75,17 +75,24 @@ public class AFPExtensionHandler extends DefaultHandler /** {@inheritDoc} */ public void endElement(String uri, String localName, String qName) throws SAXException { if (AFPPageSetup.CATEGORY.equals(uri)) { - this.returnedObject = new AFPPageSetup(localName); + AFPPageSetup pageSetupExtn = null; + if (localName.equals(AFPElementMapping.INVOKE_MEDIUM_MAP)) { + this.returnedObject = new AFPInvokeMediumMap(); + } + else { + pageSetupExtn = new AFPPageSetup(localName); + this.returnedObject = pageSetupExtn; + } String name = lastAttributes.getValue("name"); if (name != null) { returnedObject.setName(name); } String value = lastAttributes.getValue("value"); - if (value != null) { - returnedObject.setValue(value); + if (value != null && pageSetupExtn != null) { + pageSetupExtn.setValue(value); } - if (content.length() > 0) { - returnedObject.setContent(content.toString()); + if (content.length() > 0 && pageSetupExtn != null) { + pageSetupExtn.setContent(content.toString()); content.setLength(0); //Reset text buffer (see characters()) } } |