bug 17375 - better checks and casting before calling DidAppendRow

This commit is contained in:
karnaze%netscape.com 1999-10-29 20:25:13 +00:00
Родитель 7e00eb0f7d
Коммит fb5f1b2e3b
2 изменённых файлов: 58 добавлений и 48 удалений

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

@ -1158,18 +1158,23 @@ nsTableRowGroupFrame::AppendFrames(nsIPresContext& aPresContext,
// Append the frames
mFrames.AppendFrames(nsnull, aFrameList);
// See if the newly appended rows are the last rows in the table. Don't
// do this for appended row group frames. We probably should, but DidAppendRow()
// doesn't handle row group frames
const nsStyleDisplay *display;
aFrameList->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)display));
if ((NS_STYLE_DISPLAY_TABLE_ROW == display->mDisplay) && NoRowsFollow()) {
// See if the newly appended rows are the last rows in the table.
// XXX is this the correct code path for nested row groups, considering that whitespace frames may exist currently
if ((NS_STYLE_DISPLAY_TABLE_ROW_GROUP != display->mDisplay) && NoRowsFollow()) {
// The rows we appended are the last rows in the table so incrementally
// add them to the cell map
PRBool haveRows = PR_FALSE;
for (nsIFrame* rowFrame = aFrameList; rowFrame; rowFrame->GetNextSibling(&rowFrame)) {
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)display));
if (NS_STYLE_DISPLAY_TABLE_ROW == display->mDisplay) {
DidAppendRow((nsTableRowFrame*)rowFrame);
haveRows = PR_TRUE;
}
}
if (haveRows) {
// See if any implicit column frames need to be created as a result of
// adding the new rows
PRBool createdColFrames;
@ -1189,7 +1194,7 @@ nsTableRowGroupFrame::AppendFrames(nsIPresContext& aPresContext,
aPresShell.AppendReflowCommand(reflowCmd);
NS_RELEASE(reflowCmd);
}
}
} else {
// We need to rebuild the cell map, because currently we can't insert
// new frames except at the end (append)

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

@ -1158,18 +1158,23 @@ nsTableRowGroupFrame::AppendFrames(nsIPresContext& aPresContext,
// Append the frames
mFrames.AppendFrames(nsnull, aFrameList);
// See if the newly appended rows are the last rows in the table. Don't
// do this for appended row group frames. We probably should, but DidAppendRow()
// doesn't handle row group frames
const nsStyleDisplay *display;
aFrameList->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)display));
if ((NS_STYLE_DISPLAY_TABLE_ROW == display->mDisplay) && NoRowsFollow()) {
// See if the newly appended rows are the last rows in the table.
// XXX is this the correct code path for nested row groups, considering that whitespace frames may exist currently
if ((NS_STYLE_DISPLAY_TABLE_ROW_GROUP != display->mDisplay) && NoRowsFollow()) {
// The rows we appended are the last rows in the table so incrementally
// add them to the cell map
PRBool haveRows = PR_FALSE;
for (nsIFrame* rowFrame = aFrameList; rowFrame; rowFrame->GetNextSibling(&rowFrame)) {
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)display));
if (NS_STYLE_DISPLAY_TABLE_ROW == display->mDisplay) {
DidAppendRow((nsTableRowFrame*)rowFrame);
haveRows = PR_TRUE;
}
}
if (haveRows) {
// See if any implicit column frames need to be created as a result of
// adding the new rows
PRBool createdColFrames;
@ -1189,7 +1194,7 @@ nsTableRowGroupFrame::AppendFrames(nsIPresContext& aPresContext,
aPresShell.AppendReflowCommand(reflowCmd);
NS_RELEASE(reflowCmd);
}
}
} else {
// We need to rebuild the cell map, because currently we can't insert
// new frames except at the end (append)