]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
added id support (required for internal-links)
authorJordan Naftolin <jordan@apache.org>
Thu, 22 Jun 2000 00:11:33 +0000 (00:11 +0000)
committerJordan Naftolin <jordan@apache.org>
Thu, 22 Jun 2000 00:11:33 +0000 (00:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193427 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/fo/flow/BlockContainer.java
src/org/apache/fop/fo/flow/DisplayGraphic.java
src/org/apache/fop/fo/flow/DisplayRule.java
src/org/apache/fop/fo/flow/DisplaySequence.java

index b0c8df64a8263cbfcc3f355cc75b9a16550a8769..848acc2ddff4cf115cfd055340611692f65c1608 100644 (file)
@@ -159,7 +159,11 @@ public class BlockContainer extends FObj {
                this.properties.get("border-width").getLength().mvalue();
            this.borderStyle =
                this.properties.get("border-style").getEnum();
-       }
+
+            // initialize id                       
+            String id = this.properties.get("id").getString();            
+            area.getIDReferences().initializeID(id,area);  
+       }        
 
        boolean prevChildMustKeepWithNext = false;
         
@@ -181,6 +185,9 @@ public class BlockContainer extends FObj {
         areaContainer.setBorderColor(borderColor, borderColor, borderColor, borderColor); 
        areaContainer.start();
         
+        areaContainer.setAbsoluteHeight(area.getAbsoluteHeight());
+        areaContainer.setIDReferences(area.getIDReferences());
+        
        int numChildren = this.children.size();
        for (int i = this.marker; i < numChildren; i++) {
            FObj fo = (FObj) children.elementAt(i);
@@ -205,6 +212,8 @@ public class BlockContainer extends FObj {
                prevChildMustKeepWithNext = true;
            }
        }
+        area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
+
        areaContainer.end();
         if (position == Position.ABSOLUTE)
           areaContainer.setHeight(height);
index 348833804287add1e15e7f6108bdb74fe42e9169..327d42b01b829fc095cf73fcb7d16547838cd54a 100644 (file)
@@ -191,6 +191,12 @@ public class DisplayGraphic extends FObj {
                    area.addDisplaySpace(spaceBefore);
                }
 
+            if ( marker == 0 ) {
+                // initialize id                       
+                String id = this.properties.get("id").getString();            
+                area.getIDReferences().initializeID(id,area);                                
+            }
+
                imageArea.start();
                imageArea.end();
                area.addChild(imageArea);
index 383aed2238f1ad87d9b0fd0e1efa8f4dee45fb4a..54845e8ac19604b5e2a521adcb9c5f1fd054487b 100644 (file)
@@ -132,6 +132,10 @@ public class DisplayRule extends FObj {
                forcedStartOffset;
        }
 
+        // initialize id                       
+        String id = this.properties.get("id").getString();            
+        area.getIDReferences().initializeID(id,area);                                
+
        RuleArea ruleArea = new RuleArea(fs,
                                         area.getAllocationWidth(),
                                         area.spaceLeft(),
index 05571ffb94e13db0c78c45771677055af9732f53..79adfd79dbcfb5ec4b11176a509029426fba9fa6 100644 (file)
@@ -79,6 +79,9 @@ public class DisplaySequence extends FObj {
 
     public Status layout(Area area) throws FOPException {
        if (this.marker == START) {
+           // initialize id                       
+            String id = this.properties.get("id").getString();            
+            area.getIDReferences().initializeID(id,area);                                
            this.marker = 0;
        }
        // this is such common code, perhaps it should be in the super class