Changeset 26804 in osm
- Timestamp:
- 2011-10-08T12:00:46+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/dumbutils
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/dumbutils/PasteRelationsAction.java
r26269 r26804 55 55 boolean changed = false; 56 56 for( OsmPrimitive p : selection ) { 57 if( !r.getMemberPrimitives().contains(p) ) {57 if( !r.getMemberPrimitives().contains(p) && !r.equals(p) ) { 58 58 r.addMember(new RelationMember(relations.get(rel), p)); 59 59 changed = true; -
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/dumbutils/ReplaceGeometryAction.java
r25887 r26804 32 32 } 33 33 34 @Override 34 35 public void actionPerformed( ActionEvent e ) { 35 36 if( getCurrentDataSet() == null ) return; … … 43 44 } 44 45 int idxNew = selection.get(0).isNew() ? 0 : 1; 46 boolean overrideNewCheck = false; 47 if( selection.get(1-idxNew).isNew() ) { 48 // if both are new, select the one with all the DB nodes 49 boolean areNewNodes = false; 50 for( Node n : selection.get(0).getNodes() ) 51 if( n.isNew() ) 52 areNewNodes = true; 53 idxNew = areNewNodes ? 0 : 1; 54 overrideNewCheck = true; 55 for( Node n : selection.get(1-idxNew).getNodes() ) 56 if( n.isNew() ) 57 overrideNewCheck = false; 58 } 45 59 Way geometry = selection.get(idxNew); 46 60 Way way = selection.get(1 - idxNew); 47 if( way.isNew() || !geometry.isNew() ) {61 if( !overrideNewCheck && (way.isNew() || !geometry.isNew()) ) { 48 62 JOptionPane.showMessageDialog(Main.parent, 49 63 tr("Please select one way that exists in the database and one new way with correct geometry."),
Note:
See TracChangeset
for help on using the changeset viewer.