diff --git a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp index 5181badf6b4..176c2ffb481 100644 --- a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp @@ -229,8 +229,6 @@ PRBool BasicTableLayoutStrategy::AssignFixedColumnWidths(nsIPresContext* aPresCo NS_ASSERTION(nsnull != colData, "bad column data"); nsTableColFrame *colFrame = colData->GetColFrame(); NS_ASSERTION(nsnull!=colFrame, "bad col frame"); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - NS_ASSERTION(col.IsNotNull(), "bad col"); // need to track min/max column width for setting min/max table widths PRInt32 minColWidth = 0; @@ -448,7 +446,6 @@ PRBool BasicTableLayoutStrategy::SetColumnsToMinWidth(nsIPresContext* aPresConte for (PRInt32 colIndex = 0; colIndexElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ nsVoidArray *cells = colData->GetCells(); PRInt32 minColWidth = 0; PRInt32 maxColWidth = 0; @@ -520,7 +517,6 @@ PRBool BasicTableLayoutStrategy::BalanceColumnsTableFits(nsIPresContext* aPresCo PRInt32 maxColWidth = 0; // Get column information nsColLayoutData * colData = (nsColLayoutData *)(columnLayoutData->ElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ nsVoidArray *cells = colData->GetCells(); PRInt32 numCells = cells->Count(); @@ -863,7 +859,6 @@ PRBool BasicTableLayoutStrategy::BalanceColumnsConstrained( nsIPresContext* aPre PRInt32 maxColWidth = 0; // Get column information nsColLayoutData * colData = (nsColLayoutData *)(columnLayoutData->ElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ nsVoidArray *cells = colData->GetCells(); PRInt32 numCells = cells->Count(); diff --git a/mozilla/layout/html/table/src/nsColLayoutData.cpp b/mozilla/layout/html/table/src/nsColLayoutData.cpp index 8dbf8e8de5c..280bb8298bd 100644 --- a/mozilla/layout/html/table/src/nsColLayoutData.cpp +++ b/mozilla/layout/html/table/src/nsColLayoutData.cpp @@ -16,14 +16,12 @@ * Reserved. */ #include "nsColLayoutData.h" -#include "nsTableCol.h" #include "nsVoidArray.h" #include "nsCellLayoutData.h" #include "nsTableCell.h" -nsColLayoutData::nsColLayoutData(nsTableCol *aCol) +nsColLayoutData::nsColLayoutData() { - mCol = aCol; mCells = new nsVoidArray(); mColFrame = nsnull; } @@ -43,11 +41,11 @@ nsColLayoutData::~nsColLayoutData() mCells = 0; } -PRInt32 nsColLayoutData::IndexOf(nsTableCell* aTableCell) const +PRInt32 nsColLayoutData::IndexOf(nsIContent* aCell) const { PRInt32 count = this->Count(); PRInt32 result = -1; - if (aTableCell != nsnull) + if (aCell != nsnull) { for (PRInt32 index = 0; index < count; index++) { @@ -57,10 +55,10 @@ PRInt32 nsColLayoutData::IndexOf(nsTableCell* aTableCell) const nsTableCellFrame* frame = cellData->GetCellFrame(); if (frame != nsnull) { - nsTableCell* cell; + nsIContent* cell; - frame->GetContent((nsIContent*&)cell); - if (cell == aTableCell) + frame->GetContent(cell); + if (cell == aCell) { result = index; NS_RELEASE(cell); diff --git a/mozilla/layout/html/table/src/nsColLayoutData.h b/mozilla/layout/html/table/src/nsColLayoutData.h index 46f42c03e2b..a3e79f94791 100644 --- a/mozilla/layout/html/table/src/nsColLayoutData.h +++ b/mozilla/layout/html/table/src/nsColLayoutData.h @@ -21,12 +21,12 @@ #include "nscore.h" #include "nsSize.h" #include "nsIFrame.h" -#include "nsTableCol.h" +#include "nsVoidArray.h" -class nsVoidArray; class nsCellLayoutData; class nsTableFrame; class nsTableColFrame; +class nsIContent; /** Simple data class that represents in-process reflow information about a column. @@ -34,15 +34,11 @@ class nsTableColFrame; class nsColLayoutData { public: - nsColLayoutData(nsTableCol *aCol); + nsColLayoutData(); // NOT VIRTUAL BECAUSE THIS CLASS SHOULD **NEVER** BE SUBCLASSED ~nsColLayoutData(); - nsTableCol * GetCol(); - - void SetCol(nsTableCol * aCol); - nsTableColFrame *GetColFrame(); void SetColFrame(nsTableColFrame *aColFrame); @@ -54,7 +50,7 @@ public: nsCellLayoutData* ElementAt(PRInt32 aIndex) const; PRInt32 IndexOf(nsCellLayoutData* aCellLayoutData) const; - PRInt32 IndexOf(nsTableCell* aTableCell) const; + PRInt32 IndexOf(nsIContent* aTableCell) const; nsCellLayoutData* GetNext(nsCellLayoutData* aCellLayoutData) const; @@ -71,7 +67,6 @@ public: private: - nsTableCol *mCol; nsTableColFrame *mColFrame; nsVoidArray *mCells; @@ -79,22 +74,6 @@ private: /* ---------- inlines ---------- */ -inline nsTableCol * nsColLayoutData::GetCol() -{ - NS_IF_ADDREF(mCol); - return mCol; -}; - -inline void nsColLayoutData::SetCol(nsTableCol * aCol) -{ - if (aCol != mCol) - { - NS_IF_ADDREF(aCol); - NS_IF_RELEASE(mCol); - mCol = aCol; - } -} - inline nsTableColFrame * nsColLayoutData::GetColFrame() { return mColFrame;} diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index d23c17dbb49..657af8dc132 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -2123,9 +2123,7 @@ PRBool nsTableFrame::SetCellLayoutData(nsIPresContext* aPresContext, // TODO: unify these 2 kinds of column data // TODO: cache more column data, like the mWidth.GetUnit and what its value - nsTableColPtr col = (nsTableCol *)tableKid->ChildAt(j); - NS_ASSERTION(col.IsNotNull(), "bad content"); - nsColLayoutData *colData = new nsColLayoutData(col); + nsColLayoutData *colData = new nsColLayoutData(); nsTableColFrame *colFrame=nsnull; colGroupFrame->ChildAt(j, (nsIFrame *&)colFrame); colData->SetColFrame(colFrame); diff --git a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp index 5181badf6b4..176c2ffb481 100644 --- a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp @@ -229,8 +229,6 @@ PRBool BasicTableLayoutStrategy::AssignFixedColumnWidths(nsIPresContext* aPresCo NS_ASSERTION(nsnull != colData, "bad column data"); nsTableColFrame *colFrame = colData->GetColFrame(); NS_ASSERTION(nsnull!=colFrame, "bad col frame"); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - NS_ASSERTION(col.IsNotNull(), "bad col"); // need to track min/max column width for setting min/max table widths PRInt32 minColWidth = 0; @@ -448,7 +446,6 @@ PRBool BasicTableLayoutStrategy::SetColumnsToMinWidth(nsIPresContext* aPresConte for (PRInt32 colIndex = 0; colIndexElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ nsVoidArray *cells = colData->GetCells(); PRInt32 minColWidth = 0; PRInt32 maxColWidth = 0; @@ -520,7 +517,6 @@ PRBool BasicTableLayoutStrategy::BalanceColumnsTableFits(nsIPresContext* aPresCo PRInt32 maxColWidth = 0; // Get column information nsColLayoutData * colData = (nsColLayoutData *)(columnLayoutData->ElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ nsVoidArray *cells = colData->GetCells(); PRInt32 numCells = cells->Count(); @@ -863,7 +859,6 @@ PRBool BasicTableLayoutStrategy::BalanceColumnsConstrained( nsIPresContext* aPre PRInt32 maxColWidth = 0; // Get column information nsColLayoutData * colData = (nsColLayoutData *)(columnLayoutData->ElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ nsVoidArray *cells = colData->GetCells(); PRInt32 numCells = cells->Count(); diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index d23c17dbb49..657af8dc132 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -2123,9 +2123,7 @@ PRBool nsTableFrame::SetCellLayoutData(nsIPresContext* aPresContext, // TODO: unify these 2 kinds of column data // TODO: cache more column data, like the mWidth.GetUnit and what its value - nsTableColPtr col = (nsTableCol *)tableKid->ChildAt(j); - NS_ASSERTION(col.IsNotNull(), "bad content"); - nsColLayoutData *colData = new nsColLayoutData(col); + nsColLayoutData *colData = new nsColLayoutData(); nsTableColFrame *colFrame=nsnull; colGroupFrame->ChildAt(j, (nsIFrame *&)colFrame); colData->SetColFrame(colFrame);