fixed bug 915. Colgroup frames now get Init() calls properly with

synthesized COLs.


git-svn-id: svn://10.0.0.236/trunk@11259 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
buster%netscape.com
1998-09-28 20:38:10 +00:00
parent 5b7e92b84d
commit 1c6e6e88a1
4 changed files with 14 additions and 16 deletions

View File

@@ -155,7 +155,7 @@ nsTableColGroupFrame::Init(nsIPresContext& aPresContext, nsIFrame* aChildList)
{
nsresult result = AppendNewFrames(aPresContext, aChildList);
if (NS_OK==result)
result = InitNewFrames(aPresContext, mFirstChild);
result = InitNewFrames(aPresContext, aChildList);
return result;
}

View File

@@ -385,7 +385,7 @@ PRInt32 nsTableFrame::GetColCount ()
if (nsnull!=cellMap)
{
if (-1==mEffectiveColCount)
//if (-1==mEffectiveColCount)
SetEffectiveColCount();
}
return mEffectiveColCount;
@@ -488,7 +488,8 @@ PRBool nsTableFrame::RowHasSpanningCells(PRInt32 aRowIndex)
*/
PRBool nsTableFrame::ColIsSpannedInto(PRInt32 aColIndex)
{
NS_PRECONDITION (0<=aColIndex && aColIndex<GetColCount(), "bad col index arg");
PRInt32 colCount=GetColCount();
NS_PRECONDITION (0<=aColIndex && aColIndex<colCount, "bad col index arg");
PRBool result = PR_FALSE;
nsCellMap * cellMap = GetCellMap();
NS_PRECONDITION (nsnull!=cellMap, "bad call, cellMap not yet allocated.");
@@ -504,7 +505,8 @@ PRBool nsTableFrame::ColIsSpannedInto(PRInt32 aColIndex)
*/
PRBool nsTableFrame::ColHasSpanningCells(PRInt32 aColIndex)
{
NS_PRECONDITION (0<=aColIndex && aColIndex<GetColCount(), "bad col index arg");
PRInt32 colCount=GetColCount();
NS_PRECONDITION (0<=aColIndex && aColIndex<colCount, "bad col index arg");
PRBool result = PR_FALSE;
nsCellMap * cellMap = GetCellMap();
NS_PRECONDITION (nsnull!=cellMap, "bad call, cellMap not yet allocated.");
@@ -656,11 +658,9 @@ void nsTableFrame::EnsureColumns(nsIPresContext* aPresContext)
if (PR_TRUE==gsDebug) printf("EC: actual = %d, colCount=%d\n", actualColumns, colCount);
if (actualColumns < colCount)
{
PRBool lastColGroupNeedsInit=PR_FALSE;
nsIHTMLContent *lastColGroup=nsnull;
if (nsnull==lastColGroupFrame)
{
lastColGroupNeedsInit=PR_TRUE;
if (PR_TRUE==gsDebug) printf("EC:creating colgroup\n", actualColumns, colCount);
// create an implicit colgroup
nsAutoString colGroupTag;
@@ -742,8 +742,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext* aPresContext)
lastNewColFrame = colFrame;
NS_RELEASE(col); // ADDREF: col--
}
if (PR_TRUE==lastColGroupNeedsInit)
lastColGroupFrame->Init(*aPresContext, firstNewColFrame);
lastColGroupFrame->Init(*aPresContext, firstNewColFrame);
NS_RELEASE(lastColGroup); // ADDREF: lastColGroup--
}
}

View File

@@ -155,7 +155,7 @@ nsTableColGroupFrame::Init(nsIPresContext& aPresContext, nsIFrame* aChildList)
{
nsresult result = AppendNewFrames(aPresContext, aChildList);
if (NS_OK==result)
result = InitNewFrames(aPresContext, mFirstChild);
result = InitNewFrames(aPresContext, aChildList);
return result;
}

View File

@@ -385,7 +385,7 @@ PRInt32 nsTableFrame::GetColCount ()
if (nsnull!=cellMap)
{
if (-1==mEffectiveColCount)
//if (-1==mEffectiveColCount)
SetEffectiveColCount();
}
return mEffectiveColCount;
@@ -488,7 +488,8 @@ PRBool nsTableFrame::RowHasSpanningCells(PRInt32 aRowIndex)
*/
PRBool nsTableFrame::ColIsSpannedInto(PRInt32 aColIndex)
{
NS_PRECONDITION (0<=aColIndex && aColIndex<GetColCount(), "bad col index arg");
PRInt32 colCount=GetColCount();
NS_PRECONDITION (0<=aColIndex && aColIndex<colCount, "bad col index arg");
PRBool result = PR_FALSE;
nsCellMap * cellMap = GetCellMap();
NS_PRECONDITION (nsnull!=cellMap, "bad call, cellMap not yet allocated.");
@@ -504,7 +505,8 @@ PRBool nsTableFrame::ColIsSpannedInto(PRInt32 aColIndex)
*/
PRBool nsTableFrame::ColHasSpanningCells(PRInt32 aColIndex)
{
NS_PRECONDITION (0<=aColIndex && aColIndex<GetColCount(), "bad col index arg");
PRInt32 colCount=GetColCount();
NS_PRECONDITION (0<=aColIndex && aColIndex<colCount, "bad col index arg");
PRBool result = PR_FALSE;
nsCellMap * cellMap = GetCellMap();
NS_PRECONDITION (nsnull!=cellMap, "bad call, cellMap not yet allocated.");
@@ -656,11 +658,9 @@ void nsTableFrame::EnsureColumns(nsIPresContext* aPresContext)
if (PR_TRUE==gsDebug) printf("EC: actual = %d, colCount=%d\n", actualColumns, colCount);
if (actualColumns < colCount)
{
PRBool lastColGroupNeedsInit=PR_FALSE;
nsIHTMLContent *lastColGroup=nsnull;
if (nsnull==lastColGroupFrame)
{
lastColGroupNeedsInit=PR_TRUE;
if (PR_TRUE==gsDebug) printf("EC:creating colgroup\n", actualColumns, colCount);
// create an implicit colgroup
nsAutoString colGroupTag;
@@ -742,8 +742,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext* aPresContext)
lastNewColFrame = colFrame;
NS_RELEASE(col); // ADDREF: col--
}
if (PR_TRUE==lastColGroupNeedsInit)
lastColGroupFrame->Init(*aPresContext, firstNewColFrame);
lastColGroupFrame->Init(*aPresContext, firstNewColFrame);
NS_RELEASE(lastColGroup); // ADDREF: lastColGroup--
}
}