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
parent bc45e0b73b
commit 8825aad0b0
4 changed files with 24 additions and 10 deletions

View File

@ -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();

View File

@ -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

View File

@ -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();

View File

@ -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