From 90440dd9d8e2e1aa7647e20f02677b62bab0e516 Mon Sep 17 00:00:00 2001 From: Jordan Naftolin Date: Thu, 22 Jun 2000 00:11:33 +0000 Subject: [PATCH] added id support (required for internal-links) 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 | 11 ++++++++++- src/org/apache/fop/fo/flow/DisplayGraphic.java | 6 ++++++ src/org/apache/fop/fo/flow/DisplayRule.java | 4 ++++ src/org/apache/fop/fo/flow/DisplaySequence.java | 3 +++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/org/apache/fop/fo/flow/BlockContainer.java b/src/org/apache/fop/fo/flow/BlockContainer.java index b0c8df64a..848acc2dd 100644 --- a/src/org/apache/fop/fo/flow/BlockContainer.java +++ b/src/org/apache/fop/fo/flow/BlockContainer.java @@ -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); diff --git a/src/org/apache/fop/fo/flow/DisplayGraphic.java b/src/org/apache/fop/fo/flow/DisplayGraphic.java index 348833804..327d42b01 100644 --- a/src/org/apache/fop/fo/flow/DisplayGraphic.java +++ b/src/org/apache/fop/fo/flow/DisplayGraphic.java @@ -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); diff --git a/src/org/apache/fop/fo/flow/DisplayRule.java b/src/org/apache/fop/fo/flow/DisplayRule.java index 383aed223..54845e8ac 100644 --- a/src/org/apache/fop/fo/flow/DisplayRule.java +++ b/src/org/apache/fop/fo/flow/DisplayRule.java @@ -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(), diff --git a/src/org/apache/fop/fo/flow/DisplaySequence.java b/src/org/apache/fop/fo/flow/DisplaySequence.java index 05571ffb9..79adfd79d 100644 --- a/src/org/apache/fop/fo/flow/DisplaySequence.java +++ b/src/org/apache/fop/fo/flow/DisplaySequence.java @@ -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 -- 2.39.5