replace assertions with printf statements until bug 10911 gets resolved

This commit is contained in:
karnaze%netscape.com 1999-08-03 23:17:50 +00:00
Родитель 41882c9270
Коммит 6d399a4f42
2 изменённых файлов: 32 добавлений и 18 удалений

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

@ -21,7 +21,7 @@
#include "nscore.h" #include "nscore.h"
#include "celldata.h" #include "celldata.h"
#include "nsVoidArray.h" #include "nsVoidArray.h"
#include "stdio.h" // XXX look at this when bug 10911 get fixed
class nsTableColFrame; class nsTableColFrame;
class nsTableCellFrame; class nsTableCellFrame;
@ -162,9 +162,11 @@ protected:
inline CellData* nsCellMap::GetCellAt(PRInt32 aRowIndex, inline CellData* nsCellMap::GetCellAt(PRInt32 aRowIndex,
PRInt32 aColIndex) const PRInt32 aColIndex) const
{ {
NS_PRECONDITION((0 <= aRowIndex) && (aRowIndex < mRowCount), "GetCellAt: bad row index"); if ((0 > aRowIndex) || (aRowIndex >= mRowCount) ||
PRInt32 colCount = mNumCellsInCol.Count(); (0 > aColIndex) || (aColIndex >= mNumCellsInCol.Count())) {
NS_PRECONDITION((0 <= aColIndex) && (aColIndex < colCount), "GetCellAt: bad col index"); printf("%s \n", "nsCellMap::GetCellAt called with invalid row or col index"); // XXX look at this when bug 10911 get fixed
return nsnull;
}
CellData* result = nsnull; CellData* result = nsnull;
nsVoidArray* row = (nsVoidArray *)(mRows.ElementAt(aRowIndex)); nsVoidArray* row = (nsVoidArray *)(mRows.ElementAt(aRowIndex));
@ -176,8 +178,11 @@ inline CellData* nsCellMap::GetCellAt(PRInt32 aRowIndex,
inline CellData* nsCellMap::GetMapCellAt(PRInt32 aMapRowIndex, inline CellData* nsCellMap::GetMapCellAt(PRInt32 aMapRowIndex,
PRInt32 aColIndex) const PRInt32 aColIndex) const
{ {
NS_PRECONDITION((0 <= aMapRowIndex) && (aMapRowIndex < mRows.Count()), "GetMapCellAt: bad row index"); if ((0 > aMapRowIndex) || (aMapRowIndex >= mRows.Count()) ||
NS_PRECONDITION((0 <= aColIndex) && (aColIndex < mNumCellsInCol.Count()), "GetMapCellAt: bad col index"); (0 > aColIndex) || (aColIndex >= mNumCellsInCol.Count())) {
printf("%s \n", "nsCellMap::GetMapCellAt called with invalid row or col index"); // XXX look at this when bug 10911 get fixed
return nsnull;
}
CellData* result = nsnull; CellData* result = nsnull;
nsVoidArray* row = (nsVoidArray *)(mRows.ElementAt(aMapRowIndex)); nsVoidArray* row = (nsVoidArray *)(mRows.ElementAt(aMapRowIndex));
@ -189,9 +194,11 @@ inline CellData* nsCellMap::GetMapCellAt(PRInt32 aMapRowIndex,
inline nsTableCellFrame* nsCellMap::GetCellFrameAt(PRInt32 aRowIndex, inline nsTableCellFrame* nsCellMap::GetCellFrameAt(PRInt32 aRowIndex,
PRInt32 aColIndex) const PRInt32 aColIndex) const
{ {
NS_PRECONDITION((0 <= aRowIndex) && (aRowIndex < mRowCount), "GetCellFrameAt: bad row index"); if ((0 > aRowIndex) || (aRowIndex >= mRowCount) ||
PRInt32 colCount = mNumCellsInCol.Count(); (0 > aColIndex) || (aColIndex >= mNumCellsInCol.Count())) {
NS_PRECONDITION((0 <= aColIndex) && (aColIndex < colCount), "GetCellFrameAt: bad col index"); printf("%s \n", "nsCellMap::GetCellAt called with invalid row or col index"); // XXX look at this when bug 10911 get fixed
return nsnull;
}
nsTableCellFrame* result = nsnull; nsTableCellFrame* result = nsnull;
CellData* cellData = GetCellAt(aRowIndex, aColIndex); CellData* cellData = GetCellAt(aRowIndex, aColIndex);

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

@ -21,7 +21,7 @@
#include "nscore.h" #include "nscore.h"
#include "celldata.h" #include "celldata.h"
#include "nsVoidArray.h" #include "nsVoidArray.h"
#include "stdio.h" // XXX look at this when bug 10911 get fixed
class nsTableColFrame; class nsTableColFrame;
class nsTableCellFrame; class nsTableCellFrame;
@ -162,9 +162,11 @@ protected:
inline CellData* nsCellMap::GetCellAt(PRInt32 aRowIndex, inline CellData* nsCellMap::GetCellAt(PRInt32 aRowIndex,
PRInt32 aColIndex) const PRInt32 aColIndex) const
{ {
NS_PRECONDITION((0 <= aRowIndex) && (aRowIndex < mRowCount), "GetCellAt: bad row index"); if ((0 > aRowIndex) || (aRowIndex >= mRowCount) ||
PRInt32 colCount = mNumCellsInCol.Count(); (0 > aColIndex) || (aColIndex >= mNumCellsInCol.Count())) {
NS_PRECONDITION((0 <= aColIndex) && (aColIndex < colCount), "GetCellAt: bad col index"); printf("%s \n", "nsCellMap::GetCellAt called with invalid row or col index"); // XXX look at this when bug 10911 get fixed
return nsnull;
}
CellData* result = nsnull; CellData* result = nsnull;
nsVoidArray* row = (nsVoidArray *)(mRows.ElementAt(aRowIndex)); nsVoidArray* row = (nsVoidArray *)(mRows.ElementAt(aRowIndex));
@ -176,8 +178,11 @@ inline CellData* nsCellMap::GetCellAt(PRInt32 aRowIndex,
inline CellData* nsCellMap::GetMapCellAt(PRInt32 aMapRowIndex, inline CellData* nsCellMap::GetMapCellAt(PRInt32 aMapRowIndex,
PRInt32 aColIndex) const PRInt32 aColIndex) const
{ {
NS_PRECONDITION((0 <= aMapRowIndex) && (aMapRowIndex < mRows.Count()), "GetMapCellAt: bad row index"); if ((0 > aMapRowIndex) || (aMapRowIndex >= mRows.Count()) ||
NS_PRECONDITION((0 <= aColIndex) && (aColIndex < mNumCellsInCol.Count()), "GetMapCellAt: bad col index"); (0 > aColIndex) || (aColIndex >= mNumCellsInCol.Count())) {
printf("%s \n", "nsCellMap::GetMapCellAt called with invalid row or col index"); // XXX look at this when bug 10911 get fixed
return nsnull;
}
CellData* result = nsnull; CellData* result = nsnull;
nsVoidArray* row = (nsVoidArray *)(mRows.ElementAt(aMapRowIndex)); nsVoidArray* row = (nsVoidArray *)(mRows.ElementAt(aMapRowIndex));
@ -189,9 +194,11 @@ inline CellData* nsCellMap::GetMapCellAt(PRInt32 aMapRowIndex,
inline nsTableCellFrame* nsCellMap::GetCellFrameAt(PRInt32 aRowIndex, inline nsTableCellFrame* nsCellMap::GetCellFrameAt(PRInt32 aRowIndex,
PRInt32 aColIndex) const PRInt32 aColIndex) const
{ {
NS_PRECONDITION((0 <= aRowIndex) && (aRowIndex < mRowCount), "GetCellFrameAt: bad row index"); if ((0 > aRowIndex) || (aRowIndex >= mRowCount) ||
PRInt32 colCount = mNumCellsInCol.Count(); (0 > aColIndex) || (aColIndex >= mNumCellsInCol.Count())) {
NS_PRECONDITION((0 <= aColIndex) && (aColIndex < colCount), "GetCellFrameAt: bad col index"); printf("%s \n", "nsCellMap::GetCellAt called with invalid row or col index"); // XXX look at this when bug 10911 get fixed
return nsnull;
}
nsTableCellFrame* result = nsnull; nsTableCellFrame* result = nsnull;
CellData* cellData = GetCellAt(aRowIndex, aColIndex); CellData* cellData = GetCellAt(aRowIndex, aColIndex);