This checkin (under mozilla/layout) is all about 'const'. Digital Unix's

C++ compiler is strict about getting 'const' right.  Most of the changes
are to add 'const' to the type casts for the second argument of the
GetStyleData method, which wants a const reference.
This commit is contained in:
wtc%netscape.com 1998-12-02 16:45:20 +00:00
Родитель 26ca8b6da1
Коммит 59b32f50ef
24 изменённых файлов: 253 добавлений и 253 удалений

Просмотреть файл

@ -1028,7 +1028,7 @@ FindFrameWithContent(nsIFrame* aFrame, nsIContent* aContent)
// absolutely positioned frame.
const nsStylePosition* position;
aFrame->GetStyleData(eStyleStruct_Position, (nsStyleStruct*&)position);
aFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position);
if ((NS_STYLE_POSITION_ABSOLUTE != position->mPosition) ||
!IsZeroSizedFrame(aFrame)) {
NS_RELEASE(frameContent);

Просмотреть файл

@ -323,7 +323,7 @@ nsFrameImageLoader::DamageRepairFrame(const nsRect* aDamageRect)
const nsStyleSpacing* space;
nsMargin borderPadding;
mTargetFrame->GetStyleData(eStyleStruct_Spacing, (nsStyleStruct*&)space);
mTargetFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct*&)space);
space->CalcBorderPaddingFor(mTargetFrame, borderPadding);
bounds.MoveBy(borderPadding.left, borderPadding.top);
}

Просмотреть файл

