Changeset 4148 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2011-06-19T18:35:06+02:00 (13 years ago)
Author:
stoecker
Message:

fix #6198 - preset applied to invalid objects

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PresetListPanel.java

    r3720 r4148  
    5757        }
    5858        public void mouseClicked(MouseEvent arg0) {
    59             Collection<OsmPrimitive> selection = presetHandler.getSelection();
     59            Collection<OsmPrimitive> selection = tag.createSelection(presetHandler.getSelection());
    6060            if (selection == null || selection.isEmpty())
    6161                return;
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r4145 r4148  
    13581358        if (Main.main.getCurrentDataSet() == null) return;
    13591359
    1360         Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getSelected();
     1360        Collection<OsmPrimitive> sel = createSelection(Main.main.getCurrentDataSet().getSelected());
    13611361        int answer = showDialog(sel, supportsRelation());
    13621362
     
    13891389    }
    13901390
    1391     public int showDialog(Collection<OsmPrimitive> selection, final boolean showNewRelation) {
    1392         Collection<OsmPrimitive> sel = createSelection(selection);
     1391    public int showDialog(Collection<OsmPrimitive> sel, final boolean showNewRelation) {
    13931392        PresetPanel p = createPanel(sel);
    13941393        if (p == null)
     
    14471446     * @return Cleaned list with suitable OsmPrimitives only
    14481447     */
    1449     private Collection<OsmPrimitive> createSelection(Collection<OsmPrimitive> participants) {
     1448    public Collection<OsmPrimitive> createSelection(Collection<OsmPrimitive> participants) {
    14501449        originalSelectionEmpty = participants.size() == 0;
    14511450        Collection<OsmPrimitive> sel = new LinkedList<OsmPrimitive>();
Note: See TracChangeset for help on using the changeset viewer.