nsCOMPtr<nsIPresShell> presShell; presShell = do_QueryInterface(selCon);
nsCOMPtr<nsIPresShell> presShell = do_QueryInterface(selCon);
GetPresContextFromEditor(nsIEditor *aEditor, nsIPresContext **aResult){  NS_ENSURE_ARG_POINTER(aResult);  *aResult = nsnull;  NS_ENSURE_ARG_POINTER(aEditor);  nsCOMPtr<nsISelectionController> selCon;  nsresult rv = aEditor->GetSelectionController(getter_AddRefs(selCon));  if (NS_FAILED(rv)) return rv;  if (!selCon) return NS_ERROR_FAILURE;  nsCOMPtr<nsIPresShell> presShell;  presShell = do_QueryInterface(selCon);  if (!presShell) return NS_ERROR_FAILURE;  nsCOMPtr<nsIPresContext> presContext;  rv = presShell->GetPresContext(getter_AddRefs(presContext));  if (NS_FAILED(rv)) return rv;  *aResult = presContext;  NS_IF_ADDREF(*aResult);  return NS_OK;}