Bug 416742 - Regression: multiple rowgroups interfere with getColumnAtIndex(), r=bernd, sr=roc, a=beltzner

This commit is contained in:
surkov.alexander@gmail.com 2008-03-07 02:14:35 -08:00
parent 1095ea5a72
commit 17652cbd2d
2 changed files with 4 additions and 3 deletions

View File

@ -48,6 +48,7 @@ include $(topsrcdir)/config/rules.mk
_TEST_FILES =\ _TEST_FILES =\
test_bug368835.xul \ test_bug368835.xul \
test_groupattrs.xul \ test_groupattrs.xul \
test_table_indexes.html \
test_nsIAccessibleTable_1.html \ test_nsIAccessibleTable_1.html \
test_nsIAccessibleTable_2.html \ test_nsIAccessibleTable_2.html \
test_nsIAccessibleTable_3.html \ test_nsIAccessibleTable_3.html \

View File

@ -903,7 +903,7 @@ nsTableCellMap::GetIndexByRowAndColumn(PRInt32 aRow, PRInt32 aColumn) const
nsCellMap* cellMap = mFirstMap; nsCellMap* cellMap = mFirstMap;
while (cellMap) { while (cellMap) {
PRInt32 rowCount = cellMap->GetRowCount(); PRInt32 rowCount = cellMap->GetRowCount();
if (rowCount < rowIndex) { if (rowIndex >= rowCount) {
// If the rowCount is less than the rowIndex, this means that the index is // If the rowCount is less than the rowIndex, this means that the index is
// not within the current map. If so, get the index of the last cell in // not within the current map. If so, get the index of the last cell in
// the last row. // the last row.
@ -911,7 +911,7 @@ nsTableCellMap::GetIndexByRowAndColumn(PRInt32 aRow, PRInt32 aColumn) const
rowCount - 1, rowCount - 1,
colCount - 1); colCount - 1);
if (cellMapIdx != -1) { if (cellMapIdx != -1) {
index += cellMapIdx; index += cellMapIdx + 1;
rowIndex -= rowCount; rowIndex -= rowCount;
} }
} else { } else {
@ -955,7 +955,7 @@ nsTableCellMap::GetRowAndColumnByIndex(PRInt32 aIndex,
if (index > cellMapIdx) { if (index > cellMapIdx) {
// The index is not within this map, so decrease it by the cellMapIdx // The index is not within this map, so decrease it by the cellMapIdx
// determined index and increase the total row index accordingly. // determined index and increase the total row index accordingly.
index -= cellMapIdx; index -= cellMapIdx + 1;
previousRows += rowCount; previousRows += rowCount;
} else { } else {
cellMap->GetRowAndColumnByIndex(colCount, index, aRow, aColumn); cellMap->GetRowAndColumnByIndex(colCount, index, aRow, aColumn);