recover more gracefully from a error condition where cells are inserted into the cellmap after the last column bug 351328 r/sr=bzbarsky

This commit is contained in:
bmlk%gmx.de 2006-09-11 18:18:08 +00:00
Родитель 1a819479e6
Коммит 06d5ebe18c
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -1571,10 +1571,11 @@ void nsCellMap::InsertCells(nsTableCellMap& aMap,
nsRect& aDamageArea)
{
if (aCellFrames.Count() == 0) return;
NS_ASSERTION(aColIndexBefore >= -1, "index out of range");
PRInt32 numCols = aMap.GetColCount();
if (aColIndexBefore >= numCols) {
NS_ASSERTION(PR_FALSE, "bad arg in nsCellMap::InsertCellAt");
return;
NS_ERROR("Inserting instead of appending cells indicates a serious cellmap error");
aColIndexBefore = numCols - 1;
}
// get the starting col index of the 1st new cells