@ -110,8 +110,8 @@ void nsHTMLReflowCommand::BuildPath()
// Floating frames are handled differently. The path goes from the target
// frame to the containing block, and then up the hierarchy
nsStyleDisplay* display;
mTargetFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
const nsStyleDisplay* display;
mTargetFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_NONE != display->mFloats) {
mPath.AppendElement((void*)mTargetFrame);

Просмотреть файл

@ -1910,7 +1910,7 @@ NS_IMETHODIMP
TextFrame::AdjustFrameSize(nscoord aExtraSpace, nscoord& aUsedSpace)
{
// Get the text fragments that make up our content
nsTextFragment* frag;
const nsTextFragment* frag;
PRInt32 numFrags;
nsITextContent* tc;
if (NS_OK == mContent->QueryInterface(kITextContentIID, (void**) &tc)) {
@ -1920,7 +1920,7 @@ TextFrame::AdjustFrameSize(nscoord aExtraSpace, nscoord& aUsedSpace)
// Find fragment that contains the end of the mapped content
PRInt32 endIndex = mContentOffset + mContentLength;
PRInt32 offset = 0;
nsTextFragment* lastFrag = frag + numFrags;
const nsTextFragment* lastFrag = frag + numFrags;
while (frag < lastFrag) {
PRInt32 fragLen = frag->GetLength();
if (endIndex <= offset + fragLen) {
@ -1978,7 +1978,7 @@ TextFrame::TrimTrailingWhiteSpace(nsIPresContext& aPresContext,
aRC.GetWidth(' ', spaceWidth);
// Get the text fragments that make up our content
nsTextFragment* frag;
const nsTextFragment* frag;
PRInt32 numFrags;
nsITextContent* tc;
if (NS_OK == mContent->QueryInterface(kITextContentIID, (void**) &tc)) {
@ -1988,7 +1988,7 @@ TextFrame::TrimTrailingWhiteSpace(nsIPresContext& aPresContext,
// Find fragment that contains the end of the mapped content
PRInt32 endIndex = mContentOffset + mContentLength;
PRInt32 offset = 0;
nsTextFragment* lastFrag = frag + numFrags;
const nsTextFragment* lastFrag = frag + numFrags;
while (frag < lastFrag) {
PRInt32 fragLen = frag->GetLength();
if (endIndex <= offset + fragLen) {

Просмотреть файл

@ -539,8 +539,8 @@ nsBodyFrame::ReflowAbsoluteItems(nsIPresContext& aPresContext,
const nsStyleDisplay* display;
const nsStylePosition* position;
absoluteFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
absoluteFrame->GetStyleData(eStyleStruct_Position, (nsStyleStruct*&)position);
absoluteFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
absoluteFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position);
// See whether the frame is a newly added frame
if (!IsAbsoluteFrame(absoluteFrame)) {

Просмотреть файл

@ -110,8 +110,8 @@ void nsHTMLReflowCommand::BuildPath()
// Floating frames are handled differently. The path goes from the target
// frame to the containing block, and then up the hierarchy
nsStyleDisplay* display;
mTargetFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
const nsStyleDisplay* display;
mTargetFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_NONE != display->mFloats) {
mPath.AppendElement((void*)mTargetFrame);

Просмотреть файл

@ -1028,7 +1028,7 @@ FindFrameWithContent(nsIFrame* aFrame, nsIContent* aContent)
// absolutely positioned frame.
const nsStylePosition* position;
aFrame->GetStyleData(eStyleStruct_Position, (nsStyleStruct*&)position);
aFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position);
if ((NS_STYLE_POSITION_ABSOLUTE != position->mPosition) ||
!IsZeroSizedFrame(aFrame)) {
NS_RELEASE(frameContent);

Просмотреть файл

@ -1910,7 +1910,7 @@ NS_IMETHODIMP
TextFrame::AdjustFrameSize(nscoord aExtraSpace, nscoord& aUsedSpace)
{
// Get the text fragments that make up our content
nsTextFragment* frag;
const nsTextFragment* frag;
PRInt32 numFrags;
nsITextContent* tc;
if (NS_OK == mContent->QueryInterface(kITextContentIID, (void**) &tc)) {
@ -1920,7 +1920,7 @@ TextFrame::AdjustFrameSize(nscoord aExtraSpace, nscoord& aUsedSpace)
// Find fragment that contains the end of the mapped content
PRInt32 endIndex = mContentOffset + mContentLength;
PRInt32 offset = 0;
nsTextFragment* lastFrag = frag + numFrags;
const nsTextFragment* lastFrag = frag + numFrags;
while (frag < lastFrag) {
PRInt32 fragLen = frag->GetLength();
if (endIndex <= offset + fragLen) {
@ -1978,7 +1978,7 @@ TextFrame::TrimTrailingWhiteSpace(nsIPresContext& aPresContext,
aRC.GetWidth(' ', spaceWidth);
// Get the text fragments that make up our content
nsTextFragment* frag;
const nsTextFragment* frag;
PRInt32 numFrags;
nsITextContent* tc;
if (NS_OK == mContent->QueryInterface(kITextContentIID, (void**) &tc)) {
@ -1988,7 +1988,7 @@ TextFrame::TrimTrailingWhiteSpace(nsIPresContext& aPresContext,
// Find fragment that contains the end of the mapped content
PRInt32 endIndex = mContentOffset + mContentLength;
PRInt32 offset = 0;
nsTextFragment* lastFrag = frag + numFrags;
const nsTextFragment* lastFrag = frag + numFrags;
while (frag < lastFrag) {
PRInt32 fragLen = frag->GetLength();
if (endIndex <= offset + fragLen) {

Просмотреть файл

@ -119,7 +119,7 @@ NS_METHOD nsTableCellFrame::Paint(nsIPresContext& aPresContext,
//XXX: also check style for rule on rendering empty cells
nsMargin borderPadding;
const nsStyleSpacing* cellSpacing;
GetStyleData(eStyleStruct_Spacing , ((nsStyleStruct *&)cellSpacing));
GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)cellSpacing));
cellSpacing->CalcBorderPaddingFor(this, borderPadding);
nscoord contentWidth = mPass1DesiredSize.width - (borderPadding.left+borderPadding.right);
nscoord contentHeight = mPass1DesiredSize.height - (borderPadding.top+borderPadding.bottom);
@ -587,8 +587,8 @@ void nsTableCellFrame::MapBorderMarginPadding(nsIPresContext* aPresContext)
// get the table frame style context, and from it get cellpadding, cellspacing, and border info
const nsStyleTable* tableStyle;
tableFrame->GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
nsStyleSpacing* tableSpacingStyle;
tableFrame->GetStyleData(eStyleStruct_Spacing,(nsStyleStruct *&)tableSpacingStyle);
const nsStyleSpacing* tableSpacingStyle;
tableFrame->GetStyleData(eStyleStruct_Spacing,(const nsStyleStruct *&)tableSpacingStyle);
nsStyleSpacing* spacingData = (nsStyleSpacing*)mStyleContext->GetMutableStyleData(eStyleStruct_Spacing);
// check to see if cellpadding or cellspacing is defined

Просмотреть файл

@ -77,15 +77,15 @@ NS_METHOD nsTableColFrame::Reflow(nsIPresContext& aPresContext,
PRInt32 nsTableColFrame::GetSpan()
{
nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
return tableStyle->mSpan;
}
nscoord nsTableColFrame::GetColWidthForComputation()
{
const nsStylePosition* position;
GetStyleData(eStyleStruct_Position, ((nsStyleStruct *&)position));
GetStyleData(eStyleStruct_Position, ((const nsStyleStruct *&)position));
if (eStyleUnit_Coord==position->mWidth.GetUnit())
return position->mWidth.GetCoordValue();
else

Просмотреть файл

@ -264,7 +264,7 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsMe(nsIPresContext& aPresCont
aReflowState.reflowCommand->GetChildFrame(objectFrame);
const nsStyleDisplay *childDisplay=nsnull;
if (nsnull!=objectFrame)
objectFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
objectFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (PR_TRUE==gsDebugIR) printf("nTCGF IR: IncrementalReflow_TargetIsMe with type=%d\n", type);
switch (type)
{
@ -358,7 +358,7 @@ NS_METHOD nsTableColGroupFrame::IR_ColInserted(nsIPresContext& aPresCon
while ((NS_SUCCEEDED(rv)) && (nsnull!=childFrame))
{
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
startingColIndex += ((nsTableColGroupFrame *)childFrame)->SetStartColumnIndex(startingColIndex);
@ -395,7 +395,7 @@ NS_METHOD nsTableColGroupFrame::IR_ColAppended(nsIPresContext& aPresCon
while ((NS_SUCCEEDED(rv)) && (nsnull!=childFrame))
{
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
startingColIndex += ((nsTableColGroupFrame *)childFrame)->SetStartColumnIndex(startingColIndex);
@ -437,7 +437,7 @@ NS_METHOD nsTableColGroupFrame::IR_ColRemoved(nsIPresContext& aPresCont
startingColIndex += GetColumnCount(); // resets all column indexes
}
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
// we've removed aDeletedFrame, now adjust the starting col index of all subsequent col groups
@ -522,8 +522,8 @@ NS_METHOD nsTableColGroupFrame::SetStyleContextForFirstPass(nsIPresContext& aPre
if ((NS_SUCCEEDED(rv)) && (nsnull!=tableFrame))
{
// get the style for the table frame
nsStyleTable *tableStyle;
tableFrame->GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable *tableStyle;
tableFrame->GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
// if COLS is set, then map it into the COL frames
if (NS_STYLE_TABLE_COLS_NONE != tableStyle->mCols)
@ -540,8 +540,8 @@ NS_METHOD nsTableColGroupFrame::SetStyleContextForFirstPass(nsIPresContext& aPre
nsIFrame *colFrame=mFirstChild;
while (nsnull!=colFrame)
{
nsStyleDisplay * colDisplay=nsnull;
colFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)colDisplay));
const nsStyleDisplay * colDisplay=nsnull;
colFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)colDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN == colDisplay->mDisplay)
{
nsIStyleContextPtr colStyleContext;
@ -573,20 +573,20 @@ NS_METHOD nsTableColGroupFrame::SetStyleContextForFirstPass(nsIPresContext& aPre
nsIFrame *colFrame=mFirstChild;
while (nsnull!=colFrame)
{
nsStyleDisplay * colDisplay=nsnull;
colFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)colDisplay));
const nsStyleDisplay * colDisplay=nsnull;
colFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)colDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN == colDisplay->mDisplay)
{
nsIStyleContextPtr colStyleContext;
nsStylePosition * colPosition=nsnull;
colFrame->GetStyleData(eStyleStruct_Position, (nsStyleStruct *&)colPosition); // get a read-only version of the style context
const nsStylePosition * colPosition=nsnull;
colFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct *&)colPosition); // get a read-only version of the style context
//XXX: how do I know this is auto because it's defaulted, vs. set explicitly to "auto"?
if (eStyleUnit_Auto==colPosition->mWidth.GetUnit())
{
// notice how we defer getting a mutable style context until we're sure we really need one
colFrame->GetStyleContext(colStyleContext.AssignRef());
colPosition = (nsStylePosition*)colStyleContext->GetMutableStyleData(eStyleStruct_Position);
colPosition->mWidth = position->mWidth;
nsStylePosition * mutableColPosition = (nsStylePosition*)colStyleContext->GetMutableStyleData(eStyleStruct_Position);
mutableColPosition->mWidth = position->mWidth;
colStyleContext->RecalcAutomaticData(&aPresContext);
}
}
@ -611,7 +611,7 @@ int nsTableColGroupFrame::GetColumnCount ()
while (nsnull!=childFrame)
{
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN == childDisplay->mDisplay)
{
nsTableColFrame *col = (nsTableColFrame *)childFrame;
@ -623,7 +623,7 @@ int nsTableColGroupFrame::GetColumnCount ()
if (0==mColCount)
{ // there were no children of this colgroup that were columns. So use my span attribute
const nsStyleTable *tableStyle;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
mColCount = tableStyle->mSpan;
}
return mColCount;
@ -643,7 +643,7 @@ nsTableColFrame * nsTableColGroupFrame::GetNextColumn(nsIFrame *aChildFrame)
while (nsnull!=childFrame)
{
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN == childDisplay->mDisplay)
{
result = (nsTableColFrame *)childFrame;
@ -663,7 +663,7 @@ nsTableColFrame * nsTableColGroupFrame::GetColumnAt (PRInt32 aColIndex)
while (nsnull!=childFrame)
{
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN == childDisplay->mDisplay)
{
nsTableColFrame *col = (nsTableColFrame *)childFrame;
@ -679,8 +679,8 @@ nsTableColFrame * nsTableColGroupFrame::GetColumnAt (PRInt32 aColIndex)
PRInt32 nsTableColGroupFrame::GetSpan()
{
PRInt32 span=1;
nsStyleTable* tableStyle=nsnull;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable* tableStyle=nsnull;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
if (nsnull!=tableStyle)
{
span = tableStyle->mSpan;

Просмотреть файл

@ -311,7 +311,7 @@ nsTableFrame::SetInitialChildList(nsIPresContext& aPresContext,
for ( ; nsnull!=nextRowGroup; nextRowGroup->GetNextSibling(nextRowGroup))
{
const nsStyleDisplay *rowGroupDisplay;
nextRowGroup->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)rowGroupDisplay);
nextRowGroup->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)rowGroupDisplay);
if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay))
{
rv = DidAppendRowGroup((nsTableRowGroupFrame*)nextRowGroup);
@ -330,7 +330,7 @@ NS_IMETHODIMP nsTableFrame::DidAppendRowGroup(nsTableRowGroupFrame *aRowGroupFra
for ( ; nsnull!=nextRow; nextRow->GetNextSibling(nextRow))
{
const nsStyleDisplay *rowDisplay;
nextRow->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)rowDisplay);
nextRow->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)rowDisplay);
if (NS_STYLE_DISPLAY_TABLE_ROW==rowDisplay->mDisplay)
{
rv = ((nsTableRowFrame *)nextRow)->InitChildren();
@ -359,7 +359,7 @@ nsTableRowGroupFrame* nsTableFrame::NextRowGroupFrame(nsTableRowGroupFrame* aRow
while (nsnull != aRowGroupFrame)
{
const nsStyleDisplay *display;
aRowGroupFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
aRowGroupFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (PR_TRUE==IsRowGroup(display->mDisplay))
{
break;
@ -378,7 +378,7 @@ PRInt32 nsTableFrame::GetSpecifiedColumnCount ()
while (nsnull!=childFrame)
{
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay)
{
mColCount += ((nsTableColGroupFrame *)childFrame)->GetColumnCount();
@ -613,8 +613,8 @@ PRInt32 nsTableFrame::GetEffectiveCOLSAttribute()
NS_PRECONDITION (nsnull!=cellMap, "null cellMap.");
PRInt32 result;
nsIFrame *tableFrame = this;
nsStyleTable *tableStyle=nsnull;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable *tableStyle=nsnull;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
result = tableStyle->mCols;
PRInt32 numCols = GetColCount();
if (result>numCols)
@ -649,7 +649,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext)
while (nsnull!=childFrame)
{
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay)
{
((nsTableColGroupFrame*)childFrame)->SetStartColumnIndex(actualColumns);
@ -911,7 +911,7 @@ NS_METHOD nsTableFrame::ReBuildCellMap()
for ( ; nsnull!=rowGroupFrame; rowGroupFrame->GetNextSibling(rowGroupFrame))
{
const nsStyleDisplay *rowGroupDisplay;
rowGroupFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)rowGroupDisplay);
rowGroupFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)rowGroupDisplay);
if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay))
{
nsIFrame *rowFrame;
@ -919,7 +919,7 @@ NS_METHOD nsTableFrame::ReBuildCellMap()
for ( ; nsnull!=rowFrame; rowFrame->GetNextSibling(rowFrame))
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)rowDisplay);
rowFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)rowDisplay);
if (NS_STYLE_DISPLAY_TABLE_ROW==rowDisplay->mDisplay)
{
rv = ((nsTableRowFrame *)rowFrame)->InitChildren();
@ -1640,7 +1640,7 @@ NS_METHOD nsTableFrame::ResizeReflowPass1(nsIPresContext& aPresContext,
for ( ; nsnull != kidFrame; kidFrame->GetNextSibling(kidFrame))
{
const nsStyleDisplay *childDisplay;
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if ((NS_STYLE_DISPLAY_TABLE_HEADER_GROUP != childDisplay->mDisplay) &&
(NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP != childDisplay->mDisplay) &&
(NS_STYLE_DISPLAY_TABLE_ROW_GROUP != childDisplay->mDisplay) &&
@ -1824,7 +1824,7 @@ NS_METHOD nsTableFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
aReflowState.reflowState.reflowCommand->GetChildFrame(objectFrame);
const nsStyleDisplay *childDisplay=nsnull;
if (nsnull!=objectFrame)
objectFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
objectFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (PR_TRUE==gsDebugIR) printf("TIF IR: IncrementalReflow_TargetIsMe with type=%d\n", type);
switch (type)
{
@ -1948,7 +1948,7 @@ NS_METHOD nsTableFrame::IR_ColGroupInserted(nsIPresContext& aPresContext,
frameToInsertAfter->SetNextSibling(aInsertedFrame);
// account for childFrame being a COLGROUP now
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
if (PR_FALSE==adjustStartingColIndex) // we haven't gotten to aDeletedFrame yet
@ -1960,7 +1960,7 @@ NS_METHOD nsTableFrame::IR_ColGroupInserted(nsIPresContext& aPresContext,
// start adjusting subsequent col groups' starting col index including aInsertedFrame
}
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
if (PR_FALSE==adjustStartingColIndex) // we haven't gotten to aDeletedFrame yet
@ -1994,7 +1994,7 @@ NS_METHOD nsTableFrame::IR_ColGroupAppended(nsIPresContext& aPresContext,
while ((NS_SUCCEEDED(rv)) && (nsnull!=childFrame))
{
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
startingColIndex += ((nsTableColGroupFrame *)childFrame)->GetColumnCount();
@ -2091,7 +2091,7 @@ NS_METHOD nsTableFrame::IR_ColGroupRemoved(nsIPresContext& aPresContext,
adjustStartingColIndex=PR_TRUE; // now that we've removed aDeletedFrame, start adjusting subsequent col groups' starting col index
}
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
if (PR_FALSE==adjustStartingColIndex) // we haven't gotten to aDeletedFrame yet
@ -2252,7 +2252,7 @@ nscoord nsTableFrame::ComputeDesiredWidth(const nsHTMLReflowState& aReflowState)
{
nscoord desiredWidth=aReflowState.maxSize.width;
// this is the biggest hack in the world. But there's no other rational way to handle nested percent tables
nsStylePosition* position;
const nsStylePosition* position;
PRBool isNested=IsNested(aReflowState, position);
if((eReflowReason_Initial==aReflowState.reason) &&
(PR_TRUE==isNested) && (eStyleUnit_Percent==position->mWidth.GetUnit()))
@ -2309,7 +2309,7 @@ void nsTableFrame::PlaceChild(nsIPresContext& aPresContext,
// If this is a footer row group, add it to the list of footer row groups
const nsStyleDisplay *childDisplay;
aKidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
aKidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == childDisplay->mDisplay)
{
if (nsnull==aReflowState.footerList)
@ -2350,7 +2350,7 @@ void nsTableFrame::PlaceChild(nsIPresContext& aPresContext,
{
nsMargin borderPadding;
const nsStyleSpacing* tableSpacing;
GetStyleData(eStyleStruct_Spacing , ((nsStyleStruct *&)tableSpacing));
GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)tableSpacing));
tableSpacing->CalcBorderPaddingFor(this, borderPadding);
nscoord cellSpacing = GetCellSpacing();
nscoord kidWidth = aKidMaxElementSize.width + borderPadding.left + borderPadding.right + cellSpacing*2;
@ -2398,12 +2398,12 @@ NS_METHOD nsTableFrame::ReflowMappedChildren(nsIPresContext& aPresContext,
desiredSize.width=desiredSize.height=desiredSize.ascent=desiredSize.descent=0;
const nsStyleDisplay *childDisplay;
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if ((PR_TRUE==IsRowGroup(childDisplay->mDisplay)) ||
(NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay))
{ // for all colgroups and rowgroups...
const nsStyleSpacing* kidSpacing;
kidFrame->GetStyleData(eStyleStruct_Spacing, ((nsStyleStruct *&)kidSpacing));
kidFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)kidSpacing));
nsMargin kidMargin;
kidSpacing->CalcMarginFor(kidFrame, kidMargin);
@ -2598,7 +2598,7 @@ NS_METHOD nsTableFrame::PullUpChildren(nsIPresContext& aPresContext,
//kidRect.x += kidMol->margin.left;
kidRect.y += aReflowState.y;
const nsStyleDisplay *childDisplay;
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (PR_TRUE==IsRowGroup(childDisplay->mDisplay))
{
PlaceChild(aPresContext, aReflowState, kidFrame, kidRect, aDesiredSize.maxElementSize, *pKidMaxElementSize);
@ -2783,11 +2783,11 @@ nscoord nsTableFrame::GetEffectiveContainerHeight(const nsHTMLReflowState& aRefl
while (nsnull!=rs)
{
const nsStyleDisplay *display;
rs->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
rs->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE==display->mDisplay)
{
const nsStylePosition *position;
rs->frame->GetStyleData(eStyleStruct_Position, (nsStyleStruct *&)position);
rs->frame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct *&)position);
nsStyleUnit unit = position->mHeight.GetUnit();
if (eStyleUnit_Null==unit || eStyleUnit_Auto==unit)
{
@ -2850,7 +2850,7 @@ nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext,
while (nsnull!=rowGroupFrame)
{
const nsStyleDisplay *rowGroupDisplay;
rowGroupFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)rowGroupDisplay));
rowGroupFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowGroupDisplay));
if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay))
{ // the rows in rowGroupFrame need to be expanded by rowHeightDelta[i]
// and the rowgroup itself needs to be expanded by SUM(row height deltas)
@ -2860,7 +2860,7 @@ nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext,
while ((NS_SUCCEEDED(rv)) && (nsnull!=rowFrame))
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)rowDisplay));
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay)
{ // the row needs to be expanded by the proportion this row contributed to the original height
nsRect rowRect;
@ -2877,7 +2877,7 @@ nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext,
while (nsnull!=rowGroupFrame)
{
const nsStyleDisplay *rowGroupDisplay;
rowGroupFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)rowGroupDisplay));
rowGroupFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowGroupDisplay));
if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay))
{ // the rows in rowGroupFrame need to be expanded by rowHeightDelta[i]
// and the rowgroup itself needs to be expanded by SUM(row height deltas)
@ -2887,7 +2887,7 @@ nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext,
while ((NS_SUCCEEDED(rv)) && (nsnull!=rowFrame))
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)rowDisplay));
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay)
{ // the row needs to be expanded by the proportion this row contributed to the original height
nsRect rowRect;
@ -3076,7 +3076,7 @@ NS_METHOD nsTableFrame::GetColumnFrame(PRInt32 aColIndex, nsTableColFrame *&aCol
break;
}
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay)
{
PRInt32 colGroupStartingIndex = ((nsTableColGroupFrame *)childFrame)->GetStartColumnIndex();
@ -3118,8 +3118,8 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext,
NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!");
NS_ASSERTION(nsnull!=mCellMap, "never ever call me until the cell map is built!");
PRInt32 colIndex=0;
nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
EnsureColumns(aPresContext);
if (nsnull!=mColCache)
{
@ -3133,7 +3133,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext,
while (nsnull!=childFrame)
{ // in this loop, we cache column info and set column style info from cells
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay)
{ // if it's a col group then get the columns and cache them in the CellMap
@ -3164,7 +3164,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext,
while (nsnull!=rowFrame)
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)rowDisplay));
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay)
{
nsIFrame *cellFrame;
@ -3176,7 +3176,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext,
* set the column style from the cell's width attribute (if this is the first row)
*/
const nsStyleDisplay *cellDisplay;
cellFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)cellDisplay));
cellFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)cellDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == cellDisplay->mDisplay)
SetColumnStyleFromCell(aPresContext, (nsTableCellFrame *)cellFrame, (nsTableRowFrame *)rowFrame);
cellFrame->GetNextSibling(cellFrame);
@ -3195,7 +3195,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext,
while (nsnull!=childFrame)
{ // for every child, if it's a col group then get the columns
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay)
{
nsTableColFrame *colFrame=nsnull;
@ -3204,11 +3204,11 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext,
{ // for every column, create an entry in the column cache
// assumes that the col style has been twiddled to account for first cell width attribute
const nsStyleDisplay *colDisplay;
colFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)colDisplay));
colFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)colDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN == colDisplay->mDisplay)
{
const nsStylePosition* colPosition;
colFrame->GetStyleData(eStyleStruct_Position, ((nsStyleStruct *&)colPosition));
colFrame->GetStyleData(eStyleStruct_Position, ((const nsStyleStruct *&)colPosition));
PRInt32 repeat = colFrame->GetSpan();
colIndex = colFrame->GetColumnIndex();
for (PRInt32 i=0; i<repeat; i++)
@ -3287,7 +3287,7 @@ void nsTableFrame::InvalidateCellMap()
for ( ; nsnull!=rowGroupFrame; rowGroupFrame->GetNextSibling(rowGroupFrame))
{
const nsStyleDisplay *rowGroupDisplay;
rowGroupFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)rowGroupDisplay);
rowGroupFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)rowGroupDisplay);
if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay))
{
nsIFrame *rowFrame;
@ -3295,7 +3295,7 @@ void nsTableFrame::InvalidateCellMap()
for ( ; nsnull!=rowFrame; rowFrame->GetNextSibling(rowFrame))
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)rowDisplay);
rowFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)rowDisplay);
if (NS_STYLE_DISPLAY_TABLE_ROW==rowDisplay->mDisplay)
{
((nsTableRowFrame *)rowFrame)->ResetInitChildren();
@ -3560,8 +3560,8 @@ NS_METHOD nsTableFrame::GetCellMarginData(nsTableCellFrame* aKidFrame, nsMargin&
nscoord nsTableFrame::GetCellSpacing()
{
nsTableFrame* tableFrame = this;
nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
nscoord cellSpacing = 0;
if (tableStyle->mCellSpacing.GetUnit() == eStyleUnit_Coord)
cellSpacing = tableStyle->mCellSpacing.GetCoordValue();
@ -3614,7 +3614,7 @@ NS_METHOD nsTableFrame::GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aT
while ((NS_OK==result) && (nsnull!=parentFrame))
{
const nsStyleDisplay *display;
parentFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
parentFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE == display->mDisplay)
{
aTableFrame = (nsTableFrame *)parentFrame;
@ -3630,7 +3630,7 @@ NS_METHOD nsTableFrame::GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aT
}
/* helper method for determining if this is a nested table or not */
PRBool nsTableFrame::IsNested(const nsHTMLReflowState& aReflowState, nsStylePosition *& aPosition) const
PRBool nsTableFrame::IsNested(const nsHTMLReflowState& aReflowState, const nsStylePosition *& aPosition) const
{
PRBool result = PR_FALSE;
#ifdef NS_DEBUG
@ -3646,11 +3646,11 @@ PRBool nsTableFrame::IsNested(const nsHTMLReflowState& aReflowState, nsStylePosi
break;
#endif
const nsStyleDisplay *display;
rs->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
rs->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE==display->mDisplay)
{
result = PR_TRUE;
rs->frame->GetStyleData(eStyleStruct_Position, ((nsStyleStruct *&)aPosition));
rs->frame->GetStyleData(eStyleStruct_Position, ((const nsStyleStruct *&)aPosition));
break;
}
rs = rs->parentReflowState;
@ -3672,7 +3672,7 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowSta
while (nsnull != rs)
{
// if it's a block, use its max width
rs->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
rs->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_BLOCK==display->mDisplay)
{ // we found a block, see if it's really a table cell (which means we're a nested table)
PRBool skipThisBlock=PR_FALSE;
@ -3682,7 +3682,7 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowSta
parentRS = parentRS->parentReflowState;
if (nsnull!=parentRS)
{
parentRS->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
parentRS->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_CELL==display->mDisplay) {
if (PR_TRUE==gsDebugNT)
printf("%p: found a block pframe %p in a cell, skipping it.\n", aReflowState.frame, rs->frame);
@ -3710,13 +3710,13 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowSta
nsMargin borderPadding;
const nsStylePosition* tablePosition;
const nsStyleSpacing* spacing;
rs->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
rs->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_CELL==display->mDisplay)
{ // if it's a cell and the cell has a specified width, use it
// Compute and subtract out the insets (sum of border and padding) for the table
lastCellFrame = (nsTableCellFrame*)(rs->frame);
const nsStylePosition* cellPosition;
lastCellFrame->GetStyleData(eStyleStruct_Position, ((nsStyleStruct *&)cellPosition));
lastCellFrame->GetStyleData(eStyleStruct_Position, ((const nsStyleStruct *&)cellPosition));
if (eStyleUnit_Coord == cellPosition->mWidth.GetUnit())
{
nsTableFrame *tableParent;
@ -3748,14 +3748,14 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowSta
}
else
{
rs->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
rs->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE==display->mDisplay)
{
// we only want to do this for inner table frames, so check the frame's parent to make sure it is an outer table frame
// we know that if both the frame and it's parent map to NS_STYLE_DISPLAY_TABLE, then we have an inner table frame
nsIFrame * tableFrameParent;
rs->frame->GetGeometricParent(tableFrameParent);
tableFrameParent->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
tableFrameParent->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE==display->mDisplay)
{
/* We found the nearest containing table (actually, the inner table).
@ -3953,8 +3953,8 @@ void nsTableFrame::SetMaxElementSize(nsSize* aMaxElementSize)
PRBool nsTableFrame::RequiresPass1Layout()
{
nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
return (PRBool)(NS_STYLE_TABLE_LAYOUT_FIXED!=tableStyle->mLayoutStrategy);
}

Просмотреть файл

@ -73,7 +73,7 @@ public:
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
/** helper method for determining if this is a nested table or not */
PRBool IsNested(const nsHTMLReflowState& aReflowState, nsStylePosition *& aPosition) const;
PRBool IsNested(const nsHTMLReflowState& aReflowState, const nsStylePosition *& aPosition) const;
/** helper method to find the table parent of any table frame object */
static NS_METHOD GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aTableFrame);

Просмотреть файл

@ -170,7 +170,7 @@ nsresult nsTableOuterFrame::RecoverState(OuterTableReflowState& aReflowState,
// Get the previous frame's bottom margin
const nsStyleSpacing* kidSpacing;
prevKidFrame->GetStyleData(eStyleStruct_Spacing, (nsStyleStruct *&)kidSpacing);
prevKidFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)kidSpacing);
nsMargin margin;
kidSpacing->CalcMarginFor(prevKidFrame, margin);
if (margin.bottom < 0) {
@ -238,7 +238,7 @@ nsresult nsTableOuterFrame::AdjustSiblingsAfterReflow(nsIPresContext& aPr
// Get the bottom margin for the last child frame
const nsStyleSpacing* kidSpacing;
lastKidFrame->GetStyleData(eStyleStruct_Spacing, (nsStyleStruct *&)kidSpacing);
lastKidFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)kidSpacing);
nsMargin margin;
kidSpacing->CalcMarginFor(lastKidFrame, margin);
if (margin.bottom < 0) {
@ -335,7 +335,7 @@ nsresult nsTableOuterFrame::IR_TargetIsCaptionFrame(nsIPresContext& aPres
aReflowState.reflowState.reflowCommand->GetType(reflowCommandType);
const nsStyleText* priorCaptionTextStyle=nsnull;
if (nsIReflowCommand::StyleChanged==reflowCommandType)
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)priorCaptionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)priorCaptionTextStyle));
if (PR_TRUE==gsDebugIR) printf("TOF IR: prior caption width=%d height=%d, minWidth=%d\n",
priorCaptionRect.width, priorCaptionRect.height,
mMinCaptionWidth);
@ -366,7 +366,7 @@ nsresult nsTableOuterFrame::IR_TargetIsCaptionFrame(nsIPresContext& aPres
if (nsIReflowCommand::StyleChanged==reflowCommandType)
{
const nsStyleText* captionTextStyle;
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)captionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)captionTextStyle));
if (PR_TRUE==IR_CaptionChangedAxis(priorCaptionTextStyle, captionTextStyle))
innerTableNeedsReflow=PR_TRUE;
}
@ -438,7 +438,7 @@ nsresult nsTableOuterFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
case nsIReflowCommand::FrameInserted :
{
const nsStyleDisplay *childDisplay;
objectFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
objectFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_CAPTION == childDisplay->mDisplay)
{
rv = IR_CaptionInserted(aPresContext, aDesiredSize, aReflowState, aStatus,
@ -459,7 +459,7 @@ nsresult nsTableOuterFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
{
// verify that the new frame is a caption frame
const nsStyleDisplay *newFrameDisplay;
newFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)newFrameDisplay));
newFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)newFrameDisplay));
NS_ASSERTION(NS_STYLE_DISPLAY_TABLE_CAPTION == childDisplay->mDisplay, "bad new frame");
if (NS_STYLE_DISPLAY_TABLE_CAPTION == childDisplay->mDisplay)
{
@ -574,9 +574,9 @@ nsresult nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext& aPresCont
// XXX: should just call SizeAndPlaceChildren regardless
// find where to place the caption
const nsStyleSpacing* spacing;
mCaptionFrame->GetStyleData(eStyleStruct_Spacing, (nsStyleStruct *&)spacing);
mCaptionFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)spacing);
spacing->CalcMarginFor(mCaptionFrame, captionMargin);
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)captionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)captionTextStyle));
if ((priorInnerTableRect.height!=innerSize.height) || (PR_TRUE==captionDimChanged))
{
// Compute the caption's y-origin
@ -686,7 +686,7 @@ nsresult nsTableOuterFrame::IR_CaptionInserted(nsIPresContext& aPresConte
mMinCaptionWidth = maxElementSize.width;
// get the caption's alignment
const nsStyleText* captionTextStyle;
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)captionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)captionTextStyle));
if (PR_TRUE || // XXX: this is a hack because we don't support left|right captions yet
(captionTextStyle->mVerticalAlign.GetUnit()!=eStyleUnit_Enumerated) || // default is "top"
((captionTextStyle->mVerticalAlign.GetUnit()==eStyleUnit_Enumerated) &&
@ -742,7 +742,7 @@ nsresult nsTableOuterFrame::IR_CaptionRemoved(nsIPresContext& aPresContex
{
// get the caption's alignment
const nsStyleText* captionTextStyle;
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)captionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)captionTextStyle));
// if the caption's MES > table width, reflow the inner table minus the MES
nsHTMLReflowMetrics innerSize(aDesiredSize.maxElementSize);
nscoord oldMinCaptionWidth = mMinCaptionWidth;
@ -803,12 +803,12 @@ nsresult nsTableOuterFrame::SizeAndPlaceChildren(const nsSize & aInnerS
// find where to place the caption
nsMargin captionMargin;
const nsStyleSpacing* spacing;
mCaptionFrame->GetStyleData(eStyleStruct_Spacing, (nsStyleStruct *&)spacing);
mCaptionFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)spacing);
spacing->CalcMarginFor(mCaptionFrame, captionMargin);
// Compute the caption's y-origin
nscoord captionY = captionMargin.top;
const nsStyleText* captionTextStyle;
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)captionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)captionTextStyle));
if ((captionTextStyle->mVerticalAlign.GetUnit()==eStyleUnit_Enumerated) &&
(captionTextStyle->mVerticalAlign.GetIntValue()==NS_STYLE_VERTICAL_ALIGN_BOTTOM))
{
@ -1014,13 +1014,13 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext& aPresContext,
nsMargin captionMargin;
const nsStyleSpacing* spacing;
mCaptionFrame->GetStyleData(eStyleStruct_Spacing, (nsStyleStruct *&)spacing);
mCaptionFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)spacing);
spacing->CalcMarginFor(mCaptionFrame, captionMargin);
// Compute the caption's y-origin
nscoord captionY = captionMargin.top;
const nsStyleText* captionTextStyle;
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)captionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)captionTextStyle));
if ((captionTextStyle->mVerticalAlign.GetUnit()==eStyleUnit_Enumerated) &&
(captionTextStyle->mVerticalAlign.GetIntValue()==NS_STYLE_VERTICAL_ALIGN_BOTTOM)) {
captionY += innerSize.height;

Просмотреть файл

@ -133,7 +133,7 @@ nsTableRowFrame::InitChildren(PRInt32 aRowIndex)
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; kidFrame->GetNextSibling(kidFrame))
{
const nsStyleDisplay *kidDisplay;
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
// what column does this cell belong to?
@ -189,7 +189,7 @@ nsTableRowFrame::DidResize(nsIPresContext& aPresContext,
while (nsnull != cellFrame)
{
const nsStyleDisplay *kidDisplay;
cellFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
cellFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
PRInt32 rowSpan = tableFrame->GetEffectiveRowSpan(mRowIndex, (nsTableCellFrame *)cellFrame);
@ -351,7 +351,7 @@ PRInt32 nsTableRowFrame::GetMaxColumns() const
while (nsnull!=cell)
{
const nsStyleDisplay *kidDisplay;
cell->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
cell->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
sum += ((nsTableCellFrame *)cell)->GetColSpan();
@ -371,7 +371,7 @@ void nsTableRowFrame::GetMinRowSpan(nsTableFrame *aTableFrame)
while (nsnull!=frame)
{
const nsStyleDisplay *kidDisplay;
frame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
frame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
PRInt32 rowSpan = aTableFrame->GetEffectiveRowSpan(mRowIndex, ((nsTableCellFrame *)frame));
@ -391,7 +391,7 @@ void nsTableRowFrame::FixMinCellHeight(nsTableFrame *aTableFrame)
while (nsnull!=frame)
{
const nsStyleDisplay *kidDisplay;
frame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
frame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
PRInt32 rowSpan = aTableFrame->GetEffectiveRowSpan(mRowIndex, ((nsTableCellFrame *)frame));
@ -504,12 +504,12 @@ NS_METHOD nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext,
// Reflow each of our existing cell frames
const nsStyleDisplay *rowDisplay;
GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)rowDisplay);
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)rowDisplay);
nsIFrame* kidFrame=GetFirstChildForDirection(rowDisplay->mDirection);
for (kidFrame; nsnull != kidFrame; )
{
const nsStyleDisplay *kidDisplay;
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
nsMargin kidMargin;
@ -710,8 +710,8 @@ nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext,
PRBool tableLayoutStrategy=NS_STYLE_TABLE_LAYOUT_AUTO;
nsTableFrame* table = aReflowState.tableFrame;
nsresult rv = NS_OK;
nsStyleTable* tableStyle;
table->GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable* tableStyle;
table->GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
tableLayoutStrategy = tableStyle->mLayoutStrategy;
nsIFrame* kidFrame;
@ -723,7 +723,7 @@ nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext,
for ( ; nsnull != kidFrame; kidFrame->GetNextSibling(kidFrame))
{
const nsStyleDisplay *kidDisplay;
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
// Get the child's margins
@ -739,7 +739,7 @@ nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext,
// get border padding values
nsMargin borderPadding;
const nsStyleSpacing* cellSpacing;
kidFrame->GetStyleData(eStyleStruct_Spacing , ((nsStyleStruct *&)cellSpacing));
kidFrame->GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)cellSpacing));
cellSpacing->CalcBorderPaddingFor(kidFrame, borderPadding);
// Because we're not splittable always allow the child to be as high as
@ -838,7 +838,7 @@ NS_METHOD nsTableRowFrame::RecoverState(nsIPresContext& aPresContext,
for (nsIFrame* frame = mFirstChild; nsnull != frame;)
{
const nsStyleDisplay *kidDisplay;
frame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
frame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
if (frame != aKidFrame) {
@ -951,7 +951,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
aReflowState.reflowState.reflowCommand->GetChildFrame(objectFrame);
const nsStyleDisplay *childDisplay=nsnull;
if (nsnull!=objectFrame)
objectFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
objectFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (PR_TRUE==gsDebugIR) printf("TRF IR: IncrementalReflow_TargetIsMe with type=%d\n", type);
switch (type)
{
@ -1116,7 +1116,7 @@ NS_METHOD nsTableRowFrame::IR_CellAppended(nsIPresContext& aPresContext,
{
// remember the last child that is really a cell
const nsStyleDisplay *childDisplay;
nextChild->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
nextChild->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == childDisplay->mDisplay)
lastRow = nextChild;
lastChild = nextChild;
@ -1199,7 +1199,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext& aPresContext,
nsresult rv;
const nsStyleDisplay *childDisplay;
aNextFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
aNextFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == childDisplay->mDisplay)
{
// Recover our reflow state

Просмотреть файл

@ -125,7 +125,7 @@ NS_METHOD nsTableRowGroupFrame::GetRowCount(PRInt32 &aCount)
if (nsnull==childFrame)
break;
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
aCount++;
childFrame->GetNextSibling(childFrame);
@ -143,7 +143,7 @@ NS_METHOD nsTableRowGroupFrame::GetMaxColumns(PRInt32 &aMaxColumns) const
if (nsnull==childFrame)
break;
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
{
PRInt32 colCount = ((nsTableRowFrame *)childFrame)->GetMaxColumns();
@ -244,7 +244,7 @@ nsTableRowGroupFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
while (nsnull != kid) {
kid->GetRect(kidRect);
const nsStyleDisplay *childDisplay;
kid->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
kid->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay) {
if (((nsTableRowFrame*)(kid))->Contains(aPoint)) {
tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y);
@ -625,7 +625,7 @@ void nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext& aPresContext,
while (nsnull != rowFrame)
{
const nsStyleDisplay *childDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
{
// get the height of the tallest cell in the row (excluding cells that span rows)
@ -675,7 +675,7 @@ void nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext& aPresContext,
while (nsnull != rowFrame)
{
const nsStyleDisplay *childDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
{
if (gsDebug) printf("TRGF CalcRowH: Step 2 for row %d (%p)...\n", rowIndex, rowFrame);
@ -685,7 +685,7 @@ void nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext& aPresContext,
while (nsnull != cellFrame)
{
const nsStyleDisplay *childDisplay;
cellFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
cellFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == childDisplay->mDisplay)
{
if (gsDebug) printf("TRGF CalcRowH: for cell %p...\n", cellFrame);
@ -782,7 +782,7 @@ void nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext& aPresContext,
while (nsnull != rowFrame)
{
const nsStyleDisplay *childDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
{
((nsTableRowFrame *)rowFrame)->DidResize(aPresContext, aReflowState);
@ -979,7 +979,7 @@ NS_METHOD nsTableRowGroupFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
aReflowState.reflowState.reflowCommand->GetChildFrame(objectFrame);
const nsStyleDisplay *childDisplay=nsnull;
if (nsnull!=objectFrame)
objectFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
objectFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (PR_TRUE==gsDebugIR) printf("TRGF IR: TargetIsMe with type=%d\n", type);
switch (type)
{
@ -1104,7 +1104,7 @@ PRBool nsTableRowGroupFrame::NoRowsFollow()
while (nsnull!=nextSib)
{
const nsStyleDisplay *sibDisplay;
nextSib->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)sibDisplay));
nextSib->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)sibDisplay));
if ((NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == sibDisplay->mDisplay) ||
(NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == sibDisplay->mDisplay) ||
(NS_STYLE_DISPLAY_TABLE_ROW_GROUP == sibDisplay->mDisplay))
@ -1114,7 +1114,7 @@ PRBool nsTableRowGroupFrame::NoRowsFollow()
while (nsnull!=childFrame)
{
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
{ // found a row
result = PR_FALSE;

Просмотреть файл

@ -119,7 +119,7 @@ NS_METHOD nsTableCellFrame::Paint(nsIPresContext& aPresContext,
//XXX: also check style for rule on rendering empty cells
nsMargin borderPadding;
const nsStyleSpacing* cellSpacing;
GetStyleData(eStyleStruct_Spacing , ((nsStyleStruct *&)cellSpacing));
GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)cellSpacing));
cellSpacing->CalcBorderPaddingFor(this, borderPadding);
nscoord contentWidth = mPass1DesiredSize.width - (borderPadding.left+borderPadding.right);
nscoord contentHeight = mPass1DesiredSize.height - (borderPadding.top+borderPadding.bottom);
@ -587,8 +587,8 @@ void nsTableCellFrame::MapBorderMarginPadding(nsIPresContext* aPresContext)
// get the table frame style context, and from it get cellpadding, cellspacing, and border info
const nsStyleTable* tableStyle;
tableFrame->GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
nsStyleSpacing* tableSpacingStyle;
tableFrame->GetStyleData(eStyleStruct_Spacing,(nsStyleStruct *&)tableSpacingStyle);
const nsStyleSpacing* tableSpacingStyle;
tableFrame->GetStyleData(eStyleStruct_Spacing,(const nsStyleStruct *&)tableSpacingStyle);
nsStyleSpacing* spacingData = (nsStyleSpacing*)mStyleContext->GetMutableStyleData(eStyleStruct_Spacing);
// check to see if cellpadding or cellspacing is defined

Просмотреть файл

@ -77,15 +77,15 @@ NS_METHOD nsTableColFrame::Reflow(nsIPresContext& aPresContext,
PRInt32 nsTableColFrame::GetSpan()
{
nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
return tableStyle->mSpan;
}
nscoord nsTableColFrame::GetColWidthForComputation()
{
const nsStylePosition* position;
GetStyleData(eStyleStruct_Position, ((nsStyleStruct *&)position));
GetStyleData(eStyleStruct_Position, ((const nsStyleStruct *&)position));
if (eStyleUnit_Coord==position->mWidth.GetUnit())
return position->mWidth.GetCoordValue();
else

Просмотреть файл

@ -264,7 +264,7 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsMe(nsIPresContext& aPresCont
aReflowState.reflowCommand->GetChildFrame(objectFrame);
const nsStyleDisplay *childDisplay=nsnull;
if (nsnull!=objectFrame)
objectFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
objectFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (PR_TRUE==gsDebugIR) printf("nTCGF IR: IncrementalReflow_TargetIsMe with type=%d\n", type);
switch (type)
{
@ -358,7 +358,7 @@ NS_METHOD nsTableColGroupFrame::IR_ColInserted(nsIPresContext& aPresCon
while ((NS_SUCCEEDED(rv)) && (nsnull!=childFrame))
{
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
startingColIndex += ((nsTableColGroupFrame *)childFrame)->SetStartColumnIndex(startingColIndex);
@ -395,7 +395,7 @@ NS_METHOD nsTableColGroupFrame::IR_ColAppended(nsIPresContext& aPresCon
while ((NS_SUCCEEDED(rv)) && (nsnull!=childFrame))
{
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
startingColIndex += ((nsTableColGroupFrame *)childFrame)->SetStartColumnIndex(startingColIndex);
@ -437,7 +437,7 @@ NS_METHOD nsTableColGroupFrame::IR_ColRemoved(nsIPresContext& aPresCont
startingColIndex += GetColumnCount(); // resets all column indexes
}
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
// we've removed aDeletedFrame, now adjust the starting col index of all subsequent col groups
@ -522,8 +522,8 @@ NS_METHOD nsTableColGroupFrame::SetStyleContextForFirstPass(nsIPresContext& aPre
if ((NS_SUCCEEDED(rv)) && (nsnull!=tableFrame))
{
// get the style for the table frame
nsStyleTable *tableStyle;
tableFrame->GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable *tableStyle;
tableFrame->GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
// if COLS is set, then map it into the COL frames
if (NS_STYLE_TABLE_COLS_NONE != tableStyle->mCols)
@ -540,8 +540,8 @@ NS_METHOD nsTableColGroupFrame::SetStyleContextForFirstPass(nsIPresContext& aPre
nsIFrame *colFrame=mFirstChild;
while (nsnull!=colFrame)
{
nsStyleDisplay * colDisplay=nsnull;
colFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)colDisplay));
const nsStyleDisplay * colDisplay=nsnull;
colFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)colDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN == colDisplay->mDisplay)
{
nsIStyleContextPtr colStyleContext;
@ -573,20 +573,20 @@ NS_METHOD nsTableColGroupFrame::SetStyleContextForFirstPass(nsIPresContext& aPre
nsIFrame *colFrame=mFirstChild;
while (nsnull!=colFrame)
{
nsStyleDisplay * colDisplay=nsnull;
colFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)colDisplay));
const nsStyleDisplay * colDisplay=nsnull;
colFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)colDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN == colDisplay->mDisplay)
{
nsIStyleContextPtr colStyleContext;
nsStylePosition * colPosition=nsnull;
colFrame->GetStyleData(eStyleStruct_Position, (nsStyleStruct *&)colPosition); // get a read-only version of the style context
const nsStylePosition * colPosition=nsnull;
colFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct *&)colPosition); // get a read-only version of the style context
//XXX: how do I know this is auto because it's defaulted, vs. set explicitly to "auto"?
if (eStyleUnit_Auto==colPosition->mWidth.GetUnit())
{
// notice how we defer getting a mutable style context until we're sure we really need one
colFrame->GetStyleContext(colStyleContext.AssignRef());
colPosition = (nsStylePosition*)colStyleContext->GetMutableStyleData(eStyleStruct_Position);
colPosition->mWidth = position->mWidth;
nsStylePosition * mutableColPosition = (nsStylePosition*)colStyleContext->GetMutableStyleData(eStyleStruct_Position);
mutableColPosition->mWidth = position->mWidth;
colStyleContext->RecalcAutomaticData(&aPresContext);
}
}
@ -611,7 +611,7 @@ int nsTableColGroupFrame::GetColumnCount ()
while (nsnull!=childFrame)
{
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN == childDisplay->mDisplay)
{
nsTableColFrame *col = (nsTableColFrame *)childFrame;
@ -623,7 +623,7 @@ int nsTableColGroupFrame::GetColumnCount ()
if (0==mColCount)
{ // there were no children of this colgroup that were columns. So use my span attribute
const nsStyleTable *tableStyle;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
mColCount = tableStyle->mSpan;
}
return mColCount;
@ -643,7 +643,7 @@ nsTableColFrame * nsTableColGroupFrame::GetNextColumn(nsIFrame *aChildFrame)
while (nsnull!=childFrame)
{
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN == childDisplay->mDisplay)
{
result = (nsTableColFrame *)childFrame;
@ -663,7 +663,7 @@ nsTableColFrame * nsTableColGroupFrame::GetColumnAt (PRInt32 aColIndex)
while (nsnull!=childFrame)
{
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN == childDisplay->mDisplay)
{
nsTableColFrame *col = (nsTableColFrame *)childFrame;
@ -679,8 +679,8 @@ nsTableColFrame * nsTableColGroupFrame::GetColumnAt (PRInt32 aColIndex)
PRInt32 nsTableColGroupFrame::GetSpan()
{
PRInt32 span=1;
nsStyleTable* tableStyle=nsnull;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable* tableStyle=nsnull;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
if (nsnull!=tableStyle)
{
span = tableStyle->mSpan;

Просмотреть файл

@ -311,7 +311,7 @@ nsTableFrame::SetInitialChildList(nsIPresContext& aPresContext,
for ( ; nsnull!=nextRowGroup; nextRowGroup->GetNextSibling(nextRowGroup))
{
const nsStyleDisplay *rowGroupDisplay;
nextRowGroup->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)rowGroupDisplay);
nextRowGroup->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)rowGroupDisplay);
if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay))
{
rv = DidAppendRowGroup((nsTableRowGroupFrame*)nextRowGroup);
@ -330,7 +330,7 @@ NS_IMETHODIMP nsTableFrame::DidAppendRowGroup(nsTableRowGroupFrame *aRowGroupFra
for ( ; nsnull!=nextRow; nextRow->GetNextSibling(nextRow))
{
const nsStyleDisplay *rowDisplay;
nextRow->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)rowDisplay);
nextRow->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)rowDisplay);
if (NS_STYLE_DISPLAY_TABLE_ROW==rowDisplay->mDisplay)
{
rv = ((nsTableRowFrame *)nextRow)->InitChildren();
@ -359,7 +359,7 @@ nsTableRowGroupFrame* nsTableFrame::NextRowGroupFrame(nsTableRowGroupFrame* aRow
while (nsnull != aRowGroupFrame)
{
const nsStyleDisplay *display;
aRowGroupFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
aRowGroupFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (PR_TRUE==IsRowGroup(display->mDisplay))
{
break;
@ -378,7 +378,7 @@ PRInt32 nsTableFrame::GetSpecifiedColumnCount ()
while (nsnull!=childFrame)
{
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay)
{
mColCount += ((nsTableColGroupFrame *)childFrame)->GetColumnCount();
@ -613,8 +613,8 @@ PRInt32 nsTableFrame::GetEffectiveCOLSAttribute()
NS_PRECONDITION (nsnull!=cellMap, "null cellMap.");
PRInt32 result;
nsIFrame *tableFrame = this;
nsStyleTable *tableStyle=nsnull;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable *tableStyle=nsnull;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
result = tableStyle->mCols;
PRInt32 numCols = GetColCount();
if (result>numCols)
@ -649,7 +649,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext)
while (nsnull!=childFrame)
{
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay)
{
((nsTableColGroupFrame*)childFrame)->SetStartColumnIndex(actualColumns);
@ -911,7 +911,7 @@ NS_METHOD nsTableFrame::ReBuildCellMap()
for ( ; nsnull!=rowGroupFrame; rowGroupFrame->GetNextSibling(rowGroupFrame))
{
const nsStyleDisplay *rowGroupDisplay;
rowGroupFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)rowGroupDisplay);
rowGroupFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)rowGroupDisplay);
if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay))
{
nsIFrame *rowFrame;
@ -919,7 +919,7 @@ NS_METHOD nsTableFrame::ReBuildCellMap()
for ( ; nsnull!=rowFrame; rowFrame->GetNextSibling(rowFrame))
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)rowDisplay);
rowFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)rowDisplay);
if (NS_STYLE_DISPLAY_TABLE_ROW==rowDisplay->mDisplay)
{
rv = ((nsTableRowFrame *)rowFrame)->InitChildren();
@ -1640,7 +1640,7 @@ NS_METHOD nsTableFrame::ResizeReflowPass1(nsIPresContext& aPresContext,
for ( ; nsnull != kidFrame; kidFrame->GetNextSibling(kidFrame))
{
const nsStyleDisplay *childDisplay;
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if ((NS_STYLE_DISPLAY_TABLE_HEADER_GROUP != childDisplay->mDisplay) &&
(NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP != childDisplay->mDisplay) &&
(NS_STYLE_DISPLAY_TABLE_ROW_GROUP != childDisplay->mDisplay) &&
@ -1824,7 +1824,7 @@ NS_METHOD nsTableFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
aReflowState.reflowState.reflowCommand->GetChildFrame(objectFrame);
const nsStyleDisplay *childDisplay=nsnull;
if (nsnull!=objectFrame)
objectFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
objectFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (PR_TRUE==gsDebugIR) printf("TIF IR: IncrementalReflow_TargetIsMe with type=%d\n", type);
switch (type)
{
@ -1948,7 +1948,7 @@ NS_METHOD nsTableFrame::IR_ColGroupInserted(nsIPresContext& aPresContext,
frameToInsertAfter->SetNextSibling(aInsertedFrame);
// account for childFrame being a COLGROUP now
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
if (PR_FALSE==adjustStartingColIndex) // we haven't gotten to aDeletedFrame yet
@ -1960,7 +1960,7 @@ NS_METHOD nsTableFrame::IR_ColGroupInserted(nsIPresContext& aPresContext,
// start adjusting subsequent col groups' starting col index including aInsertedFrame
}
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
if (PR_FALSE==adjustStartingColIndex) // we haven't gotten to aDeletedFrame yet
@ -1994,7 +1994,7 @@ NS_METHOD nsTableFrame::IR_ColGroupAppended(nsIPresContext& aPresContext,
while ((NS_SUCCEEDED(rv)) && (nsnull!=childFrame))
{
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
startingColIndex += ((nsTableColGroupFrame *)childFrame)->GetColumnCount();
@ -2091,7 +2091,7 @@ NS_METHOD nsTableFrame::IR_ColGroupRemoved(nsIPresContext& aPresContext,
adjustStartingColIndex=PR_TRUE; // now that we've removed aDeletedFrame, start adjusting subsequent col groups' starting col index
}
const nsStyleDisplay *display;
childFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
childFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay)
{
if (PR_FALSE==adjustStartingColIndex) // we haven't gotten to aDeletedFrame yet
@ -2252,7 +2252,7 @@ nscoord nsTableFrame::ComputeDesiredWidth(const nsHTMLReflowState& aReflowState)
{
nscoord desiredWidth=aReflowState.maxSize.width;
// this is the biggest hack in the world. But there's no other rational way to handle nested percent tables
nsStylePosition* position;
const nsStylePosition* position;
PRBool isNested=IsNested(aReflowState, position);
if((eReflowReason_Initial==aReflowState.reason) &&
(PR_TRUE==isNested) && (eStyleUnit_Percent==position->mWidth.GetUnit()))
@ -2309,7 +2309,7 @@ void nsTableFrame::PlaceChild(nsIPresContext& aPresContext,
// If this is a footer row group, add it to the list of footer row groups
const nsStyleDisplay *childDisplay;
aKidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
aKidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == childDisplay->mDisplay)
{
if (nsnull==aReflowState.footerList)
@ -2350,7 +2350,7 @@ void nsTableFrame::PlaceChild(nsIPresContext& aPresContext,
{
nsMargin borderPadding;
const nsStyleSpacing* tableSpacing;
GetStyleData(eStyleStruct_Spacing , ((nsStyleStruct *&)tableSpacing));
GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)tableSpacing));
tableSpacing->CalcBorderPaddingFor(this, borderPadding);
nscoord cellSpacing = GetCellSpacing();
nscoord kidWidth = aKidMaxElementSize.width + borderPadding.left + borderPadding.right + cellSpacing*2;
@ -2398,12 +2398,12 @@ NS_METHOD nsTableFrame::ReflowMappedChildren(nsIPresContext& aPresContext,
desiredSize.width=desiredSize.height=desiredSize.ascent=desiredSize.descent=0;
const nsStyleDisplay *childDisplay;
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if ((PR_TRUE==IsRowGroup(childDisplay->mDisplay)) ||
(NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay))
{ // for all colgroups and rowgroups...
const nsStyleSpacing* kidSpacing;
kidFrame->GetStyleData(eStyleStruct_Spacing, ((nsStyleStruct *&)kidSpacing));
kidFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)kidSpacing));
nsMargin kidMargin;
kidSpacing->CalcMarginFor(kidFrame, kidMargin);
@ -2598,7 +2598,7 @@ NS_METHOD nsTableFrame::PullUpChildren(nsIPresContext& aPresContext,
//kidRect.x += kidMol->margin.left;
kidRect.y += aReflowState.y;
const nsStyleDisplay *childDisplay;
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (PR_TRUE==IsRowGroup(childDisplay->mDisplay))
{
PlaceChild(aPresContext, aReflowState, kidFrame, kidRect, aDesiredSize.maxElementSize, *pKidMaxElementSize);
@ -2783,11 +2783,11 @@ nscoord nsTableFrame::GetEffectiveContainerHeight(const nsHTMLReflowState& aRefl
while (nsnull!=rs)
{
const nsStyleDisplay *display;
rs->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
rs->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE==display->mDisplay)
{
const nsStylePosition *position;
rs->frame->GetStyleData(eStyleStruct_Position, (nsStyleStruct *&)position);
rs->frame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct *&)position);
nsStyleUnit unit = position->mHeight.GetUnit();
if (eStyleUnit_Null==unit || eStyleUnit_Auto==unit)
{
@ -2850,7 +2850,7 @@ nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext,
while (nsnull!=rowGroupFrame)
{
const nsStyleDisplay *rowGroupDisplay;
rowGroupFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)rowGroupDisplay));
rowGroupFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowGroupDisplay));
if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay))
{ // the rows in rowGroupFrame need to be expanded by rowHeightDelta[i]
// and the rowgroup itself needs to be expanded by SUM(row height deltas)
@ -2860,7 +2860,7 @@ nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext,
while ((NS_SUCCEEDED(rv)) && (nsnull!=rowFrame))
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)rowDisplay));
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay)
{ // the row needs to be expanded by the proportion this row contributed to the original height
nsRect rowRect;
@ -2877,7 +2877,7 @@ nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext,
while (nsnull!=rowGroupFrame)
{
const nsStyleDisplay *rowGroupDisplay;
rowGroupFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)rowGroupDisplay));
rowGroupFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowGroupDisplay));
if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay))
{ // the rows in rowGroupFrame need to be expanded by rowHeightDelta[i]
// and the rowgroup itself needs to be expanded by SUM(row height deltas)
@ -2887,7 +2887,7 @@ nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext,
while ((NS_SUCCEEDED(rv)) && (nsnull!=rowFrame))
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)rowDisplay));
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay)
{ // the row needs to be expanded by the proportion this row contributed to the original height
nsRect rowRect;
@ -3076,7 +3076,7 @@ NS_METHOD nsTableFrame::GetColumnFrame(PRInt32 aColIndex, nsTableColFrame *&aCol
break;
}
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay)
{
PRInt32 colGroupStartingIndex = ((nsTableColGroupFrame *)childFrame)->GetStartColumnIndex();
@ -3118,8 +3118,8 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext,
NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!");
NS_ASSERTION(nsnull!=mCellMap, "never ever call me until the cell map is built!");
PRInt32 colIndex=0;
nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
EnsureColumns(aPresContext);
if (nsnull!=mColCache)
{
@ -3133,7 +3133,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext,
while (nsnull!=childFrame)
{ // in this loop, we cache column info and set column style info from cells
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay)
{ // if it's a col group then get the columns and cache them in the CellMap
@ -3164,7 +3164,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext,
while (nsnull!=rowFrame)
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)rowDisplay));
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay)
{
nsIFrame *cellFrame;
@ -3176,7 +3176,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext,
* set the column style from the cell's width attribute (if this is the first row)
*/
const nsStyleDisplay *cellDisplay;
cellFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)cellDisplay));
cellFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)cellDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == cellDisplay->mDisplay)
SetColumnStyleFromCell(aPresContext, (nsTableCellFrame *)cellFrame, (nsTableRowFrame *)rowFrame);
cellFrame->GetNextSibling(cellFrame);
@ -3195,7 +3195,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext,
while (nsnull!=childFrame)
{ // for every child, if it's a col group then get the columns
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay)
{
nsTableColFrame *colFrame=nsnull;
@ -3204,11 +3204,11 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext,
{ // for every column, create an entry in the column cache
// assumes that the col style has been twiddled to account for first cell width attribute
const nsStyleDisplay *colDisplay;
colFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)colDisplay));
colFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)colDisplay));
if (NS_STYLE_DISPLAY_TABLE_COLUMN == colDisplay->mDisplay)
{
const nsStylePosition* colPosition;
colFrame->GetStyleData(eStyleStruct_Position, ((nsStyleStruct *&)colPosition));
colFrame->GetStyleData(eStyleStruct_Position, ((const nsStyleStruct *&)colPosition));
PRInt32 repeat = colFrame->GetSpan();
colIndex = colFrame->GetColumnIndex();
for (PRInt32 i=0; i<repeat; i++)
@ -3287,7 +3287,7 @@ void nsTableFrame::InvalidateCellMap()
for ( ; nsnull!=rowGroupFrame; rowGroupFrame->GetNextSibling(rowGroupFrame))
{
const nsStyleDisplay *rowGroupDisplay;
rowGroupFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)rowGroupDisplay);
rowGroupFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)rowGroupDisplay);
if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay))
{
nsIFrame *rowFrame;
@ -3295,7 +3295,7 @@ void nsTableFrame::InvalidateCellMap()
for ( ; nsnull!=rowFrame; rowFrame->GetNextSibling(rowFrame))
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)rowDisplay);
rowFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)rowDisplay);
if (NS_STYLE_DISPLAY_TABLE_ROW==rowDisplay->mDisplay)
{
((nsTableRowFrame *)rowFrame)->ResetInitChildren();
@ -3560,8 +3560,8 @@ NS_METHOD nsTableFrame::GetCellMarginData(nsTableCellFrame* aKidFrame, nsMargin&
nscoord nsTableFrame::GetCellSpacing()
{
nsTableFrame* tableFrame = this;
nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
nscoord cellSpacing = 0;
if (tableStyle->mCellSpacing.GetUnit() == eStyleUnit_Coord)
cellSpacing = tableStyle->mCellSpacing.GetCoordValue();
@ -3614,7 +3614,7 @@ NS_METHOD nsTableFrame::GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aT
while ((NS_OK==result) && (nsnull!=parentFrame))
{
const nsStyleDisplay *display;
parentFrame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
parentFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE == display->mDisplay)
{
aTableFrame = (nsTableFrame *)parentFrame;
@ -3630,7 +3630,7 @@ NS_METHOD nsTableFrame::GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aT
}
/* helper method for determining if this is a nested table or not */
PRBool nsTableFrame::IsNested(const nsHTMLReflowState& aReflowState, nsStylePosition *& aPosition) const
PRBool nsTableFrame::IsNested(const nsHTMLReflowState& aReflowState, const nsStylePosition *& aPosition) const
{
PRBool result = PR_FALSE;
#ifdef NS_DEBUG
@ -3646,11 +3646,11 @@ PRBool nsTableFrame::IsNested(const nsHTMLReflowState& aReflowState, nsStylePosi
break;
#endif
const nsStyleDisplay *display;
rs->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
rs->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE==display->mDisplay)
{
result = PR_TRUE;
rs->frame->GetStyleData(eStyleStruct_Position, ((nsStyleStruct *&)aPosition));
rs->frame->GetStyleData(eStyleStruct_Position, ((const nsStyleStruct *&)aPosition));
break;
}
rs = rs->parentReflowState;
@ -3672,7 +3672,7 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowSta
while (nsnull != rs)
{
// if it's a block, use its max width
rs->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
rs->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_BLOCK==display->mDisplay)
{ // we found a block, see if it's really a table cell (which means we're a nested table)
PRBool skipThisBlock=PR_FALSE;
@ -3682,7 +3682,7 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowSta
parentRS = parentRS->parentReflowState;
if (nsnull!=parentRS)
{
parentRS->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
parentRS->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_CELL==display->mDisplay) {
if (PR_TRUE==gsDebugNT)
printf("%p: found a block pframe %p in a cell, skipping it.\n", aReflowState.frame, rs->frame);
@ -3710,13 +3710,13 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowSta
nsMargin borderPadding;
const nsStylePosition* tablePosition;
const nsStyleSpacing* spacing;
rs->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
rs->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE_CELL==display->mDisplay)
{ // if it's a cell and the cell has a specified width, use it
// Compute and subtract out the insets (sum of border and padding) for the table
lastCellFrame = (nsTableCellFrame*)(rs->frame);
const nsStylePosition* cellPosition;
lastCellFrame->GetStyleData(eStyleStruct_Position, ((nsStyleStruct *&)cellPosition));
lastCellFrame->GetStyleData(eStyleStruct_Position, ((const nsStyleStruct *&)cellPosition));
if (eStyleUnit_Coord == cellPosition->mWidth.GetUnit())
{
nsTableFrame *tableParent;
@ -3748,14 +3748,14 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowSta
}
else
{
rs->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
rs->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE==display->mDisplay)
{
// we only want to do this for inner table frames, so check the frame's parent to make sure it is an outer table frame
// we know that if both the frame and it's parent map to NS_STYLE_DISPLAY_TABLE, then we have an inner table frame
nsIFrame * tableFrameParent;
rs->frame->GetGeometricParent(tableFrameParent);
tableFrameParent->GetStyleData(eStyleStruct_Display, (nsStyleStruct *&)display);
tableFrameParent->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE==display->mDisplay)
{
/* We found the nearest containing table (actually, the inner table).
@ -3953,8 +3953,8 @@ void nsTableFrame::SetMaxElementSize(nsSize* aMaxElementSize)
PRBool nsTableFrame::RequiresPass1Layout()
{
nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
return (PRBool)(NS_STYLE_TABLE_LAYOUT_FIXED!=tableStyle->mLayoutStrategy);
}

Просмотреть файл

@ -73,7 +73,7 @@ public:
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
/** helper method for determining if this is a nested table or not */
PRBool IsNested(const nsHTMLReflowState& aReflowState, nsStylePosition *& aPosition) const;
PRBool IsNested(const nsHTMLReflowState& aReflowState, const nsStylePosition *& aPosition) const;
/** helper method to find the table parent of any table frame object */
static NS_METHOD GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aTableFrame);

Просмотреть файл

@ -170,7 +170,7 @@ nsresult nsTableOuterFrame::RecoverState(OuterTableReflowState& aReflowState,
// Get the previous frame's bottom margin
const nsStyleSpacing* kidSpacing;
prevKidFrame->GetStyleData(eStyleStruct_Spacing, (nsStyleStruct *&)kidSpacing);
prevKidFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)kidSpacing);
nsMargin margin;
kidSpacing->CalcMarginFor(prevKidFrame, margin);
if (margin.bottom < 0) {
@ -238,7 +238,7 @@ nsresult nsTableOuterFrame::AdjustSiblingsAfterReflow(nsIPresContext& aPr
// Get the bottom margin for the last child frame
const nsStyleSpacing* kidSpacing;
lastKidFrame->GetStyleData(eStyleStruct_Spacing, (nsStyleStruct *&)kidSpacing);
lastKidFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)kidSpacing);
nsMargin margin;
kidSpacing->CalcMarginFor(lastKidFrame, margin);
if (margin.bottom < 0) {
@ -335,7 +335,7 @@ nsresult nsTableOuterFrame::IR_TargetIsCaptionFrame(nsIPresContext& aPres
aReflowState.reflowState.reflowCommand->GetType(reflowCommandType);
const nsStyleText* priorCaptionTextStyle=nsnull;
if (nsIReflowCommand::StyleChanged==reflowCommandType)
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)priorCaptionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)priorCaptionTextStyle));
if (PR_TRUE==gsDebugIR) printf("TOF IR: prior caption width=%d height=%d, minWidth=%d\n",
priorCaptionRect.width, priorCaptionRect.height,
mMinCaptionWidth);
@ -366,7 +366,7 @@ nsresult nsTableOuterFrame::IR_TargetIsCaptionFrame(nsIPresContext& aPres
if (nsIReflowCommand::StyleChanged==reflowCommandType)
{
const nsStyleText* captionTextStyle;
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)captionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)captionTextStyle));
if (PR_TRUE==IR_CaptionChangedAxis(priorCaptionTextStyle, captionTextStyle))
innerTableNeedsReflow=PR_TRUE;
}
@ -438,7 +438,7 @@ nsresult nsTableOuterFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
case nsIReflowCommand::FrameInserted :
{
const nsStyleDisplay *childDisplay;
objectFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
objectFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_CAPTION == childDisplay->mDisplay)
{
rv = IR_CaptionInserted(aPresContext, aDesiredSize, aReflowState, aStatus,
@ -459,7 +459,7 @@ nsresult nsTableOuterFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
{
// verify that the new frame is a caption frame
const nsStyleDisplay *newFrameDisplay;
newFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)newFrameDisplay));
newFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)newFrameDisplay));
NS_ASSERTION(NS_STYLE_DISPLAY_TABLE_CAPTION == childDisplay->mDisplay, "bad new frame");
if (NS_STYLE_DISPLAY_TABLE_CAPTION == childDisplay->mDisplay)
{
@ -574,9 +574,9 @@ nsresult nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext& aPresCont
// XXX: should just call SizeAndPlaceChildren regardless
// find where to place the caption
const nsStyleSpacing* spacing;
mCaptionFrame->GetStyleData(eStyleStruct_Spacing, (nsStyleStruct *&)spacing);
mCaptionFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)spacing);
spacing->CalcMarginFor(mCaptionFrame, captionMargin);
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)captionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)captionTextStyle));
if ((priorInnerTableRect.height!=innerSize.height) || (PR_TRUE==captionDimChanged))
{
// Compute the caption's y-origin
@ -686,7 +686,7 @@ nsresult nsTableOuterFrame::IR_CaptionInserted(nsIPresContext& aPresConte
mMinCaptionWidth = maxElementSize.width;
// get the caption's alignment
const nsStyleText* captionTextStyle;
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)captionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)captionTextStyle));
if (PR_TRUE || // XXX: this is a hack because we don't support left|right captions yet
(captionTextStyle->mVerticalAlign.GetUnit()!=eStyleUnit_Enumerated) || // default is "top"
((captionTextStyle->mVerticalAlign.GetUnit()==eStyleUnit_Enumerated) &&
@ -742,7 +742,7 @@ nsresult nsTableOuterFrame::IR_CaptionRemoved(nsIPresContext& aPresContex
{
// get the caption's alignment
const nsStyleText* captionTextStyle;
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)captionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)captionTextStyle));
// if the caption's MES > table width, reflow the inner table minus the MES
nsHTMLReflowMetrics innerSize(aDesiredSize.maxElementSize);
nscoord oldMinCaptionWidth = mMinCaptionWidth;
@ -803,12 +803,12 @@ nsresult nsTableOuterFrame::SizeAndPlaceChildren(const nsSize & aInnerS
// find where to place the caption
nsMargin captionMargin;
const nsStyleSpacing* spacing;
mCaptionFrame->GetStyleData(eStyleStruct_Spacing, (nsStyleStruct *&)spacing);
mCaptionFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)spacing);
spacing->CalcMarginFor(mCaptionFrame, captionMargin);
// Compute the caption's y-origin
nscoord captionY = captionMargin.top;
const nsStyleText* captionTextStyle;
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)captionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)captionTextStyle));
if ((captionTextStyle->mVerticalAlign.GetUnit()==eStyleUnit_Enumerated) &&
(captionTextStyle->mVerticalAlign.GetIntValue()==NS_STYLE_VERTICAL_ALIGN_BOTTOM))
{
@ -1014,13 +1014,13 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext& aPresContext,
nsMargin captionMargin;
const nsStyleSpacing* spacing;
mCaptionFrame->GetStyleData(eStyleStruct_Spacing, (nsStyleStruct *&)spacing);
mCaptionFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)spacing);
spacing->CalcMarginFor(mCaptionFrame, captionMargin);
// Compute the caption's y-origin
nscoord captionY = captionMargin.top;
const nsStyleText* captionTextStyle;
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((nsStyleStruct *&)captionTextStyle));
mCaptionFrame->GetStyleData(eStyleStruct_Text, ((const nsStyleStruct *&)captionTextStyle));
if ((captionTextStyle->mVerticalAlign.GetUnit()==eStyleUnit_Enumerated) &&
(captionTextStyle->mVerticalAlign.GetIntValue()==NS_STYLE_VERTICAL_ALIGN_BOTTOM)) {
captionY += innerSize.height;

Просмотреть файл

@ -133,7 +133,7 @@ nsTableRowFrame::InitChildren(PRInt32 aRowIndex)
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; kidFrame->GetNextSibling(kidFrame))
{
const nsStyleDisplay *kidDisplay;
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
// what column does this cell belong to?
@ -189,7 +189,7 @@ nsTableRowFrame::DidResize(nsIPresContext& aPresContext,
while (nsnull != cellFrame)
{
const nsStyleDisplay *kidDisplay;
cellFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
cellFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
PRInt32 rowSpan = tableFrame->GetEffectiveRowSpan(mRowIndex, (nsTableCellFrame *)cellFrame);
@ -351,7 +351,7 @@ PRInt32 nsTableRowFrame::GetMaxColumns() const
while (nsnull!=cell)
{
const nsStyleDisplay *kidDisplay;
cell->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
cell->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
sum += ((nsTableCellFrame *)cell)->GetColSpan();
@ -371,7 +371,7 @@ void nsTableRowFrame::GetMinRowSpan(nsTableFrame *aTableFrame)
while (nsnull!=frame)
{
const nsStyleDisplay *kidDisplay;
frame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
frame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
PRInt32 rowSpan = aTableFrame->GetEffectiveRowSpan(mRowIndex, ((nsTableCellFrame *)frame));
@ -391,7 +391,7 @@ void nsTableRowFrame::FixMinCellHeight(nsTableFrame *aTableFrame)
while (nsnull!=frame)
{
const nsStyleDisplay *kidDisplay;
frame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
frame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
PRInt32 rowSpan = aTableFrame->GetEffectiveRowSpan(mRowIndex, ((nsTableCellFrame *)frame));
@ -504,12 +504,12 @@ NS_METHOD nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext,
// Reflow each of our existing cell frames
const nsStyleDisplay *rowDisplay;
GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)rowDisplay);
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)rowDisplay);
nsIFrame* kidFrame=GetFirstChildForDirection(rowDisplay->mDirection);
for (kidFrame; nsnull != kidFrame; )
{
const nsStyleDisplay *kidDisplay;
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
nsMargin kidMargin;
@ -710,8 +710,8 @@ nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext,
PRBool tableLayoutStrategy=NS_STYLE_TABLE_LAYOUT_AUTO;
nsTableFrame* table = aReflowState.tableFrame;
nsresult rv = NS_OK;
nsStyleTable* tableStyle;
table->GetStyleData(eStyleStruct_Table, (nsStyleStruct *&)tableStyle);
const nsStyleTable* tableStyle;
table->GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
tableLayoutStrategy = tableStyle->mLayoutStrategy;
nsIFrame* kidFrame;
@ -723,7 +723,7 @@ nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext,
for ( ; nsnull != kidFrame; kidFrame->GetNextSibling(kidFrame))
{
const nsStyleDisplay *kidDisplay;
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
// Get the child's margins
@ -739,7 +739,7 @@ nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext,
// get border padding values
nsMargin borderPadding;
const nsStyleSpacing* cellSpacing;
kidFrame->GetStyleData(eStyleStruct_Spacing , ((nsStyleStruct *&)cellSpacing));
kidFrame->GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)cellSpacing));
cellSpacing->CalcBorderPaddingFor(kidFrame, borderPadding);
// Because we're not splittable always allow the child to be as high as
@ -838,7 +838,7 @@ NS_METHOD nsTableRowFrame::RecoverState(nsIPresContext& aPresContext,
for (nsIFrame* frame = mFirstChild; nsnull != frame;)
{
const nsStyleDisplay *kidDisplay;
frame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)kidDisplay));
frame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay)
{
if (frame != aKidFrame) {
@ -951,7 +951,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
aReflowState.reflowState.reflowCommand->GetChildFrame(objectFrame);
const nsStyleDisplay *childDisplay=nsnull;
if (nsnull!=objectFrame)
objectFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
objectFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (PR_TRUE==gsDebugIR) printf("TRF IR: IncrementalReflow_TargetIsMe with type=%d\n", type);
switch (type)
{
@ -1116,7 +1116,7 @@ NS_METHOD nsTableRowFrame::IR_CellAppended(nsIPresContext& aPresContext,
{
// remember the last child that is really a cell
const nsStyleDisplay *childDisplay;
nextChild->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
nextChild->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == childDisplay->mDisplay)
lastRow = nextChild;
lastChild = nextChild;
@ -1199,7 +1199,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext& aPresContext,
nsresult rv;
const nsStyleDisplay *childDisplay;
aNextFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
aNextFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == childDisplay->mDisplay)
{
// Recover our reflow state

Просмотреть файл

@ -125,7 +125,7 @@ NS_METHOD nsTableRowGroupFrame::GetRowCount(PRInt32 &aCount)
if (nsnull==childFrame)
break;
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
aCount++;
childFrame->GetNextSibling(childFrame);
@ -143,7 +143,7 @@ NS_METHOD nsTableRowGroupFrame::GetMaxColumns(PRInt32 &aMaxColumns) const
if (nsnull==childFrame)
break;
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
{
PRInt32 colCount = ((nsTableRowFrame *)childFrame)->GetMaxColumns();
@ -244,7 +244,7 @@ nsTableRowGroupFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
while (nsnull != kid) {
kid->GetRect(kidRect);
const nsStyleDisplay *childDisplay;
kid->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
kid->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay) {
if (((nsTableRowFrame*)(kid))->Contains(aPoint)) {
tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y);
@ -625,7 +625,7 @@ void nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext& aPresContext,
while (nsnull != rowFrame)
{
const nsStyleDisplay *childDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
{
// get the height of the tallest cell in the row (excluding cells that span rows)
@ -675,7 +675,7 @@ void nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext& aPresContext,
while (nsnull != rowFrame)
{
const nsStyleDisplay *childDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
{
if (gsDebug) printf("TRGF CalcRowH: Step 2 for row %d (%p)...\n", rowIndex, rowFrame);
@ -685,7 +685,7 @@ void nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext& aPresContext,
while (nsnull != cellFrame)
{
const nsStyleDisplay *childDisplay;
cellFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
cellFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_CELL == childDisplay->mDisplay)
{
if (gsDebug) printf("TRGF CalcRowH: for cell %p...\n", cellFrame);
@ -782,7 +782,7 @@ void nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext& aPresContext,
while (nsnull != rowFrame)
{
const nsStyleDisplay *childDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
{
((nsTableRowFrame *)rowFrame)->DidResize(aPresContext, aReflowState);
@ -979,7 +979,7 @@ NS_METHOD nsTableRowGroupFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
aReflowState.reflowState.reflowCommand->GetChildFrame(objectFrame);
const nsStyleDisplay *childDisplay=nsnull;
if (nsnull!=objectFrame)
objectFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
objectFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (PR_TRUE==gsDebugIR) printf("TRGF IR: TargetIsMe with type=%d\n", type);
switch (type)
{
@ -1104,7 +1104,7 @@ PRBool nsTableRowGroupFrame::NoRowsFollow()
while (nsnull!=nextSib)
{
const nsStyleDisplay *sibDisplay;
nextSib->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)sibDisplay));
nextSib->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)sibDisplay));
if ((NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == sibDisplay->mDisplay) ||
(NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == sibDisplay->mDisplay) ||
(NS_STYLE_DISPLAY_TABLE_ROW_GROUP == sibDisplay->mDisplay))
@ -1114,7 +1114,7 @@ PRBool nsTableRowGroupFrame::NoRowsFollow()
while (nsnull!=childFrame)
{
const nsStyleDisplay *childDisplay;
childFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
childFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
{ // found a row
result = PR_FALSE;