Eliminated a bunch of code now that CreateViewForFrame() takes care of calling

SetScrolledView()
This commit is contained in:
troy%netscape.com 1998-12-18 05:26:16 +00:00
Родитель 7e29c81e53
Коммит c5204005c1
1 изменённых файлов: 3 добавлений и 35 удалений

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

@ -98,44 +98,13 @@ nsScrollFrame::SetInitialChildList(nsIPresContext& aPresContext,
nsresult rv = nsHTMLContainerFrame::SetInitialChildList(aPresContext, aListName, nsresult rv = nsHTMLContainerFrame::SetInitialChildList(aPresContext, aListName,
aChildList); aChildList);
// Get our view #ifdef NS_DEBUG
nsIView* myView; // Verify that the scrolled frame has a view
nsIViewManager* viewManager;
GetView(myView);
NS_ASSERTION(nsnull != myView, "no view");
myView->GetViewManager(viewManager);
// Get the scrolled frame's view. Note that it must already have a view
nsIView* scrolledView; nsIView* scrolledView;
mFirstChild->GetView(scrolledView); mFirstChild->GetView(scrolledView);
NS_ASSERTION(nsnull != scrolledView, "no view"); NS_ASSERTION(nsnull != scrolledView, "no view");
#endif
// If the scrolled view is currently inserted in the view hierarchy then
// remove it. We'll add it to the scrolling view below
nsIView* parentView;
scrolledView->GetParent(parentView);
if (nsnull != parentView) {
viewManager->RemoveChild(parentView, scrolledView);
}
// Set it as the scrolling view's scrolled view
nsIScrollableView* scrollingView;
myView->QueryInterface(kScrollViewIID, (void**)&scrollingView);
scrollingView->SetScrolledView(scrolledView);
// Get the color style info
const nsStyleColor* color;
mFirstChild->GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&)color);
// If the background is transparent then inform the view manager
if (NS_STYLE_BG_COLOR_TRANSPARENT & color->mBackgroundFlags) {
viewManager->SetViewContentTransparency(scrolledView, PR_TRUE);
}
// Set the opacity
viewManager->SetViewOpacity(scrolledView, color->mOpacity);
// We need to allow the view's position to be different than the // We need to allow the view's position to be different than the
// frame's position // frame's position
@ -144,7 +113,6 @@ nsScrollFrame::SetInitialChildList(nsIPresContext& aPresContext,
state &= ~NS_FRAME_SYNC_FRAME_AND_VIEW; state &= ~NS_FRAME_SYNC_FRAME_AND_VIEW;
mFirstChild->SetFrameState(state); mFirstChild->SetFrameState(state);
NS_RELEASE(viewManager);
return rv; return rv;
} }