Opened 9 months ago

Closed 9 months ago

#19285 closed enhancement (fixed)

[Patch] Ctrl+C (Copy) should keep the order of selection

Reported by: GerdP Owned by: team
Priority: normal Milestone: 20.05
Component: Core Version:
Keywords: Cc:

Description (last modified by GerdP)

Ctrl+C uses a HashSet to store selected elements and thus forgets the order.
It should keep the order as with this patch:

  • src/org/openstreetmap/josm/gui/datatransfer/data/

    66import java.util.ArrayList;
    77import java.util.Collection;
    88import java.util.Collections;
    9 import java.util.HashSet;
     9import java.util.LinkedHashSet;
    1010import java.util.LinkedList;
    1111import java.util.Queue;
     12import java.util.Set;
    6364     */
    6465    private PrimitiveTransferData(Collection<? extends OsmPrimitive> primitives, ReferenceGetter referencedGetter) {
    6566        // convert to hash set first to remove duplicates
    66         HashSet<OsmPrimitive> visited = new HashSet<>(primitives);
     67        Set<OsmPrimitive> visited = new LinkedHashSet<>(primitives);
    6768 = new ArrayList<>(visited.size());
    6970        this.referenced = new ArrayList<>();

Attachments (0)

Change History (3)

comment:1 Changed 9 months ago by GerdP

Description: modified (diff)
Milestone: 20.05
Summary: Ctrl+C (Copy) should prevent the order of selection[Patch] Ctrl+C (Copy) should keep the order of selection

comment:2 Changed 9 months ago by simon04


comment:3 Changed 9 months ago by GerdP

Resolution: fixed
Status: newclosed

In 16494/josm:

fix #19285: Ctrl+C (Copy) should keep the order of selection

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.