Mercurial > mxd2map
changeset 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 | bab3946a8bdc 196abb30c0d2 |
files | ChangeLog src/java/de/intevation/mxd/writer/MapScriptWriter.java |
diffstat | 2 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Jun 07 13:35:02 2011 +0200 +++ b/ChangeLog Tue Jun 07 14:59:00 2011 +0200 @@ -1,3 +1,8 @@ +2011-06-07 Raimund Renkert <raimund.renkert@intevation.de> + + * src/java/de/intevation/mxd/writer/MapScriptWriter.java: + Set the class name to the layer name if it is empty. + 2011-06-07 Raimund Renkert <raimund.renkert@intevation.de> * src/java/de/intevation/mxd/writer/MapScriptWriter.java:
--- 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"));