nsCOMPtr<nsIViewManager> viewManager;  rv = presShell->GetViewManager(getter_AddRefs(viewManager));  if (NS_FAILED(rv)) return rv;
nsIViewManager* viewManager = presShell->GetViewManager();
nsTypedSelection::GetRootScrollableView(nsIScrollableView **aScrollableView){  //  // NOTE: This method returns a NON-AddRef'd pointer  //       to the scrollable view!  //  NS_ENSURE_ARG_POINTER(aScrollableView);  if (!mFrameSelection)    return NS_ERROR_FAILURE;//nothing to do  nsresult rv;  nsIScrollableView *scrollView;  rv = mFrameSelection->GetScrollableView(&scrollView);  if ( NS_FAILED(rv))    return rv;  if (!scrollView)  {    nsCOMPtr<nsIPresShell> presShell;    rv = GetPresShell(getter_AddRefs(presShell));    if (NS_FAILED(rv))      return rv;    if (!presShell)      return NS_ERROR_NULL_POINTER;    nsCOMPtr<nsIViewManager> viewManager;    rv = presShell->GetViewManager(getter_AddRefs(viewManager));    if (NS_FAILED(rv))      return rv;    if (!viewManager)      return NS_ERROR_NULL_POINTER;    //    // nsIViewManager::GetRootScrollableView() does not    // AddRef the pointer it returns.    //    return viewManager->GetRootScrollableView(aScrollableView);  }  else //SCROLLVIEW_FROM_FRAME  {    *aScrollableView = scrollView;  }  return rv;}