You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by gm...@apache.org on 2004/09/04 22:55:21 UTC

cvs commit: xml-fop/src/java/org/apache/fop/fo/flow BidiOverride.java Inline.java

gmazza      2004/09/04 13:55:21

  Modified:    src/java/org/apache/fop/fo FONode.java FObj.java
               src/java/org/apache/fop/fo/flow BidiOverride.java
                        Inline.java
  Log:
  1.) Validation for fo:multi-toggle added.
  2.) Switch to faster int's for findAncestor().
  
  Revision  Changes    Path
  1.41      +17 -17    xml-fop/src/java/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- FONode.java	25 Aug 2004 05:03:05 -0000	1.40
  +++ FONode.java	4 Sep 2004 20:55:20 -0000	1.41
  @@ -111,23 +111,6 @@
       }
   
       /**
  -     * Returns the name of the node
  -     * @return the name of this node
  -     */
  -    public String getName() {
  -        return null;
  -    }
  -
  -    /**
  -     * Returns the Constants class integer value of this node
  -     * @return the integer enumeration of this FO (e.g., FO_ROOT)
  -     *      if a formatting object, FO_UNKNOWN_NODE otherwise
  -     */
  -    public int getNameId() {
  -        return Constants.FO_UNKNOWN_NODE;
  -    }
  -
  -    /**
        * Checks to make sure, during SAX processing of input document, that the
        * incoming node is valid for the this (parent) node (e.g., checking to
        * see that fo:table is not an immediate child of fo:root)
  @@ -343,6 +326,23 @@
           } else {
               return "Error(" + loc.getLineNumber() + "/" + loc.getColumnNumber() + "): ";
           }
  +    }
  +
  +    /**
  +     * Returns the name of the node
  +     * @return the name of this node
  +     */
  +    public String getName() {
  +        return null;
  +    }
  +
  +    /**
  +     * Returns the Constants class integer value of this node
  +     * @return the integer enumeration of this FO (e.g., FO_ROOT)
  +     *      if a formatting object, FO_UNKNOWN_NODE otherwise
  +     */
  +    public int getNameId() {
  +        return Constants.FO_UNKNOWN_NODE;
       }
   }
   
  
  
  
  1.73      +6 -5      xml-fop/src/java/org/apache/fop/fo/FObj.java
  
  Index: FObj.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- FObj.java	4 Sep 2004 19:53:06 -0000	1.72
  +++ FObj.java	4 Sep 2004 20:55:20 -0000	1.73
  @@ -514,8 +514,9 @@
               || 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 @@
       /**
        * 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;
  
  
  
  1.18      +4 -4      xml-fop/src/java/org/apache/fop/fo/flow/BidiOverride.java
  
  Index: BidiOverride.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/BidiOverride.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- BidiOverride.java	11 Aug 2004 04:15:25 -0000	1.17
  +++ BidiOverride.java	4 Sep 2004 20:55:21 -0000	1.18
  @@ -52,10 +52,10 @@
          /* Check to see if this node can have block-level children.
           * See validateChildNode() below.
           */
  -       int lvlLeader = findAncestor("fo:leader");
  -       int lvlInCntr = findAncestor("fo:inline-container");
  -       int lvlInline = findAncestor("fo:inline");
  -       int lvlFootnote = findAncestor("fo:footnote");
  +       int lvlLeader = findAncestor(FO_LEADER);
  +       int lvlInCntr = findAncestor(FO_INLINE_CONTAINER);
  +       int lvlInline = findAncestor(FO_INLINE);
  +       int lvlFootnote = findAncestor(FO_FOOTNOTE);
   
          if (lvlLeader > 0) {
              if (lvlInCntr < 0 ||
  
  
  
  1.26      +3 -3      xml-fop/src/java/org/apache/fop/fo/flow/Inline.java
  
  Index: Inline.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Inline.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Inline.java	14 Aug 2004 18:36:21 -0000	1.25
  +++ Inline.java	4 Sep 2004 20:55:21 -0000	1.26
  @@ -54,9 +54,9 @@
          /* Check to see if this node can have block-level children.
           * See validateChildNode() below.
           */
  -       int lvlLeader = findAncestor("fo:leader");
  -       int lvlFootnote = findAncestor("fo:footnote");
  -       int lvlInCntr = findAncestor("fo:inline-container");
  +       int lvlLeader = findAncestor(FO_LEADER);
  +       int lvlFootnote = findAncestor(FO_FOOTNOTE);
  +       int lvlInCntr = findAncestor(FO_INLINE_CONTAINER);
   
          if (lvlLeader > 0) {
              if (lvlInCntr < 0 ||
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org