Changeset 26460 in osm for applications


Ignore:
Timestamp:
2011-08-06T08:05:16+02:00 (13 years ago)
Author:
akks
Message:

'FastDraw: fix NPE and relation bugs after editing'

Location:
applications/editors/josm/plugins/FastDraw
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/FastDraw/build.xml

    r26457 r26460  
    3030<project name="FastDraw" default="dist" basedir=".">
    3131    <!-- enter the SVN commit message -->
    32     <property name="commit.message" value="FastDraw: fix NPE in last segment drawing"/>
     32    <property name="commit.message" value="FastDraw: fix NPE and relation bugs after editing"/>
    3333    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    3434    <property name="plugin.main.version" value="4201"/>
     
    248248    <target name="runjosm" depends="install">
    249249        <java jar="${josm}" fork="true">
    250             <arg line="../../core/data_nodist/restriction.osm"/>
     250            <arg line="../../core/data_nodist/multipolygon.osm"/>
    251251        </java>
    252252    </target>
  • applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawingMode.java

    r26457 r26460  
    554554                    List<OsmPrimitive> refs = nd.getReferrers();
    555555                    // does someone need this node? if no-delete it.
    556                     if (refs.isEmpty()) cmds.add(new DeleteCommand(nd));                                       
     556                    if (refs.isEmpty() && !nd.isDeleted() && nd.isUsable()) cmds.add(new DeleteCommand(nd));                                       
    557557                }
    558558            }
     
    663663        if (w.isClosed()) line.closeLine();
    664664        oldNodes = w.getNodes();
    665         cmds.add(new DeleteCommand(w));
     665        List <OsmPrimitive> wl = new ArrayList(); wl.add(w);
     666       
     667        Command c = DeleteCommand.delete(getEditLayer(), wl, false);
     668        if (c != null) cmds.add(c);
    666669        delCmd = new SequenceCommand(tr("Convert way to FastDraw line"), cmds);
    667670        Main.main.undoRedo.add(delCmd);
Note: See TracChangeset for help on using the changeset viewer.