Skip to content

Commit 948c425

Browse files
committed
Fix table actions in sorted table
1 parent d33a538 commit 948c425

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/main/java/bindiffhelper/BinDiffHelperProvider.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,16 +407,15 @@ protected void doDiffWork() {
407407

408408
table.addMouseListener(new MouseAdapter() {
409409
public void mousePressed(MouseEvent e) {
410+
var entry = ctm.getEntry(table.convertRowIndexToModel(table.getSelectedRow()));
411+
410412
if (e.getClickCount() == 2 && table.getSelectedRow() != -1) {
411-
var entry = ctm.getEntry(table.getSelectedRow());
412-
//cvs.goTo(new ProgramLocation(program, entry.primaryAddress), true);
413413
PluginEvent ev = new ProgramLocationPluginEvent(null, new ProgramLocation(program, entry.primaryAddress), program);
414414
tool.firePluginEvent(ev);
415415

416416
if (secondary.prog != null && secondary.df != null) {
417417
Address secAddress = secondary.prog.getAddressFactory().getDefaultAddressSpace()
418418
.getAddress(entry.secondaryAddress);
419-
//secondary.cvs.goTo(new ProgramLocation(secondary.prog, secAddress), true);
420419
PluginEvent secev = new ProgramLocationPluginEvent(null, new ProgramLocation(secondary.prog, secAddress), secondary.prog);
421420

422421
for (var consumer : secondary.df.getConsumers()) {
@@ -430,7 +429,6 @@ public void mousePressed(MouseEvent e) {
430429
String pname = program.getDomainFile().getName().toString();
431430
String pname2 = secondary.prog.getDomainFile().getName().toString();
432431

433-
var entry = ctm.getEntry(table.getSelectedRow());
434432
try {
435433
Function function = program.getListing().getFunctionAt(entry.primaryAddress);
436434
Address secAddress = addrSpace2.getAddress(entry.secondaryAddress);

src/main/java/bindiffhelper/ToggleCheckSelectedAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public ToggleCheckSelectedAction(BinDiffHelperPlugin plugin) {
2525

2626
@Override
2727
public void actionPerformed(ActionContext context) {
28-
// TODO Auto-generated method stub
2928
if (plugin.provider.table != null) {
3029
for (var i : plugin.provider.table.getSelectedRows()) {
31-
Boolean currentlyChecked = (Boolean) plugin.provider.ctm.getValueAt(i, 0);
30+
int id = plugin.provider.table.convertRowIndexToModel(i);
31+
Boolean currentlyChecked = (Boolean) plugin.provider.ctm.getValueAt(id, 0);
3232

33-
plugin.provider.ctm.setValueAt(!currentlyChecked, i, 0);
33+
plugin.provider.ctm.setValueAt(!currentlyChecked, id, 0);
3434
}
3535
}
3636

0 commit comments

Comments
 (0)