Example #1
0
NS_IMETHODIMP
SelectAllCommand::DoCommand(const char* aCommandName,
                            nsISupports* aCommandRefCon) {
  nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
  if (!editor) {
    return NS_ERROR_FAILURE;
  }
  TextEditor* textEditor = editor->AsTextEditor();
  MOZ_ASSERT(textEditor);
  return textEditor->SelectAll();
}