diff src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 99:d6d2a4058ebf

Set the class name to the layer name if it is empty.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 07 Jun 2011 14:59:00 +0200
parents 4696d0769f9c
children 3ca2ec55fb3b
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Tue Jun 07 13:35:02 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Tue Jun 07 14:59:00 2011 +0200
@@ -209,7 +209,14 @@
         for(int i = 0; i < list.getLength(); i++) {
             Element classElement = (Element)list.item(i);
             classObj co = new classObj(layer);
-            co.setName(classElement.getAttribute("name"));
+            String name = classElement.getAttribute("name");
+            if (name.equals("")) {
+                name = layerElement.getAttribute("name");
+                if (list.getLength() > 1) {
+                    name += "-" + i;
+                }
+            }
+            co.setName (name);
             if(classElement.hasAttribute("field_count")) {
                 int count =
                     Integer.parseInt(classElement.getAttribute("field_count"));
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)