зеркало из https://github.com/mozilla/gecko-dev.git
bug 44523 - Get the actual rg from the cell in AppendCell rather than use the row index. sr=attinasi
This commit is contained in:
Родитель
bc45e0b73b
Коммит
8825aad0b0
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче