Modify

Opened 12 years ago

Closed 8 years ago

#9816 closed defect (irreproducible)

incorrectly pasted relation tags

Reported by: richlv Owned by: richlv
Priority: normal Milestone:
Component: Core Version: tested
Keywords: Cc:

Description

see the attached testcase. select the upper way, right click relation in the "member of" section, choose select relation. ctrl+c.

select the lower way, add a new relation, click on "paste tags from buffer" button.

notice how one of the tags has the value only, not the tag itself. click 'ok', observe the contents of the new relation. one tag is lost.

josm 6891

Attachments (1)

relation-tag-copying.osm (1.2 KB ) - added by richlv 12 years ago.

Download all attachments as: .zip

Change History (4)

by richlv, 12 years ago

Attachment: relation-tag-copying.osm added

comment:1 by simon04, 12 years ago

Tracing this bug down revealed that the field with the (editing) focus is somehow cleared after correctly updating the table model.

This patch mitigates the problem by appending the tags to the end of the table … Not a great solution, though …

  • src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java

    diff --git a/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java b/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
    index 2842615..85a62b3 100644
    a b public class TagEditorModel extends AbstractTableModel {  
    209209        TagModel tag = get(name);
    210210        if (tag == null) {
    211211            tag = new TagModel(name, value);
    212             int index = tags.size();
    213             while (index >= 1 && tags.get(index - 1).getName().isEmpty() && tags.get(index - 1).getValue().isEmpty()) {
    214                 index--; // If last line(s) is empty, add new tag before it
    215             }
    216             tags.add(index, tag);
     212            tags.add(tag);
    217213        } else {
    218214            tag.addValue(value);
    219215        }

comment:2 by Don-vip, 8 years ago

Owner: changed from team to richlv
Status: newneedinfo

I can't reproduce with r13159, I think this is fixed. Can you please confirm?

comment:3 by Don-vip, 8 years ago

Resolution: irreproducible
Status: needinfoclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain richlv.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.