Fix: Bugs about discarding comment editor.

Bugs:
1> In SideBySide diff view if there are more
comments with a neighbor comment editor
like:

  comment-editor | comment-1
                 | comment-2

discard the editor, the page get messed:

                 | comment-1
        omment-2 |

2> If there is an editor with another comment
on the same line, discard the editor, its frame
will still be there.

3> If there is a comment on the top of an
editor, discard the editor, the above one's
bottom line will gone.

This commit fixed these bugs.

Change-Id: Iadc565b433f7121235d46eefff2b22a2b780b434
This commit is contained in:
Bruce Zu
2012-10-23 17:42:59 +08:00
parent 4d26617509
commit 5211fb7bd5

View File

@@ -137,8 +137,8 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
p = p.getParent();
}
if (Gerrit.RESOURCES.css().commentHolder().equals(
table.getCellFormatter().getStyleName(row - 1, cell))) {
if (table.getCellFormatter().getStyleName(row - 1, cell)
.contains(Gerrit.RESOURCES.css().commentHolder())) {
table.getCellFormatter().addStyleName(row - 1, cell,
Gerrit.RESOURCES.css().commentPanelLast());
}
@@ -560,14 +560,23 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
}
}
table.removeRow(row);
} else if (span != 1) {
table.getFlexCellFormatter().setRowSpan(row, col, 1);
for (int r = row + 1; r < row + span; r++) {
table.insertCell(r, col + 1);
} else {
table.getFlexCellFormatter().setStyleName(//
row, col, Gerrit.RESOURCES.css().diffText());
if (span != 1) {
table.getFlexCellFormatter().setRowSpan(row, col, 1);
for (int r = row + 1; r < row + span; r++) {
table.insertCell(r, col);
table.getFlexCellFormatter().setStyleName(//
r, col, Gerrit.RESOURCES.css().diffText());
}
}
}
}
protected void bindComment(final int row, final int col,
final PatchLineComment line, final boolean isLast, boolean expandComment) {
if (line.getStatus() == PatchLineComment.Status.DRAFT) {