diff options
author | Glen Mazza <gmazza@apache.org> | 2004-09-04 20:55:21 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2004-09-04 20:55:21 +0000 |
commit | fe2d99426ed26953441a63e27aa87935e0877d6d (patch) | |
tree | 5570bda4f1bc4ea955660f57aa3e2ed328f13875 /src/java/org/apache/fop/fo/FObj.java | |
parent | ce6918191d4a085815a977aa394c8516609e3f91 (diff) | |
download | xmlgraphics-fop-fe2d99426ed26953441a63e27aa87935e0877d6d.tar.gz xmlgraphics-fop-fe2d99426ed26953441a63e27aa87935e0877d6d.zip |
1.) Validation for fo:multi-toggle added.
2.) Switch to faster int's for findAncestor().
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197902 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/FObj.java')
-rw-r--r-- | src/java/org/apache/fop/fo/FObj.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index a1a25e8b7..cebe2e164 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -514,8 +514,9 @@ public class FObj extends FONode implements Constants { || lName.equals("page-number") || lName.equals("page-number-citation") || lName.equals("basic-link") - || lName.equals("multi-toggle") - || (!isOutOfLineFODescendant && lName.equals("footnote")) + || (lName.equals("multi-toggle") + && (getNameId() == FO_MULTI_CASE || findAncestor(FO_MULTI_CASE) > 0)) + || (lName.equals("footnote") && !isOutOfLineFODescendant) || isNeutralItem(nsURI, lName))); } @@ -551,15 +552,15 @@ public class FObj extends FONode implements Constants { /** * Convenience method for validity checking. Checks if the * current node has an ancestor of a given name. - * @param ancestorName -- node name to check for (e.g., "fo:root") + * @param ancestorID -- Constants ID of node name to check for (e.g., FO_ROOT) * @return number of levels above FO where ancestor exists, * -1 if not found */ - protected int findAncestor(String ancestorName) { + protected int findAncestor(int ancestorID) { int found = 1; FONode temp = getParent(); while (temp != null) { - if (temp.getName().equals(ancestorName)) { + if (temp.getNameId() == ancestorID) { return found; } found += 1; |