]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Minor tweak: avoid test for auto if value is indefinite
authorAndreas L. Delmelle <adelmelle@apache.org>
Sun, 25 Sep 2005 10:43:32 +0000 (10:43 +0000)
committerAndreas L. Delmelle <adelmelle@apache.org>
Sun, 25 Sep 2005 10:43:32 +0000 (10:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@291399 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/properties/PageDimensionMaker.java

index 47183e38f9f2ed4f4d3c0cfcadd23688fba29d6b..0c165ca29409d15b0564ac84a764bef385e968f2 100644 (file)
@@ -53,8 +53,8 @@ public class PageDimensionMaker extends LengthProperty.Maker {
         Property p = super.get(0, propertyList, tryInherit, tryDefault);    
         FObj fo = propertyList.getFObj();
         String fallbackValue = (propId == Constants.PR_PAGE_HEIGHT)
-        ? fo.getFOEventHandler().getUserAgent().getPageHeight()
-            : fo.getFOEventHandler().getUserAgent().getPageWidth();
+            ? fo.getFOEventHandler().getUserAgent().getPageHeight()
+                    : fo.getFOEventHandler().getUserAgent().getPageWidth();
         
         if (p.getEnum() == Constants.EN_INDEFINITE) {
             int otherId = (propId == Constants.PR_PAGE_HEIGHT) 
@@ -78,18 +78,20 @@ public class PageDimensionMaker extends LengthProperty.Maker {
                                      || refOrientation == -270))) {
                     //set page-width to "auto" = use the fallback from FOUserAgent
                     if (propId == Constants.PR_PAGE_WIDTH) {
+                        fo.getLogger().warn("Both page-width and page-height set to "
+                                + "\"indefinite\". Forcing page-width to \"auto\"");
                         return make(propertyList, fallbackValue, fo);
                     }
                 } else {
                     //set page-height to "auto" = use fallback from FOUserAgent
+                    fo.getLogger().warn("Both page-width and page-height set to "
+                            + "\"indefinite\". Forcing page-height to \"auto\"");
                     if (propId == Constants.PR_PAGE_HEIGHT) {
                         return make(propertyList, fallbackValue, fo);
                     }
                 }
             }
-        }
-        
-        if (p.isAuto()) {
+        } else if (p.isAuto()) {
             return make(propertyList, fallbackValue, fo);
         }