nsSetDocumentStateCommand::GetCommandStateParams(const char *aCommandName, nsICommandParams *aParams, nsISupports *refCon)
nsSetDocumentOptionsCommand::GetCommandStateParams(const char *aCommandName, nsICommandParams *aParams, nsISupports *refCon)
nsSetDocumentStateCommand::GetCommandStateParams(const char *aCommandName,                                                 nsICommandParams *aParams,                                                 nsISupports *refCon){  NS_ENSURE_ARG_POINTER(aParams);  NS_ENSURE_ARG_POINTER(refCon);  // The base editor owns most state info  nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);  if (!editor)     return NS_ERROR_INVALID_ARG;  // Always get the enabled state  PRBool outCmdEnabled = PR_FALSE;  IsCommandEnabled(aCommandName, refCon, &outCmdEnabled);  nsresult rv = aParams->SetBooleanValue(STATE_ENABLED, outCmdEnabled);  NS_ENSURE_SUCCESS(rv, rv);  if (!nsCRT::strcmp(aCommandName, "cmd_setDocumentModified"))  {    PRBool modified;    rv = editor->GetDocumentModified(&modified);    NS_ENSURE_SUCCESS(rv, rv);    return aParams->SetBooleanValue(STATE_ATTRIBUTE, modified);  }  else if (!nsCRT::strcmp(aCommandName, "cmd_setDocumentReadOnly"))  {    NS_ENSURE_ARG_POINTER(aParams);    PRUint32 flags;    editor->GetFlags(&flags);    PRBool isReadOnly = flags & nsIPlaintextEditor::eEditorReadonlyMask;    return aParams->SetBooleanValue(STATE_ATTRIBUTE, isReadOnly);  }  else if (!nsCRT::strcmp(aCommandName, "cmd_setDocumentUseCSS"))  {    NS_ENSURE_ARG_POINTER(aParams);    nsCOMPtr<nsIHTMLEditor> htmleditor = do_QueryInterface(refCon);    if (!htmleditor)      return NS_ERROR_INVALID_ARG;    PRBool isCSS;    htmleditor->GetIsCSSEnabled(&isCSS);    return aParams->SetBooleanValue(STATE_ATTRIBUTE, isCSS);  }  return NS_ERROR_NOT_IMPLEMENTED;}