bug 44523 - Get the actual rg from the cell in AppendCell rather than use the row index. sr=attinasi

This commit is contained in:
karnaze%netscape.com 2001-03-28 21:25:13 +00:00
Родитель bc45e0b73b
Коммит 8825aad0b0
4 изменённых файлов: 24 добавлений и 10 удалений

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

@ -311,10 +311,16 @@ nsTableCellMap::AppendCell(nsTableCellFrame& aCellFrame,
PRBool aRebuildIfNecessary)
{
NS_ASSERTION(&aCellFrame == aCellFrame.GetFirstInFlow(), "invalid call on continuing frame");
nsIFrame* rgFrame = nsnull;
aCellFrame.GetParent(&rgFrame); // get the row
if (!rgFrame) return 0;
rgFrame->GetParent(&rgFrame); // get the row group
if (!rgFrame) return 0;
PRInt32 rowIndex = aRowIndex;
nsCellMap* cellMap = mFirstMap;
while (cellMap) {
if (cellMap->GetRowCount() > rowIndex) {
if (cellMap->GetRowGroup() == rgFrame) {
return cellMap->AppendCell(*this, aCellFrame, rowIndex, aRebuildIfNecessary);
}
rowIndex -= cellMap->GetRowCount();

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

@ -211,8 +211,8 @@ public:
PRInt32 GetNumCellsOriginatingInRow(PRInt32 aRowIndex) const;
PRInt32 GetNumCellsOriginatingInCol(PRInt32 aColIndex) const;
/** return the actual number of rows in the table represented by this CellMap */
PRInt32 GetRowCount() const;
/** return the number of rows in the table represented by this CellMap */
PRInt32 GetRowCount(PRBool aConsiderDeadRowSpanRows = PR_FALSE) const;
nsTableCellFrame* GetCellInfoAt(nsTableCellMap& aMap,
PRInt32 aRowX,
@ -374,9 +374,10 @@ inline nsTableRowGroupFrame* nsCellMap::GetRowGroup() const
return mRowGroupFrame;
}
inline PRInt32 nsCellMap::GetRowCount() const
inline PRInt32 nsCellMap::GetRowCount(PRBool aConsiderDeadRowSpanRows) const
{
return mRowCount;
PRInt32 rowCount = (aConsiderDeadRowSpanRows) ? mRows.Count() : mRowCount;
return rowCount;
}
// nsColInfo

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

@ -311,10 +311,16 @@ nsTableCellMap::AppendCell(nsTableCellFrame& aCellFrame,
PRBool aRebuildIfNecessary)
{
NS_ASSERTION(&aCellFrame == aCellFrame.GetFirstInFlow(), "invalid call on continuing frame");
nsIFrame* rgFrame = nsnull;
aCellFrame.GetParent(&rgFrame); // get the row
if (!rgFrame) return 0;
rgFrame->GetParent(&rgFrame); // get the row group
if (!rgFrame) return 0;
PRInt32 rowIndex = aRowIndex;
nsCellMap* cellMap = mFirstMap;
while (cellMap) {
if (cellMap->GetRowCount() > rowIndex) {
if (cellMap->GetRowGroup() == rgFrame) {
return cellMap->AppendCell(*this, aCellFrame, rowIndex, aRebuildIfNecessary);
}
rowIndex -= cellMap->GetRowCount();

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

@ -211,8 +211,8 @@ public:
PRInt32 GetNumCellsOriginatingInRow(PRInt32 aRowIndex) const;
PRInt32 GetNumCellsOriginatingInCol(PRInt32 aColIndex) const;
/** return the actual number of rows in the table represented by this CellMap */
PRInt32 GetRowCount() const;
/** return the number of rows in the table represented by this CellMap */
PRInt32 GetRowCount(PRBool aConsiderDeadRowSpanRows = PR_FALSE) const;
nsTableCellFrame* GetCellInfoAt(nsTableCellMap& aMap,
PRInt32 aRowX,
@ -374,9 +374,10 @@ inline nsTableRowGroupFrame* nsCellMap::GetRowGroup() const
return mRowGroupFrame;
}
inline PRInt32 nsCellMap::GetRowCount() const
inline PRInt32 nsCellMap::GetRowCount(PRBool aConsiderDeadRowSpanRows) const
{
return mRowCount;
PRInt32 rowCount = (aConsiderDeadRowSpanRows) ? mRows.Count() : mRowCount;
return rowCount;
}
// nsColInfo