зеркало из https://github.com/mozilla/pjs.git
Use nsCRT::free() instead of delete[] for char* data.
This commit is contained in:
Родитель
67cdca3fac
Коммит
5f9f8618b6
|
@ -76,8 +76,8 @@ NS_IMETHODIMP DeleteElementTxn::Do(void)
|
|||
{
|
||||
if (gNoisy)
|
||||
printf(" DeleteElementTxn: deleting child %s from parent %s\n", c, p);
|
||||
delete [] c;
|
||||
delete [] p;
|
||||
nsCRT::free(c);
|
||||
nsCRT::free(p);
|
||||
}
|
||||
// end debug output
|
||||
#endif
|
||||
|
@ -115,8 +115,8 @@ NS_IMETHODIMP DeleteElementTxn::Undo(void)
|
|||
{
|
||||
if (gNoisy)
|
||||
printf(" DeleteElementTxn: inserting child %s back into parent %s\n", c, p);
|
||||
delete [] c;
|
||||
delete [] p;
|
||||
nsCRT::free(c);
|
||||
nsCRT::free(p);
|
||||
}
|
||||
// end debug output
|
||||
#endif
|
||||
|
|
|
@ -377,7 +377,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
|
|||
if (buf)
|
||||
{
|
||||
puts(buf);
|
||||
delete[] buf;
|
||||
nsCRT::free(buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -781,7 +781,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
|
|||
nsString *tag = styles.StringAt(i);
|
||||
char *tagCString = tag->ToNewCString();
|
||||
printf("%s ", tagCString);
|
||||
delete [] tagCString;
|
||||
nsCRT::free(tagCString);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
@ -1418,7 +1418,7 @@ nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent)
|
|||
dragSession->SetCanDrop(PR_TRUE);
|
||||
}
|
||||
|
||||
delete [] whichFlavor;
|
||||
nsCRT::free(whichFlavor);
|
||||
// XXX This is where image support might go
|
||||
//void * data;
|
||||
//trans->GetTransferData(mImageDataFlavor, (void **)&data, &len);
|
||||
|
|
|
@ -365,7 +365,7 @@ nsEditorShell::InstantiateEditor(nsIDOMDocument *aDoc, nsIPresShell *aPresShell)
|
|||
errorMsg += "\"\n";
|
||||
char *errorMsgCString = errorMsg.ToNewCString();
|
||||
NS_WARNING(errorMsgCString);
|
||||
delete [] errorMsgCString;
|
||||
nsCRT::free(errorMsgCString);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -869,7 +869,7 @@ nsEditorShell::SetWebShellWindow(nsIDOMWindow* aWin)
|
|||
|
||||
char* cstr = str.ToNewCString();
|
||||
printf("Attaching to WebShellWindow[%s]\n", cstr);
|
||||
delete[] cstr;
|
||||
nsCRT::free(cstr);
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIWebShellContainer> webShellContainer;
|
||||
|
@ -2906,7 +2906,7 @@ void nsEditorShell::SetButtonImage(nsIDOMNode * aParentNode, PRInt32 aBtnNum, co
|
|||
if (imgElement) {
|
||||
char * str = aResName.ToNewCString();
|
||||
imgElement->SetSrc(str);
|
||||
delete [] str;
|
||||
nsCRT::free(str);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2923,7 +2923,7 @@ nsEditorShell::ExecuteScript(nsIScriptContext * aContext, const nsString& aScrip
|
|||
#ifdef APP_DEBUG
|
||||
char* script_str = aScript.ToNewCString();
|
||||
printf("Executing [%s]\n", script_str);
|
||||
delete[] script_str;
|
||||
nsCRT::free(script_str);
|
||||
#endif
|
||||
|
||||
aContext->EvaluateString(aScript, url, 0, rVal, &isUndefined);
|
||||
|
|
|
@ -446,7 +446,7 @@ NS_IMETHODIMP nsHTMLEditor::SetInlineProperty(nsIAtom *aProperty,
|
|||
aProperty->ToString(propString);
|
||||
char *propCString = propString.ToNewCString();
|
||||
if (gNoisy) { printf("---------- start nsTextEditor::SetTextProperty %s ----------\n", propCString); }
|
||||
delete [] propCString;
|
||||
nsCRT::free(propCString);
|
||||
}
|
||||
|
||||
nsresult result=NS_ERROR_NOT_INITIALIZED;
|
||||
|
@ -563,7 +563,7 @@ NS_IMETHODIMP nsHTMLEditor::SetInlineProperty(nsIAtom *aProperty,
|
|||
aProperty->ToString(propString);
|
||||
char *propCString = propString.ToNewCString();
|
||||
if (gNoisy) { printf("---------- end nsTextEditor::SetTextProperty %s ----------\n", propCString); }
|
||||
delete [] propCString;
|
||||
nsCRT::free(propCString);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -582,7 +582,7 @@ NS_IMETHODIMP nsHTMLEditor::GetInlineProperty(nsIAtom *aProperty,
|
|||
aProperty->ToString(propString);
|
||||
char *propCString = propString.ToNewCString();
|
||||
if (gNoisy) { printf("nsTextEditor::GetTextProperty %s\n", propCString); }
|
||||
delete [] propCString;
|
||||
nsCRT::free(propCString);
|
||||
}
|
||||
*/
|
||||
nsresult result;
|
||||
|
@ -700,7 +700,7 @@ NS_IMETHODIMP nsHTMLEditor::RemoveInlineProperty(nsIAtom *aProperty, const nsStr
|
|||
aProperty->ToString(propString);
|
||||
char *propCString = propString.ToNewCString();
|
||||
if (gNoisy) { printf("---------- start nsTextEditor::RemoveInlineProperty %s ----------\n", propCString); }
|
||||
delete [] propCString;
|
||||
nsCRT::free(propCString);
|
||||
}
|
||||
|
||||
nsresult result;
|
||||
|
@ -806,7 +806,7 @@ NS_IMETHODIMP nsHTMLEditor::RemoveInlineProperty(nsIAtom *aProperty, const nsStr
|
|||
aProperty->ToString(propString);
|
||||
char *propCString = propString.ToNewCString();
|
||||
if (gNoisy) { printf("---------- end nsTextEditor::RemoveInlineProperty %s ----------\n", propCString); }
|
||||
delete [] propCString;
|
||||
nsCRT::free(propCString);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -1390,7 +1390,7 @@ nsHTMLEditor::AddBlockParent(nsString& aParentTag)
|
|||
{
|
||||
char *tag = aParentTag.ToNewCString();
|
||||
printf("---------- nsHTMLEditor::AddBlockParent %s ----------\n", tag);
|
||||
delete [] tag;
|
||||
nsCRT::free(tag);
|
||||
}
|
||||
|
||||
nsresult res=NS_ERROR_NOT_INITIALIZED;
|
||||
|
@ -1435,7 +1435,7 @@ nsHTMLEditor::ReplaceBlockParent(nsString& aParentTag)
|
|||
{
|
||||
char *tag = aParentTag.ToNewCString();
|
||||
printf("---------- nsHTMLEditor::ReplaceBlockParent %s ----------\n", tag);
|
||||
delete [] tag;
|
||||
nsCRT::free(tag);
|
||||
}
|
||||
|
||||
nsresult res=NS_ERROR_NOT_INITIALIZED;
|
||||
|
@ -2608,7 +2608,7 @@ NS_IMETHODIMP nsHTMLEditor::SetBodyWrapWidth(PRInt32 aWrapColumn)
|
|||
#ifdef DEBUG_akkana
|
||||
char* curstyle = styleValue.ToNewCString();
|
||||
printf("Setting style: [%s]\n", curstyle);
|
||||
delete[] curstyle;
|
||||
nsCRT::free(curstyle);
|
||||
#endif /* DEBUG_akkana */
|
||||
|
||||
return bodyElement->SetAttribute(styleName, styleValue);
|
||||
|
@ -2932,7 +2932,7 @@ NS_IMETHODIMP nsHTMLEditor::Paste()
|
|||
#ifdef DEBUG_akkana
|
||||
char* flav = flavor.ToNewCString();
|
||||
printf("Got flavor [%s]\n", flav);
|
||||
delete[] flav;
|
||||
nsCRT::free(flav);
|
||||
#endif
|
||||
if (flavor.Equals(kHTMLMime))
|
||||
{
|
||||
|
@ -2965,7 +2965,7 @@ NS_IMETHODIMP nsHTMLEditor::Paste()
|
|||
rv = NS_ERROR_NOT_IMPLEMENTED; // for now give error code
|
||||
}
|
||||
}
|
||||
delete [] bestFlavor;
|
||||
nsCRT::free(bestFlavor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2990,19 +2990,19 @@ NS_IMETHODIMP nsHTMLEditor::OutputToString(nsString& aOutputString,
|
|||
else
|
||||
{ // default processing
|
||||
nsCOMPtr<nsIDocumentEncoder> encoder;
|
||||
char* progid = new char[strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1];
|
||||
char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1);
|
||||
if (! progid)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
strcpy(progid, NS_DOC_ENCODER_PROGID_BASE);
|
||||
char* type = aFormatType.ToNewCString();
|
||||
strcat(progid, type);
|
||||
delete[] type;
|
||||
nsCRT::free(type);
|
||||
rv = nsComponentManager::CreateInstance(progid,
|
||||
nsnull,
|
||||
nsIDocumentEncoder::GetIID(),
|
||||
getter_AddRefs(encoder));
|
||||
|
||||
delete[] progid;
|
||||
nsCRT::free(progid);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
printf("Couldn't get progid %s\n", progid);
|
||||
|
@ -3058,20 +3058,20 @@ NS_IMETHODIMP nsHTMLEditor::OutputToStream(nsIOutputStream* aOutputStream,
|
|||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIDocumentEncoder> encoder;
|
||||
char* progid = new char[strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1];
|
||||
char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1);
|
||||
if (! progid)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
strcpy(progid, NS_DOC_ENCODER_PROGID_BASE);
|
||||
char* type = aFormatType.ToNewCString();
|
||||
strcat(progid, type);
|
||||
delete[] type;
|
||||
nsCRT::free(type);
|
||||
rv = nsComponentManager::CreateInstance(progid,
|
||||
nsnull,
|
||||
nsIDocumentEncoder::GetIID(),
|
||||
getter_AddRefs(encoder));
|
||||
|
||||
delete[] progid;
|
||||
nsCRT::free(progid);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
printf("Couldn't get progid %s\n", progid);
|
||||
|
@ -3594,7 +3594,7 @@ nsHTMLEditor::ReParentContentOfNode(nsIDOMNode *aNode,
|
|||
{
|
||||
char *tag = aParentTag.ToNewCString();
|
||||
printf("---------- ReParentContentOfNode(%p,%s,%d) -----------\n", aNode, tag, aTransformation);
|
||||
delete [] tag;
|
||||
nsCRT::free(tag);
|
||||
}
|
||||
// find the current block parent, or just use aNode if it is a block node
|
||||
nsCOMPtr<nsIDOMElement>blockParentElement;
|
||||
|
|
|
@ -1,124 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// THIS FILE IS CURRENTLY THOUGHT TO BE OBSOLETE.
|
||||
// KEEPING AROUND FOR A FEW DAYS JUST TO MAKE SURE;
|
||||
// BUT IT'S NO LONGER PART OF THE BUILD.
|
||||
|
||||
#include "nsIDOMDocumentFragment.h"
|
||||
#include "nsInsertHTMLTxn.h"
|
||||
#include "nsIDOMSelection.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDOMNSRange.h"
|
||||
|
||||
|
||||
nsInsertHTMLTxn::nsInsertHTMLTxn() : EditTxn(), mSrc("")
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsInsertHTMLTxn::Init(const nsString& aSrc, nsIEditor* aEditor)
|
||||
{
|
||||
if (!aEditor)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
mSrc = aSrc;
|
||||
mEditor = do_QueryInterface(aEditor);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsInsertHTMLTxn::~nsInsertHTMLTxn()
|
||||
{
|
||||
//NS_RELEASE(mStr); // do nsStrings have to be released?
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsInsertHTMLTxn::Do(void)
|
||||
{
|
||||
nsCOMPtr<nsIDOMSelection>selection;
|
||||
nsresult res = mEditor->GetSelection(getter_AddRefs(selection));
|
||||
if (NS_SUCCEEDED(res) && selection)
|
||||
{
|
||||
// Get the first range in the selection, and save it in mRange:
|
||||
res = selection->GetRangeAt(0, getter_AddRefs(mRange));
|
||||
if (NS_SUCCEEDED(res))
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSRange> nsrange (do_QueryInterface(mRange));
|
||||
if (nsrange)
|
||||
{
|
||||
#ifdef DEBUG_akkana
|
||||
char* str = mSrc.ToNewCString();
|
||||
printf("Calling nsInsertHTMLTxn::Do(%s)\n", str);
|
||||
delete[] str;
|
||||
#endif /* DEBUG_akkana */
|
||||
nsCOMPtr<nsIDOMDocumentFragment> docfrag;
|
||||
res = nsrange->CreateContextualFragment(mSrc, getter_AddRefs(docfrag));
|
||||
|
||||
// Now we have to insert that document fragment in an undoable way
|
||||
printf("Sorry, Insert HTML not fully written yet\n");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_akkana
|
||||
else printf("nsInsertHTMLTxn::Do: Couldn't get selection range!\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsInsertHTMLTxn::Undo(void)
|
||||
{
|
||||
#ifdef DEBUG_akkana
|
||||
printf("%p Undo Insert HTML\n", this);
|
||||
#endif /* DEBUG_akkana */
|
||||
|
||||
if (!mRange)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
return mRange->DeleteContents();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsInsertHTMLTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
|
||||
{
|
||||
if (nsnull != aDidMerge)
|
||||
*aDidMerge=PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsInsertHTMLTxn::Write(nsIOutputStream *aOutputStream)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsInsertHTMLTxn::GetUndoString(nsString *aString)
|
||||
{
|
||||
if (nsnull!=aString)
|
||||
{
|
||||
*aString="Remove HTML: ";
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsInsertHTMLTxn::GetRedoString(nsString *aString)
|
||||
{
|
||||
if (nsnull!=aString)
|
||||
{
|
||||
*aString="Insert HTML: ";
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
|
@ -629,7 +629,7 @@ nsTextEditRules::WillDeleteSelection(nsIDOMSelection *aSelection,
|
|||
#ifdef DEBUG_buster
|
||||
char *password = mPasswordText.ToNewCString();
|
||||
printf("mPasswordText is %s\n", password);
|
||||
delete [] password;
|
||||
nsCRT::free(password);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -989,7 +989,7 @@ nsTextEditRules::EchoInsertionToPWBuff(nsIDOMSelection *aSelection, nsString *aO
|
|||
#ifdef DEBUG_jfrancis
|
||||
char *password = mPasswordText.ToNewCString();
|
||||
printf("mPasswordText is %s\n", password);
|
||||
delete [] password;
|
||||
nsCRT::free(password);
|
||||
#endif
|
||||
|
||||
// change the output to '*' only
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -365,7 +365,7 @@ nsEditorShell::InstantiateEditor(nsIDOMDocument *aDoc, nsIPresShell *aPresShell)
|
|||
errorMsg += "\"\n";
|
||||
char *errorMsgCString = errorMsg.ToNewCString();
|
||||
NS_WARNING(errorMsgCString);
|
||||
delete [] errorMsgCString;
|
||||
nsCRT::free(errorMsgCString);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -869,7 +869,7 @@ nsEditorShell::SetWebShellWindow(nsIDOMWindow* aWin)
|
|||
|
||||
char* cstr = str.ToNewCString();
|
||||
printf("Attaching to WebShellWindow[%s]\n", cstr);
|
||||
delete[] cstr;
|
||||
nsCRT::free(cstr);
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIWebShellContainer> webShellContainer;
|
||||
|
@ -2906,7 +2906,7 @@ void nsEditorShell::SetButtonImage(nsIDOMNode * aParentNode, PRInt32 aBtnNum, co
|
|||
if (imgElement) {
|
||||
char * str = aResName.ToNewCString();
|
||||
imgElement->SetSrc(str);
|
||||
delete [] str;
|
||||
nsCRT::free(str);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2923,7 +2923,7 @@ nsEditorShell::ExecuteScript(nsIScriptContext * aContext, const nsString& aScrip
|
|||
#ifdef APP_DEBUG
|
||||
char* script_str = aScript.ToNewCString();
|
||||
printf("Executing [%s]\n", script_str);
|
||||
delete[] script_str;
|
||||
nsCRT::free(script_str);
|
||||
#endif
|
||||
|
||||
aContext->EvaluateString(aScript, url, 0, rVal, &isUndefined);
|
||||
|
|
|
@ -76,8 +76,8 @@ NS_IMETHODIMP DeleteElementTxn::Do(void)
|
|||
{
|
||||
if (gNoisy)
|
||||
printf(" DeleteElementTxn: deleting child %s from parent %s\n", c, p);
|
||||
delete [] c;
|
||||
delete [] p;
|
||||
nsCRT::free(c);
|
||||
nsCRT::free(p);
|
||||
}
|
||||
// end debug output
|
||||
#endif
|
||||
|
@ -115,8 +115,8 @@ NS_IMETHODIMP DeleteElementTxn::Undo(void)
|
|||
{
|
||||
if (gNoisy)
|
||||
printf(" DeleteElementTxn: inserting child %s back into parent %s\n", c, p);
|
||||
delete [] c;
|
||||
delete [] p;
|
||||
nsCRT::free(c);
|
||||
nsCRT::free(p);
|
||||
}
|
||||
// end debug output
|
||||
#endif
|
||||
|
|
|
@ -446,7 +446,7 @@ NS_IMETHODIMP nsHTMLEditor::SetInlineProperty(nsIAtom *aProperty,
|
|||
aProperty->ToString(propString);
|
||||
char *propCString = propString.ToNewCString();
|
||||
if (gNoisy) { printf("---------- start nsTextEditor::SetTextProperty %s ----------\n", propCString); }
|
||||
delete [] propCString;
|
||||
nsCRT::free(propCString);
|
||||
}
|
||||
|
||||
nsresult result=NS_ERROR_NOT_INITIALIZED;
|
||||
|
@ -563,7 +563,7 @@ NS_IMETHODIMP nsHTMLEditor::SetInlineProperty(nsIAtom *aProperty,
|
|||
aProperty->ToString(propString);
|
||||
char *propCString = propString.ToNewCString();
|
||||
if (gNoisy) { printf("---------- end nsTextEditor::SetTextProperty %s ----------\n", propCString); }
|
||||
delete [] propCString;
|
||||
nsCRT::free(propCString);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -582,7 +582,7 @@ NS_IMETHODIMP nsHTMLEditor::GetInlineProperty(nsIAtom *aProperty,
|
|||
aProperty->ToString(propString);
|
||||
char *propCString = propString.ToNewCString();
|
||||
if (gNoisy) { printf("nsTextEditor::GetTextProperty %s\n", propCString); }
|
||||
delete [] propCString;
|
||||
nsCRT::free(propCString);
|
||||
}
|
||||
*/
|
||||
nsresult result;
|
||||
|
@ -700,7 +700,7 @@ NS_IMETHODIMP nsHTMLEditor::RemoveInlineProperty(nsIAtom *aProperty, const nsStr
|
|||
aProperty->ToString(propString);
|
||||
char *propCString = propString.ToNewCString();
|
||||
if (gNoisy) { printf("---------- start nsTextEditor::RemoveInlineProperty %s ----------\n", propCString); }
|
||||
delete [] propCString;
|
||||
nsCRT::free(propCString);
|
||||
}
|
||||
|
||||
nsresult result;
|
||||
|
@ -806,7 +806,7 @@ NS_IMETHODIMP nsHTMLEditor::RemoveInlineProperty(nsIAtom *aProperty, const nsStr
|
|||
aProperty->ToString(propString);
|
||||
char *propCString = propString.ToNewCString();
|
||||
if (gNoisy) { printf("---------- end nsTextEditor::RemoveInlineProperty %s ----------\n", propCString); }
|
||||
delete [] propCString;
|
||||
nsCRT::free(propCString);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -1390,7 +1390,7 @@ nsHTMLEditor::AddBlockParent(nsString& aParentTag)
|
|||
{
|
||||
char *tag = aParentTag.ToNewCString();
|
||||
printf("---------- nsHTMLEditor::AddBlockParent %s ----------\n", tag);
|
||||
delete [] tag;
|
||||
nsCRT::free(tag);
|
||||
}
|
||||
|
||||
nsresult res=NS_ERROR_NOT_INITIALIZED;
|
||||
|
@ -1435,7 +1435,7 @@ nsHTMLEditor::ReplaceBlockParent(nsString& aParentTag)
|
|||
{
|
||||
char *tag = aParentTag.ToNewCString();
|
||||
printf("---------- nsHTMLEditor::ReplaceBlockParent %s ----------\n", tag);
|
||||
delete [] tag;
|
||||
nsCRT::free(tag);
|
||||
}
|
||||
|
||||
nsresult res=NS_ERROR_NOT_INITIALIZED;
|
||||
|
@ -2608,7 +2608,7 @@ NS_IMETHODIMP nsHTMLEditor::SetBodyWrapWidth(PRInt32 aWrapColumn)
|
|||
#ifdef DEBUG_akkana
|
||||
char* curstyle = styleValue.ToNewCString();
|
||||
printf("Setting style: [%s]\n", curstyle);
|
||||
delete[] curstyle;
|
||||
nsCRT::free(curstyle);
|
||||
#endif /* DEBUG_akkana */
|
||||
|
||||
return bodyElement->SetAttribute(styleName, styleValue);
|
||||
|
@ -2932,7 +2932,7 @@ NS_IMETHODIMP nsHTMLEditor::Paste()
|
|||
#ifdef DEBUG_akkana
|
||||
char* flav = flavor.ToNewCString();
|
||||
printf("Got flavor [%s]\n", flav);
|
||||
delete[] flav;
|
||||
nsCRT::free(flav);
|
||||
#endif
|
||||
if (flavor.Equals(kHTMLMime))
|
||||
{
|
||||
|
@ -2965,7 +2965,7 @@ NS_IMETHODIMP nsHTMLEditor::Paste()
|
|||
rv = NS_ERROR_NOT_IMPLEMENTED; // for now give error code
|
||||
}
|
||||
}
|
||||
delete [] bestFlavor;
|
||||
nsCRT::free(bestFlavor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2990,19 +2990,19 @@ NS_IMETHODIMP nsHTMLEditor::OutputToString(nsString& aOutputString,
|
|||
else
|
||||
{ // default processing
|
||||
nsCOMPtr<nsIDocumentEncoder> encoder;
|
||||
char* progid = new char[strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1];
|
||||
char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1);
|
||||
if (! progid)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
strcpy(progid, NS_DOC_ENCODER_PROGID_BASE);
|
||||
char* type = aFormatType.ToNewCString();
|
||||
strcat(progid, type);
|
||||
delete[] type;
|
||||
nsCRT::free(type);
|
||||
rv = nsComponentManager::CreateInstance(progid,
|
||||
nsnull,
|
||||
nsIDocumentEncoder::GetIID(),
|
||||
getter_AddRefs(encoder));
|
||||
|
||||
delete[] progid;
|
||||
nsCRT::free(progid);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
printf("Couldn't get progid %s\n", progid);
|
||||
|
@ -3058,20 +3058,20 @@ NS_IMETHODIMP nsHTMLEditor::OutputToStream(nsIOutputStream* aOutputStream,
|
|||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIDocumentEncoder> encoder;
|
||||
char* progid = new char[strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1];
|
||||
char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1);
|
||||
if (! progid)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
strcpy(progid, NS_DOC_ENCODER_PROGID_BASE);
|
||||
char* type = aFormatType.ToNewCString();
|
||||
strcat(progid, type);
|
||||
delete[] type;
|
||||
nsCRT::free(type);
|
||||
rv = nsComponentManager::CreateInstance(progid,
|
||||
nsnull,
|
||||
nsIDocumentEncoder::GetIID(),
|
||||
getter_AddRefs(encoder));
|
||||
|
||||
delete[] progid;
|
||||
nsCRT::free(progid);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
printf("Couldn't get progid %s\n", progid);
|
||||
|
@ -3594,7 +3594,7 @@ nsHTMLEditor::ReParentContentOfNode(nsIDOMNode *aNode,
|
|||
{
|
||||
char *tag = aParentTag.ToNewCString();
|
||||
printf("---------- ReParentContentOfNode(%p,%s,%d) -----------\n", aNode, tag, aTransformation);
|
||||
delete [] tag;
|
||||
nsCRT::free(tag);
|
||||
}
|
||||
// find the current block parent, or just use aNode if it is a block node
|
||||
nsCOMPtr<nsIDOMElement>blockParentElement;
|
||||
|
|
|
@ -377,7 +377,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
|
|||
if (buf)
|
||||
{
|
||||
puts(buf);
|
||||
delete[] buf;
|
||||
nsCRT::free(buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -781,7 +781,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
|
|||
nsString *tag = styles.StringAt(i);
|
||||
char *tagCString = tag->ToNewCString();
|
||||
printf("%s ", tagCString);
|
||||
delete [] tagCString;
|
||||
nsCRT::free(tagCString);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
@ -1418,7 +1418,7 @@ nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent)
|
|||
dragSession->SetCanDrop(PR_TRUE);
|
||||
}
|
||||
|
||||
delete [] whichFlavor;
|
||||
nsCRT::free(whichFlavor);
|
||||
// XXX This is where image support might go
|
||||
//void * data;
|
||||
//trans->GetTransferData(mImageDataFlavor, (void **)&data, &len);
|
||||
|
|
|
@ -629,7 +629,7 @@ nsTextEditRules::WillDeleteSelection(nsIDOMSelection *aSelection,
|
|||
#ifdef DEBUG_buster
|
||||
char *password = mPasswordText.ToNewCString();
|
||||
printf("mPasswordText is %s\n", password);
|
||||
delete [] password;
|
||||
nsCRT::free(password);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -989,7 +989,7 @@ nsTextEditRules::EchoInsertionToPWBuff(nsIDOMSelection *aSelection, nsString *aO
|
|||
#ifdef DEBUG_jfrancis
|
||||
char *password = mPasswordText.ToNewCString();
|
||||
printf("mPasswordText is %s\n", password);
|
||||
delete [] password;
|
||||
nsCRT::free(password);
|
||||
#endif
|
||||
|
||||
// change the output to '*' only
|
||||
|
|
Загрузка…
Ссылка в новой задаче