diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-08-10 14:56:33 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-08-10 14:56:33 +0000 |
commit | 65c0f475487bf239cd625808f85597fc238aebee (patch) | |
tree | 766f5fcca075f8dc48009ed3dfb03b5b333538ec | |
parent | 0b6ecb9682a80bf68b098bc915e4148f1fa21641 (diff) | |
download | xmlgraphics-fop-65c0f475487bf239cd625808f85597fc238aebee.tar.gz xmlgraphics-fop-65c0f475487bf239cd625808f85597fc238aebee.zip |
State and parameter checking.
Update the BPD from the child, too.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/inlineblock@231253 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/area/inline/InlineBlockParent.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/area/inline/InlineBlockParent.java b/src/java/org/apache/fop/area/inline/InlineBlockParent.java index 0c284e7ff..9934b1316 100644 --- a/src/java/org/apache/fop/area/inline/InlineBlockParent.java +++ b/src/java/org/apache/fop/area/inline/InlineBlockParent.java @@ -45,11 +45,17 @@ public class InlineBlockParent extends InlineArea { * @param childArea the child area to add */ public void addChildArea(Area childArea) { - if (childArea instanceof Block && child == null) { + if (child != null) { + throw new IllegalStateException("InlineBlockParent may have only one child area."); + } + if (childArea instanceof Block) { child = (Block) childArea; - increaseIPD(childArea.getAllocIPD()); + //Update extents from the child + setIPD(childArea.getAllocIPD()); + setBPD(childArea.getAllocBPD()); } else { - // TODO: log error, raise exception? + throw new IllegalArgumentException("The child of an InlineBlockParent must be a" + + " Block area"); } } |