diff options
author | Keiron Liddle <keiron@apache.org> | 2000-11-03 05:16:12 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2000-11-03 05:16:12 +0000 |
commit | 8a0fbed3633feab538c2951856d0022b4266bd0d (patch) | |
tree | 34edb220d3df58b78286107a59606b9cf37e14bd /src | |
parent | 20f35d01bcdf674c68c0c68a254425633b84050c (diff) | |
download | xmlgraphics-fop-8a0fbed3633feab538c2951856d0022b4266bd0d.tar.gz xmlgraphics-fop-8a0fbed3633feab538c2951856d0022b4266bd0d.zip |
fixes npe when rendering, checks the correct length thing for val
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193743 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/org/apache/fop/svg/SVG.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/org/apache/fop/svg/SVG.java b/src/org/apache/fop/svg/SVG.java index 4ecc8587a..99df234ce 100644 --- a/src/org/apache/fop/svg/SVG.java +++ b/src/org/apache/fop/svg/SVG.java @@ -120,22 +120,26 @@ public class SVG extends FObj implements GraphicsCreator { getSVGLength(); svgArea = new SVGSVGElementImpl(); SVGAnimatedLength sal; + if (w == null) + w = new SVGLengthImpl(); sal = new SVGAnimatedLengthImpl(w); sal.setBaseVal(w); svgArea.setWidth(sal); + if (h == null) + h = new SVGLengthImpl(); sal = new SVGAnimatedLengthImpl(h); sal.setBaseVal(h); svgArea.setHeight(sal); - SVGLengthProperty lengthProp = - (SVGLengthProperty) this.properties.get("x"); - SVGLength x = lengthProp == null ? new SVGLengthImpl() : - lengthProp.getSVGLength(); + SVGLength lengthProp = + ((SVGLengthProperty) this.properties.get("x")). + getSVGLength(); + SVGLength x = lengthProp == null ? new SVGLengthImpl() : lengthProp; sal = new SVGAnimatedLengthImpl(x); sal.setBaseVal(x); svgArea.setX(sal); - lengthProp = (SVGLengthProperty) this.properties.get("y"); - SVGLength y = lengthProp == null ? new SVGLengthImpl() : - lengthProp.getSVGLength(); + lengthProp = ((SVGLengthProperty) this.properties.get("y")). + getSVGLength(); + SVGLength y = lengthProp == null ? new SVGLengthImpl() : lengthProp; sal = new SVGAnimatedLengthImpl(y); sal.setBaseVal(y); svgArea.setY(sal); |