remove save and saveas commands (now in JS); submitted by rcassin@supernova.org (bug #16359)
git-svn-id: svn://10.0.0.236/trunk@75051 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ryan Cassin (rcassin@supernova.org)
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -245,71 +246,6 @@ nsPrintingCommands::DoCommand(const PRUnichar *aCommand, nsISupports * refCon)
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef XP_MAC
|
||||
#pragma mark -
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSaveCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCon, PRBool *outCmdEnabled)
|
||||
{
|
||||
nsCOMPtr<nsIEditorShell> editorShell = do_QueryInterface(refCon);
|
||||
*outCmdEnabled = PR_FALSE;
|
||||
if (editorShell)
|
||||
{
|
||||
PRBool docModified;
|
||||
if (NS_SUCCEEDED(editorShell->GetDocumentModified(&docModified)))
|
||||
*outCmdEnabled = docModified;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSaveCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon)
|
||||
{
|
||||
nsCOMPtr<nsIEditorShell> editorShell = do_QueryInterface(refCon);
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (editorShell)
|
||||
{
|
||||
editorShell->FinishHTMLSource();
|
||||
PRBool wasSaved;
|
||||
rv = editorShell->SaveDocument(PR_FALSE, PR_FALSE, &wasSaved);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef XP_MAC
|
||||
#pragma mark -
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSaveAsCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCon, PRBool *outCmdEnabled)
|
||||
{
|
||||
nsCOMPtr<nsIEditorShell> editorShell = do_QueryInterface(refCon);
|
||||
*outCmdEnabled = (editorShell.get() != nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSaveAsCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon)
|
||||
{
|
||||
nsCOMPtr<nsIEditorShell> editorShell = do_QueryInterface(refCon);
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
if (editorShell)
|
||||
{
|
||||
editorShell->FinishHTMLSource();
|
||||
PRBool wasSaved;
|
||||
rv = editorShell->SaveDocument(PR_TRUE, PR_FALSE, &wasSaved);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
#ifdef XP_MAC
|
||||
#pragma mark -
|
||||
#endif
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ryan Cassin (rcassin@supernova.org)
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -210,11 +211,6 @@ NS_DECL_COMPOSER_COMMAND(nsPrintingCommands)
|
||||
NS_DECL_COMPOSER_COMMAND(nsNewCommands) // handles 'new' anything
|
||||
|
||||
|
||||
NS_DECL_COMPOSER_COMMAND(nsSaveCommand)
|
||||
NS_DECL_COMPOSER_COMMAND(nsSaveAsCommand)
|
||||
|
||||
|
||||
|
||||
// Edit menu
|
||||
NS_DECL_COMPOSER_COMMAND(nsPasteQuotationCommand)
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ryan Cassin (rcassin@supernova.org)
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -245,71 +246,6 @@ nsPrintingCommands::DoCommand(const PRUnichar *aCommand, nsISupports * refCon)
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef XP_MAC
|
||||
#pragma mark -
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSaveCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCon, PRBool *outCmdEnabled)
|
||||
{
|
||||
nsCOMPtr<nsIEditorShell> editorShell = do_QueryInterface(refCon);
|
||||
*outCmdEnabled = PR_FALSE;
|
||||
if (editorShell)
|
||||
{
|
||||
PRBool docModified;
|
||||
if (NS_SUCCEEDED(editorShell->GetDocumentModified(&docModified)))
|
||||
*outCmdEnabled = docModified;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSaveCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon)
|
||||
{
|
||||
nsCOMPtr<nsIEditorShell> editorShell = do_QueryInterface(refCon);
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (editorShell)
|
||||
{
|
||||
editorShell->FinishHTMLSource();
|
||||
PRBool wasSaved;
|
||||
rv = editorShell->SaveDocument(PR_FALSE, PR_FALSE, &wasSaved);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef XP_MAC
|
||||
#pragma mark -
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSaveAsCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCon, PRBool *outCmdEnabled)
|
||||
{
|
||||
nsCOMPtr<nsIEditorShell> editorShell = do_QueryInterface(refCon);
|
||||
*outCmdEnabled = (editorShell.get() != nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSaveAsCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon)
|
||||
{
|
||||
nsCOMPtr<nsIEditorShell> editorShell = do_QueryInterface(refCon);
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
if (editorShell)
|
||||
{
|
||||
editorShell->FinishHTMLSource();
|
||||
PRBool wasSaved;
|
||||
rv = editorShell->SaveDocument(PR_TRUE, PR_FALSE, &wasSaved);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
#ifdef XP_MAC
|
||||
#pragma mark -
|
||||
#endif
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ryan Cassin (rcassin@supernova.org)
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -210,11 +211,6 @@ NS_DECL_COMPOSER_COMMAND(nsPrintingCommands)
|
||||
NS_DECL_COMPOSER_COMMAND(nsNewCommands) // handles 'new' anything
|
||||
|
||||
|
||||
NS_DECL_COMPOSER_COMMAND(nsSaveCommand)
|
||||
NS_DECL_COMPOSER_COMMAND(nsSaveAsCommand)
|
||||
|
||||
|
||||
|
||||
// Edit menu
|
||||
NS_DECL_COMPOSER_COMMAND(nsPasteQuotationCommand)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user