Changeset 16600 in josm


Ignore:
Timestamp:
2020-06-11T14:19:07+02:00 (4 years ago)
Author:
simon04
Message:

see #19330 - SelectionSynchronizer: do not interpolate selection interval gaps

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/SelectionSynchronizer.java

    r15769 r16600  
    99import javax.swing.event.ListSelectionEvent;
    1010import javax.swing.event.ListSelectionListener;
     11
     12import org.openstreetmap.josm.gui.util.TableHelper;
    1113
    1214/**
     
    5153        preventRecursion = true;
    5254        DefaultListSelectionModel referenceModel = (DefaultListSelectionModel) e.getSource();
    53         int i = referenceModel.getMinSelectionIndex();
    54         int j = referenceModel.getMaxSelectionIndex();
    5555        for (ListSelectionModel model : participants) {
    5656            if (model == e.getSource()) {
    5757                continue;
    5858            }
    59             model.setSelectionInterval(i, j);
     59            model.clearSelection();
     60            for (int i : TableHelper.getSelectedIndices(referenceModel)) {
     61                model.addSelectionInterval(i, i);
     62            }
    6063        }
    6164        preventRecursion = false;
  • trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java

    r16215 r16600  
    99import org.junit.Rule;
    1010import org.junit.Test;
     11import org.openstreetmap.hot.sds.SeparateDataStorePlugin;
    1112import org.openstreetmap.josm.testutils.JOSMTestRules;
    1213
     
    2324    @Rule
    2425    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    25     public JOSMTestRules rules = new JOSMTestRules().projection();
     26    public JOSMTestRules rules = new JOSMTestRules().projection().main();
    2627
    2728
     
    3132    @Test
    3233    public void testUtilityClass() {
     34        new SeparateDataStorePlugin(null);
    3335        Logging.clearLastErrorAndWarnings();
    3436        Territories.initialize();
Note: See TracChangeset for help on using the changeset viewer.