mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
prevent index out of bounds during multiselect
This commit is contained in:
parent
9ea43527b1
commit
bf1e95d577
@ -87,7 +87,6 @@ import javafx.scene.paint.Color;
|
|||||||
import javafx.util.Duration;
|
import javafx.util.Duration;
|
||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
|
|
||||||
import org.controlsfx.control.GridCell;
|
import org.controlsfx.control.GridCell;
|
||||||
import org.controlsfx.control.GridView;
|
import org.controlsfx.control.GridView;
|
||||||
import org.controlsfx.control.SegmentedButton;
|
import org.controlsfx.control.SegmentedButton;
|
||||||
@ -775,7 +774,7 @@ public class GroupPane extends BorderPane implements GroupView {
|
|||||||
if (shiftDown) {
|
if (shiftDown) {
|
||||||
//TODO: do more hear to implement slicker multiselect
|
//TODO: do more hear to implement slicker multiselect
|
||||||
int endIndex = grouping.get().fileIds().indexOf(newFileID);
|
int endIndex = grouping.get().fileIds().indexOf(newFileID);
|
||||||
int startIndex = IntStream.of(grouping.get().fileIds().size(), selectionAnchorIndex, endIndex).min().getAsInt();
|
int startIndex = IntStream.of(0, grouping.get().fileIds().size(), selectionAnchorIndex, endIndex).min().getAsInt();
|
||||||
endIndex = IntStream.of(0, selectionAnchorIndex, endIndex).max().getAsInt();
|
endIndex = IntStream.of(0, selectionAnchorIndex, endIndex).max().getAsInt();
|
||||||
List<Long> subList = grouping.get().fileIds().subList(startIndex, endIndex + 1);
|
List<Long> subList = grouping.get().fileIds().subList(startIndex, endIndex + 1);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user