Added SetTableForChildren to set the children's table instance variable

This commit is contained in:
kostello 1998-04-28 22:40:22 +00:00
parent 96fa28d30f
commit 1a06b73ae4
2 changed files with 23 additions and 1 deletions

View File

@ -99,8 +99,23 @@ nsTablePart* nsTableContent::GetTable ()
return mTable;
}
void nsTableContent::SetTableForChildren(nsTablePart *aTable)
{
if (aTable != nsnull)
{
PRInt32 count = ChildCount();
for (PRInt32 index = 0; index < count; index++)
SetTableForTableContent(ChildAt(index),aTable);
}
}
void nsTableContent::SetTable (nsTablePart *aTable)
{
// Check to see if the current table was null, if it was, then call
// method to reset children
if (mTable == nsnull)
SetTableForChildren(aTable);
mTable = aTable;
}

View File

@ -29,7 +29,7 @@
* within a table.
*
* @author sclark
* @version $Revision: 3.2 $
* @version $Revision: 3.3 $
* @see
*/
class nsTableContent : public nsHTMLContainer, public nsITableContent
@ -77,6 +77,13 @@ public:
**/
void SetTable (nsTablePart *aTable);
/** Set the children of this piece of content to
* be aTable
**/
void SetTableForChildren(nsTablePart *aTable);
/** @see nsITableContent::IsImplicit */
virtual PRBool IsImplicit () const;