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

git-svn-id: svn://10.0.0.236/trunk@143960 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org
2003-06-19 23:44:01 +00:00
parent 10062c06df
commit 519cf3b3d3
102 changed files with 698 additions and 1530 deletions

View File

@@ -657,8 +657,7 @@ nsMenuFrame::ActivateMenu(PRBool aActivateFlag)
if (aActivateFlag) {
nsRect rect;
menuPopup->GetRect(rect);
nsIView* view = nsnull;
menuPopup->GetView(mPresContext, &view);
nsIView* view = menuPopup->GetView(mPresContext);
nsCOMPtr<nsIViewManager> viewManager;
view->GetViewManager(*getter_AddRefs(viewManager));
rect.x = rect.y = 0;
@@ -679,8 +678,7 @@ nsMenuFrame::ActivateMenu(PRBool aActivateFlag)
viewManager->SetViewVisibility(view, nsViewVisibility_kShow);
} else {
nsIView* view = nsnull;
menuPopup->GetView(mPresContext, &view);
nsIView* view = menuPopup->GetView(mPresContext);
NS_ASSERTION(view, "View is gone, looks like someone forgot to rollup the popup!");
if (view) {
nsCOMPtr<nsIViewManager> viewManager;
@@ -840,8 +838,7 @@ nsMenuFrame::OpenMenuInternal(PRBool aActivateFlag)
menuPopup->SetBounds(state, nsRect(0,0,mLastPref.width, mLastPref.height));
nsIView* view = nsnull;
menuPopup->GetView(mPresContext, &view);
nsIView* view = menuPopup->GetView(mPresContext);
nsCOMPtr<nsIViewManager> vm;
view->GetViewManager(*getter_AddRefs(vm));
if (vm) {
@@ -1075,8 +1072,7 @@ nsMenuFrame::DoLayout(nsBoxLayoutState& aState)
// Only size the popups view if open.
if (mMenuOpen) {
nsIView* view = nsnull;
popupChild->GetView(aState.GetPresContext(), &view);
nsIView* view = popupChild->GetView(aState.GetPresContext());
nsCOMPtr<nsIViewManager> viewManager;
view->GetViewManager(*getter_AddRefs(viewManager));
nsRect r(0, 0, bounds.width, bounds.height);