From 3d67d750ea97ecc2da9bd76438b71003b176dfbc Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 7 Feb 2005 10:59:25 +0000 Subject: [PATCH] use hasBackground() as a fail-fast. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198385 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/layoutmgr/TraitSetter.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/fop/layoutmgr/TraitSetter.java b/src/java/org/apache/fop/layoutmgr/TraitSetter.java index afa516dc5..fe1044328 100644 --- a/src/java/org/apache/fop/layoutmgr/TraitSetter.java +++ b/src/java/org/apache/fop/layoutmgr/TraitSetter.java @@ -165,6 +165,9 @@ public class TraitSetter { * @param backProps the background properties */ public static void addBackground(Area area, CommonBorderPaddingBackground backProps) { + if (!backProps.hasBackground()) { + return; + } Trait.Background back = new Trait.Background(); back.setColor(backProps.backgroundColor); @@ -213,9 +216,7 @@ public class TraitSetter { } } - if (back.getColor() != null || back.getFopImage() != null) { - area.addTrait(Trait.BACKGROUND, back); - } + area.addTrait(Trait.BACKGROUND, back); } /** -- 2.39.5