You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2005/08/10 16:56:36 UTC

svn commit: r231253 - /xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/area/inline/InlineBlockParent.java

Author: jeremias
Date: Wed Aug 10 07:56:33 2005
New Revision: 231253

URL: http://svn.apache.org/viewcvs?rev=231253&view=rev
Log:
State and parameter checking.
Update the BPD from the child, too.

Modified:
    xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/area/inline/InlineBlockParent.java

Modified: xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/area/inline/InlineBlockParent.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/area/inline/InlineBlockParent.java?rev=231253&r1=231252&r2=231253&view=diff
==============================================================================
--- xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/area/inline/InlineBlockParent.java (original)
+++ xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/area/inline/InlineBlockParent.java Wed Aug 10 07:56:33 2005
@@ -45,11 +45,17 @@
      * @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");
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org