changeset 663:51172d56e8bc

Only generate an axis element if a axis really exists. flys-artifacts/trunk@2075 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 08 Jun 2011 10:19:23 +0000
parents 60f24fca574a
children e006da5679d2
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/InfoGeneratorHelper.java
diffstat 2 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Jun 07 21:01:09 2011 +0000
+++ b/flys-artifacts/ChangeLog	Wed Jun 08 10:19:23 2011 +0000
@@ -1,3 +1,8 @@
+2011-06-08  Sascha L. Teichmann <sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/exports/InfoGeneratorHelper.java:
+	  Only generate an axis element if a axis really exists.
+
 2011-06-07  Sascha L. Teichmann <sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/math/BackJumpCorrector.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/InfoGeneratorHelper.java	Tue Jun 07 21:01:09 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/InfoGeneratorHelper.java	Wed Jun 08 10:19:23 2011 +0000
@@ -88,20 +88,18 @@
 
         int dAxisCount = plot.getDomainAxisCount();
         for (int i = 0; i < dAxisCount; i++) {
-            Element e = createAxisElement(
-                cr, plot.getDomainAxis(i), "domain", i);
-
-            if (e != null) {
+            ValueAxis axis = plot.getDomainAxis(i);
+            if (axis != null) {
+                Element e = createAxisElement(cr, axis, "domain", i);
                 axes.appendChild(e);
             }
         }
 
         int rAxisCount = plot.getRangeAxisCount();
         for (int i = 0; i < rAxisCount; i++) {
-            Element e = createAxisElement(
-                cr, plot.getRangeAxis(i), "range", i);
-
-            if (e != null) {
+            ValueAxis axis = plot.getRangeAxis(i);
+            if (axis != null) {
+                Element e = createAxisElement(cr, axis, "range", i);
                 axes.appendChild(e);
             }
         }

http://dive4elements.wald.intevation.org