Changeset 5393 in josm


Ignore:
Timestamp:
Aug 4, 2012 9:18:23 PM (10 months ago)
Author:
bastiK
Message:

beautify gpx output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/GpxWriter.java

    r2907 r5393  
    161161    private void writeTracks() { 
    162162        for (GpxTrack trk : data.tracks) { 
    163             open("trk"); 
     163            openln("trk"); 
    164164            writeAttr(trk.getAttributes()); 
    165165            for (GpxTrackSegment seg : trk.getSegments()) { 
     
    190190 
    191191    private void inline(String tag, String attributes) { 
    192         out.println(indent + "<" + tag + " " + attributes + " />"); 
     192        out.println(indent + "<" + tag + " " + attributes + "/>"); 
    193193    } 
    194194 
     
    248248        if (pnt != null) { 
    249249            LatLon c = pnt.getCoor(); 
    250             openAtt(type, "lat=\"" + c.lat() + "\" lon=\"" + c.lon() + "\""); 
    251             writeAttr(pnt.attr); 
    252             closeln(type); 
     250            String coordAttr = "lat=\"" + c.lat() + "\" lon=\"" + c.lon() + "\""; 
     251            if (pnt.attr.isEmpty()) { 
     252                inline(type, coordAttr); 
     253            } else { 
     254                openAtt(type, coordAttr); 
     255                writeAttr(pnt.attr); 
     256                closeln(type); 
     257            } 
    253258        } 
    254259    } 
Note: See TracChangeset for help on using the changeset viewer.