]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
checks for FObjMixed's id
authorJordan Naftolin <jordan@apache.org>
Thu, 22 Jun 2000 00:05:59 +0000 (00:05 +0000)
committerJordan Naftolin <jordan@apache.org>
Thu, 22 Jun 2000 00:05:59 +0000 (00:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193426 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/fo/FObjMixed.java
src/org/apache/fop/fo/flow/Block.java

index d82257770e3f6c9953a0a8eade851c45c79d4c0b..68a8a0d8e57cb8ec6c1471053b6c35ffe44c5b72 100644 (file)
@@ -83,6 +83,9 @@ public class FObjMixed extends FObj {
 
        if (this.marker == START) {
            this.marker = 0;
+            // initialize id                       
+            String id = this.properties.get("id").getString();            
+            area.getIDReferences().initializeID(id,area);                                
        }
 
        int numChildren = this.children.size();
index 3adb50a0cf9746fd6ca26c50b4e7a243065379fa..1e28d16849c5b916c8d6fde1a94a595bab231331 100644 (file)
@@ -71,7 +71,6 @@ public class Block extends FObjMixed {
        return new Block.Maker();
     }
 
-    final static int ID_PADDING = 5000; // space to add before id y position
     FontState fs;
     int align;
     int alignLast;
@@ -206,20 +205,9 @@ public class Block extends FObjMixed {
        }        
         
         if ( marker==0 ) {
-            // set up IDReferences            
-            IDReferences idReferences = area.getIDReferences();            
+            // initialize id                       
             String id = this.properties.get("id").getString(); 
-            if ( id!=null && !id.equals("") ) {
-                if ( idReferences.doesIDExist(id) ) {
-                    throw new FOPException("The id \""+id+"\" already exists in this document");
-                }
-                else {                    
-                    idReferences.createNewId(id);
-                    idReferences.removeFromIdValidationList(id);                                                           
-                    idReferences.setYPosition(id,area.getPage().getBody().getYPosition() - area.getAbsoluteHeight()+ID_PADDING);                    
-                    area.getPage().addToIDList(id);                                    
-                }
-            }
+            area.getIDReferences().initializeID(id,area);                        
         }
         
         this.blockArea =