Changeset 6321 in josm for trunk/src


Ignore:
Timestamp:
2013-10-23T20:08:09+02:00 (11 years ago)
Author:
akks
Message:

fix #9200: repair tags copy-pasting

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

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

    r6320 r6321  
    2424 */
    2525public final class CopyAction extends JosmAction {
     26   
     27    // regular expression that matches text clipboard contents after copying
     28    public static final String CLIPBOARD_REGEXP = "((node|way|relation)\\s\\d+,)*(node|way|relation)\\s\\d+";
    2629
    2730    /**
     
    5356        StringBuilder idsBuilder = new StringBuilder();
    5457        for (OsmPrimitive p : primitives) {
    55             idsBuilder.append(OsmPrimitiveType.from(p)).append(" ");
     58            idsBuilder.append(OsmPrimitiveType.from(p).getAPIName()).append(" ");
    5659            idsBuilder.append(p.getId()).append(",");
    5760        }
  • trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java

    r6258 r6321  
    254254
    255255        String buf = Utils.getClipboardContent();
    256         if (buf == null || buf.isEmpty() || buf.matches("(\\d+,)*\\d+")) {
     256        if (buf == null || buf.isEmpty() || buf.matches(CopyAction.CLIPBOARD_REGEXP)) {
    257257            pasteTagsFromJOSMBuffer(selection);
    258258        } else {
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java

    r6319 r6321  
    3838
    3939import org.openstreetmap.josm.Main;
     40import org.openstreetmap.josm.actions.CopyAction;
    4041import org.openstreetmap.josm.actions.PasteTagsAction;
    4142import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    334335           
    335336            String buf = Utils.getClipboardContent();
    336             if (buf == null || buf.isEmpty() || buf.matches("(\\d+,)*\\d+")) {
     337            if (buf == null || buf.isEmpty() || buf.matches(CopyAction.CLIPBOARD_REGEXP)) {
    337338                List<PrimitiveData> directlyAdded = Main.pasteBuffer.getDirectlyAdded();
    338339                if (directlyAdded==null || directlyAdded.isEmpty()) return;
Note: See TracChangeset for help on using the changeset viewer.