DeCOMtaminate nsIFrame::GetView and SetView, and add HasView, GetClosestView, and AreAncestorViewsVisible to consolidate common patterns. b=208004 r+sr=roc

This commit is contained in:
dbaron@dbaron.org
2003-06-19 23:44:01 +00:00
parent c522df5af2
commit 384f320c3a
102 changed files with 698 additions and 1530 deletions

View File

@@ -268,19 +268,17 @@ nsImageControlFrame::Init(nsIPresContext* aPresContext,
aContext, aPrevInFlow);
// create our view, we need a view to grab the mouse
nsIView* view;
GetView(aPresContext, &view);
if (!view) {
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, NS_GET_IID(nsIView), (void **)&view);
if (!HasView()) {
nsIView* view;
nsresult result = CallCreateInstance(kViewCID, &view);
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
nsCOMPtr<nsIViewManager> viewMan;
presShell->GetViewManager(getter_AddRefs(viewMan));
nsIFrame* parWithView;
nsIView *parView;
GetParentWithView(aPresContext, &parWithView);
parWithView->GetView(aPresContext, &parView);
nsIView *parView = parWithView->GetView(aPresContext);
// the view's size is not know yet, but its size will be kept in synch with our frame.
nsRect boundBox(0, 0, 0, 0);
result = view->Init(viewMan, boundBox, parView);