]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bug #25806 (Patch by Finn Bock)--NPE fixed in ExternalGraphic.java.
authorGlen Mazza <gmazza@apache.org>
Thu, 1 Jan 2004 18:52:22 +0000 (18:52 +0000)
committerGlen Mazza <gmazza@apache.org>
Thu, 1 Jan 2004 18:52:22 +0000 (18:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197086 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/flow/ExternalGraphic.java

index 82dec643b740492d39c70b9a6b632b66affa11bc..fc498c46e290575c3961d01196aaf0935e600866 100644 (file)
@@ -65,6 +65,7 @@ import org.apache.fop.fo.properties.Scaling;
 import org.apache.fop.image.ImageFactory;
 import org.apache.fop.image.FopImage;
 import org.apache.fop.datatypes.Length;
+import org.apache.fop.datatypes.LengthRange;
 
 // Java
 import java.awt.geom.Rectangle2D;
@@ -108,8 +109,9 @@ public class ExternalGraphic extends FObj {
         }
         url = ImageFactory.getURL(url);
 
-        // assume lr-tb for now
-        Length ipd = propertyList.get(PR_INLINE_PROGRESSION_DIMENSION).getLength();
+        // assume lr-tb for now and just use the .optimum value of the range
+        Length ipd = propertyList.get(PR_INLINE_PROGRESSION_DIMENSION).
+                                    getLengthRange().getOptimum().getLength();
         if (!ipd.isAuto()) {
             viewWidth = ipd.getValue();
         } else {