From: Jeremias Maerki Date: Mon, 7 Feb 2005 10:59:25 +0000 (+0000) Subject: use hasBackground() as a fail-fast. X-Git-Tag: Root_Temp_KnuthStylePageBreaking~122 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3d67d750ea97ecc2da9bd76438b71003b176dfbc;p=xmlgraphics-fop.git use hasBackground() as a fail-fast. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198385 13f79535-47bb-0310-9956-ffa450edef68 --- 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); } /**