aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/intermediate/IFSerializer.java
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2009-10-21 14:57:54 +0000
committerVincent Hennebert <vhennebert@apache.org>2009-10-21 14:57:54 +0000
commit2a54372f5d918492115fa3e00285af19d6f67055 (patch)
tree3c576b211577106a19b37fe40b0a286c734f97ce /src/java/org/apache/fop/render/intermediate/IFSerializer.java
parentcacfc7c9bf562ed9b34d723f10120214aa909f35 (diff)
downloadxmlgraphics-fop-2a54372f5d918492115fa3e00285af19d6f67055.tar.gz
xmlgraphics-fop-2a54372f5d918492115fa3e00285af19d6f67055.zip
Renamed some variables and methods for consistency.
Improved javadocs. Code clean-up and simplification. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Accessibility@828038 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/intermediate/IFSerializer.java')
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFSerializer.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/java/org/apache/fop/render/intermediate/IFSerializer.java b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
index b6136f036..2401b1202 100644
--- a/src/java/org/apache/fop/render/intermediate/IFSerializer.java
+++ b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
@@ -411,10 +411,7 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
addAttribute(atts, "width", Integer.toString(rect.width));
addAttribute(atts, "height", Integer.toString(rect.height));
addForeignAttributes(atts);
- String ptr = getContext().getStructurePointer();
- if (ptr != null) {
- addAttribute(atts, "ptr", ptr); // used for accessibility
- }
+ addStructurePointerAttribute(atts);
handler.element(EL_IMAGE, atts);
} catch (SAXException e) {
throw new IFException("SAX error in startGroup()", e);
@@ -441,10 +438,7 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
addAttribute(atts, "width", Integer.toString(rect.width));
addAttribute(atts, "height", Integer.toString(rect.height));
addForeignAttributes(atts);
- String ptr = getContext().getStructurePointer();
- if (ptr != null) {
- addAttribute(atts, "ptr", ptr); // used for accessibility
- }
+ addStructurePointerAttribute(atts);
handler.startElement(EL_IMAGE, atts);
new DOM2SAX(handler).writeDocument(doc, true);
handler.endElement(EL_IMAGE);
@@ -558,10 +552,7 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
if (dx != null) {
addAttribute(atts, "dx", IFUtil.toString(dx));
}
- String ptr = getContext().getStructurePointer();
- if (ptr != null) {
- addAttribute(atts, "ptr", ptr); // used for accessibility
- }
+ addStructurePointerAttribute(atts);
handler.startElement(EL_TEXT, atts);
char[] chars = text.toCharArray();
handler.characters(chars, 0, chars.length);
@@ -657,6 +648,13 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
XMLUtil.addAttribute(atts, localName, value);
}
+ private void addStructurePointerAttribute(AttributesImpl atts) {
+ String ptr = getContext().getStructurePointer();
+ if (ptr != null) {
+ addAttribute(atts, "ptr", ptr);
+ }
+ }
+
// ---=== IFDocumentNavigationHandler ===---
private Map incompleteActions = new java.util.HashMap();
@@ -729,7 +727,7 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
atts.addAttribute(null, "rect", "rect",
XMLConstants.CDATA, IFUtil.toString(link.getTargetRect()));
if (getUserAgent().isAccessibilityEnabled()) {
- addAttribute(atts, "ptr", link.getAction().getPtr());
+ addAttribute(atts, "ptr", link.getAction().getStructurePointer());
}
try {
handler.startElement(DocumentNavigationExtensionConstants.LINK, atts);