]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
use hasBackground() as a fail-fast.
authorJeremias Maerki <jeremias@apache.org>
Mon, 7 Feb 2005 10:59:25 +0000 (10:59 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 7 Feb 2005 10:59:25 +0000 (10:59 +0000)
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

index afa516dc50385800d34b8a8d1350512f51f8d5fb..fe104432861732640336f66c32aea4a6e2fad2a4 100644 (file)
@@ -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);
     }
 
     /**