if (!nsCRT::strcmp(aCommandName, sSelectCharPreviousString)) rv = selCont->CharacterMove(PR_FALSE, PR_TRUE); else if (!nsCRT::strcmp(aCommandName, sSelectCharNextString)) rv = selCont->CharacterMove(PR_TRUE, PR_TRUE); else if (!nsCRT::strcmp(aCommandName, sWordPreviousString)) rv = selCont->WordMove(PR_FALSE, PR_FALSE); else if (!nsCRT::strcmp(aCommandName, sWordNextString)) rv = selCont->WordMove(PR_TRUE, PR_FALSE); else if (!nsCRT::strcmp(aCommandName, sSelectWordPreviousString)) rv = selCont->WordMove(PR_FALSE, PR_TRUE); else if (!nsCRT::strcmp(aCommandName, sSelectWordNextString)) rv = selCont->WordMove(PR_TRUE, PR_TRUE); else if (!nsCRT::strcmp(aCommandName, sBeginLineString)) rv = selCont->IntraLineMove(PR_FALSE, PR_FALSE); else if (!nsCRT::strcmp(aCommandName, sEndLineString)) rv = selCont->IntraLineMove(PR_TRUE, PR_FALSE); else if (!nsCRT::strcmp(aCommandName, sSelectBeginLineString)) rv = selCont->IntraLineMove(PR_FALSE, PR_TRUE); else if (!nsCRT::strcmp(aCommandName, sSelectEndLineString)) rv = selCont->IntraLineMove(PR_TRUE, PR_TRUE); else if (!nsCRT::strcmp(aCommandName, sSelectLinePreviousString)) rv = selCont->LineMove(PR_FALSE, PR_TRUE); else if (!nsCRT::strcmp(aCommandName, sSelectLineNextString)) rv = selCont->LineMove(PR_TRUE, PR_TRUE); else if (!nsCRT::strcmp(aCommandName, sSelectMoveTopString)) rv = selCont->CompleteMove(PR_FALSE, PR_TRUE); else if (!nsCRT::strcmp(aCommandName, sSelectMoveBottomString)) rv = selCont->CompleteMove(PR_TRUE, PR_TRUE);
nsCOMPtr<nsIEventStateManager> esm; GetEventStateManagerForWindow(aWindow, getter_AddRefs(esm)); if (esm) esm->GetBrowseWithCaret(&doBrowseWithCaret);  nsresult rv; if (doBrowseWithCaret) rv = DoCommandBrowseWithCaretOn(aCommandName, selCont, esm); else rv = DoCommandBrowseWithCaretOff(aCommandName, selCont);
nsSelectCommand::DoSelectCommand(const char *aCommandName, nsIDOMWindow *aWindow){  nsCOMPtr<nsISelectionController> selCont;  GetSelectionControllerFromWindow(aWindow, getter_AddRefs(selCont));  NS_ENSURE_TRUE(selCont, NS_ERROR_NOT_INITIALIZED);         nsresult rv = NS_ERROR_NOT_IMPLEMENTED;  // These commands are so the browser can use caret navigation key bindings -  // Helps with accessibility - aaronl@netscape.com  if (!nsCRT::strcmp(aCommandName, sSelectCharPreviousString))    rv = selCont->CharacterMove(PR_FALSE, PR_TRUE);  else if (!nsCRT::strcmp(aCommandName, sSelectCharNextString))    rv = selCont->CharacterMove(PR_TRUE, PR_TRUE);  else if (!nsCRT::strcmp(aCommandName, sWordPreviousString))    rv = selCont->WordMove(PR_FALSE, PR_FALSE);  else if (!nsCRT::strcmp(aCommandName, sWordNextString))    rv = selCont->WordMove(PR_TRUE, PR_FALSE);  else if (!nsCRT::strcmp(aCommandName, sSelectWordPreviousString))    rv = selCont->WordMove(PR_FALSE, PR_TRUE);  else if (!nsCRT::strcmp(aCommandName, sSelectWordNextString))    rv = selCont->WordMove(PR_TRUE, PR_TRUE);  else if (!nsCRT::strcmp(aCommandName, sBeginLineString))    rv = selCont->IntraLineMove(PR_FALSE, PR_FALSE);  else if (!nsCRT::strcmp(aCommandName, sEndLineString))    rv = selCont->IntraLineMove(PR_TRUE, PR_FALSE);  else if (!nsCRT::strcmp(aCommandName, sSelectBeginLineString))    rv = selCont->IntraLineMove(PR_FALSE, PR_TRUE);  else if (!nsCRT::strcmp(aCommandName, sSelectEndLineString))    rv = selCont->IntraLineMove(PR_TRUE, PR_TRUE);  else if (!nsCRT::strcmp(aCommandName, sSelectLinePreviousString))    rv = selCont->LineMove(PR_FALSE, PR_TRUE);  else if (!nsCRT::strcmp(aCommandName, sSelectLineNextString))    rv = selCont->LineMove(PR_TRUE, PR_TRUE);  else if (!nsCRT::strcmp(aCommandName, sSelectMoveTopString))    rv = selCont->CompleteMove(PR_FALSE, PR_TRUE);  else if (!nsCRT::strcmp(aCommandName, sSelectMoveBottomString))    rv = selCont->CompleteMove(PR_TRUE, PR_TRUE);  return rv;}