Changeset 1798 in josm


Ignore:
Timestamp:
2009-07-16T19:19:05+02:00 (15 years ago)
Author:
Gubaer
Message:

ticket #2954: patch by plaicy - Creating new relations doesn't work

Location:
trunk/src/org/openstreetmap/josm/gui/dialogs/relation
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    r1795 r1798  
    541541            if(memberTableModel.getRowCount() == 0 && tagEditorModel.getKeys().isEmpty())
    542542                return;
    543             Relation clone = new Relation(getRelation());
    544             tagEditorModel.applyToPrimitive(clone);
    545             memberTableModel.applyToRelation(clone);
    546             Main.main.undoRedo.add(new AddCommand(clone));
     543            Relation newRelation = new Relation();
     544            tagEditorModel.applyToPrimitive(newRelation);
     545            memberTableModel.applyToRelation(newRelation);
     546            Main.main.undoRedo.add(new AddCommand(newRelation));
    547547            DataSet.fireSelectionChanged(Main.ds.getSelected());
    548548        } else if (! memberTableModel.hasSameMembersAs(getRelation()) || tagEditorModel.isDirty()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java

    r1794 r1798  
    113113        }
    114114        fireTableDataChanged();
     115        getSelectionModel();
    115116        listSelectionModel.clearSelection();
    116117        for (int row : selectedRows) {
     
    133134        }
    134135        fireTableDataChanged();
     136        getSelectionModel();
    135137        listSelectionModel.clearSelection();
    136138        for (int row : selectedRows) {
     
    209211            int row = members.indexOf(member);
    210212            if (row >= 0) {
     213                getSelectionModel();
    211214                listSelectionModel.addSelectionInterval(row,row);
    212215                min = Math.min(row, min);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java

    r1795 r1798  
    4141    private Relation relation;
    4242
    43     /** The version of the relation when editing is started. */
     43    /**
     44     * The version of the relation when editing is started.  This is
     45     * null if a new relation is created. */
    4446    private Relation relationSnapshot;
    4547
     
    102104        );
    103105
    104         this.relationSnapshot = new Relation(relation);
     106        this.relationSnapshot = (relation == null) ? null : new Relation(relation);
    105107        this.relation = relation;
    106108        this.layer = layer;
Note: See TracChangeset for help on using the changeset viewer.