aboutsummaryrefslogtreecommitdiffstats
path: root/src/org
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-08-20 07:03:19 +0000
committerKeiron Liddle <keiron@apache.org>2002-08-20 07:03:19 +0000
commit470ede29b0555d1ff6c695ee22faa1bc542df190 (patch)
tree3014cfd35689bcf0e24359e016f785a315bca78b /src/org
parent7e66c852838e0e01dc08b6703cf3e62ef6f177f8 (diff)
downloadxmlgraphics-fop-470ede29b0555d1ff6c695ee22faa1bc542df190.tar.gz
xmlgraphics-fop-470ede29b0555d1ff6c695ee22faa1bc542df190.zip
handle errors better
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195108 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org')
-rw-r--r--src/org/apache/fop/fo/flow/ExternalGraphic.java13
-rw-r--r--src/org/apache/fop/fo/flow/InstreamForeignObject.java15
2 files changed, 17 insertions, 11 deletions
diff --git a/src/org/apache/fop/fo/flow/ExternalGraphic.java b/src/org/apache/fop/fo/flow/ExternalGraphic.java
index 6f18214d1..5fce31e8c 100644
--- a/src/org/apache/fop/fo/flow/ExternalGraphic.java
+++ b/src/org/apache/fop/fo/flow/ExternalGraphic.java
@@ -45,11 +45,14 @@ public class ExternalGraphic extends FObj {
}
public void addLayoutManager(List list) {
- LeafNodeLayoutManager lm = new LeafNodeLayoutManager(this);
- lm.setCurrentArea(getInlineArea());
- lm.setAlignment(properties.get("vertical-align").getEnum());
- lm.setLead(viewHeight);
- list.add(lm);
+ InlineArea area = getInlineArea();
+ if(area != null) {
+ LeafNodeLayoutManager lm = new LeafNodeLayoutManager(this);
+ lm.setCurrentArea(area);
+ lm.setAlignment(properties.get("vertical-align").getEnum());
+ lm.setLead(viewHeight);
+ list.add(lm);
+ }
}
protected InlineArea getInlineArea() {
diff --git a/src/org/apache/fop/fo/flow/InstreamForeignObject.java b/src/org/apache/fop/fo/flow/InstreamForeignObject.java
index e6da7233c..b39e8c0db 100644
--- a/src/org/apache/fop/fo/flow/InstreamForeignObject.java
+++ b/src/org/apache/fop/fo/flow/InstreamForeignObject.java
@@ -54,17 +54,20 @@ public class InstreamForeignObject extends FObj {
}
public void addLayoutManager(List list) {
- LeafNodeLayoutManager lm = new LeafNodeLayoutManager(this);
- lm.setCurrentArea(getInlineArea());
- lm.setAlignment(properties.get("vertical-align").getEnum());
- lm.setLead(areaCurrent.getHeight());
- list.add(lm);
+ areaCurrent = getInlineArea();
+ if(areaCurrent != null) {
+ LeafNodeLayoutManager lm = new LeafNodeLayoutManager(this);
+ lm.setCurrentArea(areaCurrent);
+ lm.setAlignment(properties.get("vertical-align").getEnum());
+ lm.setLead(areaCurrent.getHeight());
+ list.add(lm);
+ }
}
/**
* Get the inline area created by this element.
*/
- protected InlineArea getInlineArea() {
+ protected Viewport getInlineArea() {
if (children == null) {
return areaCurrent;
}