nsresult result = mDocViewer->GetPresShell(*getter_AddRefs(shell));
nsresult result = mDocViewer->GetPresShell(getter_AddRefs(shell));
nsDocViewerFocusListener::Focus(nsIDOMEvent* aEvent){  nsCOMPtr<nsIPresShell> shell;  if(!mDocViewer)    return NS_ERROR_FAILURE;  nsresult result = mDocViewer->GetPresShell(*getter_AddRefs(shell));//deref once cause it take a ptr ref  if(NS_FAILED(result) || !shell)    return result?result:NS_ERROR_FAILURE;  nsCOMPtr<nsISelectionController> selCon;  selCon = do_QueryInterface(shell);  PRInt16 selectionStatus;  selCon->GetDisplaySelection( &selectionStatus);  //if selection was nsISelectionController::SELECTION_OFF, do nothing  //otherwise re-enable it.  if(selectionStatus == nsISelectionController::SELECTION_DISABLED ||     selectionStatus == nsISelectionController::SELECTION_HIDDEN)  {    selCon->SetDisplaySelection(nsISelectionController::SELECTION_ON);    selCon->RepaintSelection(nsISelectionController::SELECTION_NORMAL);  }  return result;}