diff --git a/platform/platform-api/src/com/intellij/ui/table/TableView.java b/platform/platform-api/src/com/intellij/ui/table/TableView.java index f329dd3bd866..2526e0f935a3 100644 --- a/platform/platform-api/src/com/intellij/ui/table/TableView.java +++ b/platform/platform-api/src/com/intellij/ui/table/TableView.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -173,6 +173,10 @@ public class TableView extends BaseTableView implements ItemsProvider, Sel return getListTableModel().getItems(); } + public Item getRow(int row) { + return getItems().get(convertRowIndexToModel(row)); + } + public void setMinRowHeight(int i) { setRowHeight(Math.max(i, getRowHeight())); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java index a6ee38858fb0..f6b02c6a7ed5 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -855,14 +855,13 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton { showDifferences(myVcs.getProject(), sel.get(0), sel.get(sel.size() - 1)); } else if (selectionSize == 1) { - final TableView flatView = myDualView.getFlatView(); - final TableViewModel model = flatView.getTableViewModel(); + final TableView flatView = myDualView.getFlatView(); final int selectedRow = flatView.getSelectedRow(); - if (selectedRow == (model.getRowCount() - 1)) { + if (selectedRow == (flatView.getRowCount() - 1)) { // no previous showDifferences(myVcs.getProject(), VcsFileRevision.NULL, getFirstSelectedRevision()); } else { - showDifferences(myVcs.getProject(), (VcsFileRevision)model.getRowValue(selectedRow + 1), getFirstSelectedRevision()); + showDifferences(myVcs.getProject(), flatView.getRow(selectedRow + 1), getFirstSelectedRevision()); } } }