fop-commits  

svn commit: r655791 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/fo/FOEventHandler.java src/java/org/apache/fop/fo/FOPropertyMapping.java src/java/org/apache/fop/fo/properties/StringProperty.j

adelmelle
Tue, 13 May 2008 02:58:25 -0700

Author: adelmelle
Date: Tue May 13 02:58:01 2008
New Revision: 655791

URL: http://svn.apache.org/viewvc?rev=655791&view=rev
Log:
Undo r655765, which was causing NPEs in the layout-tests


Removed:
    xmlgraphics/fop/trunk/test/fotree/testcases/id_auto.fo
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOEventHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/StringProperty.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOEventHandler.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOEventHandler.java?rev=655791&r1=655790&r2=655791&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOEventHandler.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOEventHandler.java Tue 
May 13 02:58:01 2008
@@ -79,10 +79,6 @@
      * This is used so we know if the FO tree contains duplicates.
      */
     private Set idReferences = new HashSet();
-    /**
-     * Keeps track of the last automatically generated id in the current 
document
-     */
-    private long lastGeneratedId = 1;
     
     /**
      * The property list maker.
@@ -182,15 +178,6 @@
     }
     
     /**
-     * Return the next value for automatically generated ids
-     * 
-     * @return the next value to append to automatically generated ids
-     */
-    public long getNextId() {
-        return this.lastGeneratedId++;
-    }
-    
-    /**
      * This method is called to indicate the start of a new document run.
      * @throws SAXException In case of a problem
      */

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java?rev=655791&r1=655790&r2=655791&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java Tue 
May 13 02:58:01 2008
@@ -2503,7 +2503,7 @@
         addPropertyMaker("content-type", m);
 
         // id
-        m  = new StringProperty.IdMaker(PR_ID);
+        m  = new StringProperty.Maker(PR_ID);
         m.setInherited(false);
         m.setDefault("");
         addPropertyMaker("id", m);

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/StringProperty.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/StringProperty.java?rev=655791&r1=655790&r2=655791&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/StringProperty.java 
(original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/StringProperty.java 
Tue May 13 02:58:01 2008
@@ -81,49 +81,7 @@
         }
 
     }
-
-    /**
-     * Inner class dedicated to the "id" property, which should provide a 
random
-     * unique identifier as an initial value.
-     * The values for "id" are never cached, as they're typically valid for one
-     * document.
-     */
-    public static class IdMaker extends PropertyMaker {
-
-        /**
-         * @param propId    the id of the property for which the maker should 
be created
-         */
-        public IdMaker(int propId) {
-            super(propId);
-        }
-
-        /** [EMAIL PROTECTED] */
-        public Property make(PropertyList propertyList) throws 
PropertyException {
-            String newId = "FO_";
-            newId += propertyList.getFObj().getFOEventHandler().getNextId();
-            return new StringProperty(newId);
-        }
-        
-        /** [EMAIL PROTECTED] */
-        public Property make(PropertyList propertyList, 
-                             String value,
-                             FObj fo) throws PropertyException {
-            
-            Property idProp;
-            
-            //no parsing necessary; just return a new StringProperty
-            //TODO: Should we move validation here? (see FObj#checkId())
-            if ("".equals(value)) {
-                //if an empty string was specified, return the default
-                idProp = this.make(propertyList);
-            } else {
-                idProp = new StringProperty(value);
-            }
-            
-            return idProp;
-        }
-    }
-
+    
     /** cache containing all canonical StringProperty instances */
     private static final PropertyCache cache = new 
PropertyCache(StringProperty.class);
     



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  • svn commit: r655791 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/fo/FOEventHandler.java src/java/org/apache/fop/fo/FOPropertyMapping.java src/java/org/apache/fop/fo/properties/StringProperty.j adelmelle