From b0654bda46490a29cddf9dc37b93efd8afbb3eba Mon Sep 17 00:00:00 2001 From: "bmlk%gmx.de" Date: Mon, 11 Sep 2006 18:27:35 +0000 Subject: [PATCH] enable old assert (from 2001) to catch cellmap errors, fix one erroneus caller bug 351691 r/sr=bzbarsky git-svn-id: svn://10.0.0.236/trunk@209742 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/tables/nsTableFrame.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index c478c7a9b08..f6248690113 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -536,11 +536,13 @@ PRInt32 nsTableFrame::GetEffectiveColCount() const PRInt32 nsTableFrame::GetIndexOfLastRealCol() { PRInt32 numCols = mColFrames.Count(); - for (PRInt32 colX = numCols; colX >= 0; colX--) { - nsTableColFrame* colFrame = GetColFrame(colX); - if (colFrame) { - if (eColAnonymousCell != colFrame->GetColType()) { - return colX; + if (numCols > 0) { + for (PRInt32 colX = numCols - 1; colX >= 0; colX--) { + nsTableColFrame* colFrame = GetColFrame(colX); + if (colFrame) { + if (eColAnonymousCell != colFrame->GetColType()) { + return colX; + } } } } @@ -556,7 +558,7 @@ nsTableFrame::GetColFrame(PRInt32 aColIndex) const return (nsTableColFrame *)mColFrames.ElementAt(aColIndex); } else { - //NS_ASSERTION(PR_FALSE, "invalid col index"); + NS_ERROR("invalid col index"); return nsnull; } }