Ignore:
Timestamp:
2015-04-14T23:10:19+02:00 (10 years ago)
Author:
simon04
Message:

Download objects: prefill ids from copied objects

The syntax from CopyAction is e.g. node 123 and has not been parsed yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CopyAction.java

    r6920 r8194  
    5757    public static void copy(OsmDataLayer source, Collection<OsmPrimitive> primitives) {
    5858        /* copy ids to the clipboard */
     59        String ids = getCopyString(primitives);
     60        Utils.copyToClipboard(ids);
     61
     62        Main.pasteBuffer.makeCopy(primitives);
     63        Main.pasteSource = source;
     64    }
     65
     66    public static String getCopyString(Collection<? extends OsmPrimitive> primitives) {
    5967        StringBuilder idsBuilder = new StringBuilder();
    6068        for (OsmPrimitive p : primitives) {
     
    6270            idsBuilder.append(p.getId()).append(",");
    6371        }
    64         String ids = idsBuilder.substring(0, idsBuilder.length() - 1);
    65         Utils.copyToClipboard(ids);
    66 
    67         Main.pasteBuffer.makeCopy(primitives);
    68         Main.pasteSource = source;
     72        return idsBuilder.substring(0, idsBuilder.length() - 1);
    6973    }
    7074
Note: See TracChangeset for help on using the changeset viewer.