Bug 1421887 - fix the row index to get the right cell. r=dbaron

MozReview-Commit-ID: 4wIdFxeETiW
This commit is contained in:
Ya-Chieh Wu 2018-01-04 21:28:00 +02:00
Родитель 11f2a4970b
Коммит ef4a62d672
3 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -898,9 +898,12 @@ bool nsTableCellMap::RowHasSpanningCells(int32_t aRowIndex,
return false; return false;
} }
// FIXME: The only value callers pass for aSide is eLogicalSideBEnd.
// Consider removing support for the other three values.
void void
nsTableCellMap::ResetBStartStart(LogicalSide aSide, nsTableCellMap::ResetBStartStart(LogicalSide aSide,
nsCellMap& aCellMap, nsCellMap& aCellMap,
uint32_t aRowGroupStart,
uint32_t aRowIndex, uint32_t aRowIndex,
uint32_t aColIndex, uint32_t aColIndex,
bool aIsBEndIEnd) bool aIsBEndIEnd)
@ -915,7 +918,7 @@ nsTableCellMap::ResetBStartStart(LogicalSide aSide,
aRowIndex++; aRowIndex++;
MOZ_FALLTHROUGH; MOZ_FALLTHROUGH;
case eLogicalSideBStart: case eLogicalSideBStart:
cellData = (BCCellData*)aCellMap.GetDataAt(aRowIndex, aColIndex); cellData = (BCCellData*)aCellMap.GetDataAt(aRowIndex - aRowGroupStart, aColIndex);
if (cellData) { if (cellData) {
bcData = &cellData->mData; bcData = &cellData->mData;
} }
@ -938,7 +941,7 @@ nsTableCellMap::ResetBStartStart(LogicalSide aSide,
aColIndex++; aColIndex++;
MOZ_FALLTHROUGH; MOZ_FALLTHROUGH;
case eLogicalSideIStart: case eLogicalSideIStart:
cellData = (BCCellData*)aCellMap.GetDataAt(aRowIndex, aColIndex); cellData = (BCCellData*)aCellMap.GetDataAt(aRowIndex - aRowGroupStart, aColIndex);
if (cellData) { if (cellData) {
bcData = &cellData->mData; bcData = &cellData->mData;
} }

Просмотреть файл

@ -191,6 +191,7 @@ protected:
public: public:
void ResetBStartStart(mozilla::LogicalSide aSide, void ResetBStartStart(mozilla::LogicalSide aSide,
nsCellMap& aCellMap, nsCellMap& aCellMap,
uint32_t aRowGroupStart,
uint32_t aYPos, uint32_t aYPos,
uint32_t aXPos, uint32_t aXPos,
bool aIsBEndIEnd = false); bool aIsBEndIEnd = false);

Просмотреть файл

@ -6473,6 +6473,7 @@ nsTableFrame::CalcBCBorders()
// new segment // new segment
if (iter.mCellMap) { if (iter.mCellMap) {
tableCellMap->ResetBStartStart(eLogicalSideBEnd, *iter.mCellMap, tableCellMap->ResetBStartStart(eLogicalSideBEnd, *iter.mCellMap,
iter.mRowGroupStart,
info.GetCellEndRowIndex(), info.GetCellEndRowIndex(),
info.GetCellEndColIndex() + 1); info.GetCellEndColIndex() + 1);
} }