aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/intermediate
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2009-10-07 17:34:29 +0000
committerVincent Hennebert <vhennebert@apache.org>2009-10-07 17:34:29 +0000
commit618e88ae22d5371122621e4df84fcbd66bc1ece8 (patch)
tree0d0cb61dd3c0c5e3c15c5321543387f4a7c7c230 /src/java/org/apache/fop/render/intermediate
parentb59502d64ede1cf0737187a9a50623980668af70 (diff)
downloadxmlgraphics-fop-618e88ae22d5371122621e4df84fcbd66bc1ece8.tar.gz
xmlgraphics-fop-618e88ae22d5371122621e4df84fcbd66bc1ece8.zip
Removed unnecessary languageStack field
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Accessibility@822810 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/intermediate')
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFSerializer.java29
1 files changed, 5 insertions, 24 deletions
diff --git a/src/java/org/apache/fop/render/intermediate/IFSerializer.java b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
index b010ee41f..9d7c15a61 100644
--- a/src/java/org/apache/fop/render/intermediate/IFSerializer.java
+++ b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
@@ -29,7 +29,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import java.util.Stack;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -215,7 +214,11 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
if (id != null) {
atts.addAttribute(XML_NAMESPACE, "id", "xml:id", XMLUtil.CDATA, id);
}
- applyLanguage(atts);
+ Locale lang = getContext().getLanguage();
+ if (lang != null) {
+ atts.addAttribute(XML_NAMESPACE, "lang", "xml:lang", XMLUtil.CDATA,
+ XMLUtil.toRFC3066(lang));
+ }
addForeignAttributes(atts);
handler.startElement(EL_PAGE_SEQUENCE, atts);
if (this.getUserAgent().isAccessibilityEnabled()) {
@@ -237,7 +240,6 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
public void endPageSequence() throws IFException {
try {
handler.endElement(EL_PAGE_SEQUENCE);
- popLanguage();
} catch (SAXException e) {
throw new IFException("SAX error in endPageSequence()", e);
}
@@ -772,25 +774,4 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
}
}
- private Stack languageStack = new Stack();
-
- private void applyLanguage(AttributesImpl atts) {
- Locale lang = getContext().getLanguage();
- if (lang != null) {
- if (languageStack.isEmpty() || !languageStack.peek().equals(lang)) {
- atts.addAttribute(XML_NAMESPACE, "lang", "xml:lang", XMLUtil.CDATA,
- XMLUtil.toRFC3066(lang));
- }
- languageStack.push(lang);
- } else {
- assert languageStack.isEmpty();
- }
- }
-
- private void popLanguage() {
- if (!languageStack.isEmpty()) {
- languageStack.pop();
- }
- }
-
}