Fixed SetInitialChildList() so "frame" doesn't get reset after processing

the legend frame
This commit is contained in:
troy%netscape.com 1998-11-18 22:14:55 +00:00
Родитель 99eee28edb
Коммит 60863f9b77
2 изменённых файлов: 6 добавлений и 2 удалений

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

@ -143,7 +143,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
// Set the geometric and content parent for each of the child frames. // Set the geometric and content parent for each of the child frames.
// The legend is handled differently and removed from aChildList // The legend is handled differently and removed from aChildList
nsIFrame* lastFrame = nsnull; nsIFrame* lastFrame = nsnull;
for (nsIFrame* frame = aChildList; nsnull != frame; frame->GetNextSibling(frame)) { for (nsIFrame* frame = aChildList; nsnull != frame;) {
nsIFrame* legendFrame = nsnull; nsIFrame* legendFrame = nsnull;
nsresult result = frame->QueryInterface(kLegendFrameCID, (void**)&legendFrame); nsresult result = frame->QueryInterface(kLegendFrameCID, (void**)&legendFrame);
if ((NS_OK == result) && legendFrame) { if ((NS_OK == result) && legendFrame) {
@ -159,9 +159,11 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
mFirstChild->SetNextSibling(frame); mFirstChild->SetNextSibling(frame);
mLegendFrame = frame; mLegendFrame = frame;
mLegendFrame->SetNextSibling(nsnull); mLegendFrame->SetNextSibling(nsnull);
frame = nextFrame;
} else { } else {
frame->SetGeometricParent(mFirstChild); frame->SetGeometricParent(mFirstChild);
frame->SetContentParent(mFirstChild); frame->SetContentParent(mFirstChild);
frame->GetNextSibling(frame);
} }
lastFrame = frame; lastFrame = frame;
} }

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

@ -143,7 +143,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
// Set the geometric and content parent for each of the child frames. // Set the geometric and content parent for each of the child frames.
// The legend is handled differently and removed from aChildList // The legend is handled differently and removed from aChildList
nsIFrame* lastFrame = nsnull; nsIFrame* lastFrame = nsnull;
for (nsIFrame* frame = aChildList; nsnull != frame; frame->GetNextSibling(frame)) { for (nsIFrame* frame = aChildList; nsnull != frame;) {
nsIFrame* legendFrame = nsnull; nsIFrame* legendFrame = nsnull;
nsresult result = frame->QueryInterface(kLegendFrameCID, (void**)&legendFrame); nsresult result = frame->QueryInterface(kLegendFrameCID, (void**)&legendFrame);
if ((NS_OK == result) && legendFrame) { if ((NS_OK == result) && legendFrame) {
@ -159,9 +159,11 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
mFirstChild->SetNextSibling(frame); mFirstChild->SetNextSibling(frame);
mLegendFrame = frame; mLegendFrame = frame;
mLegendFrame->SetNextSibling(nsnull); mLegendFrame->SetNextSibling(nsnull);
frame = nextFrame;
} else { } else {
frame->SetGeometricParent(mFirstChild); frame->SetGeometricParent(mFirstChild);
frame->SetContentParent(mFirstChild); frame->SetContentParent(mFirstChild);
frame->GetNextSibling(frame);
} }
lastFrame = frame; lastFrame = frame;
} }