Fix for bug 382778. r=smaug, sr=sicking.

This commit is contained in:
2007-07-02 07:01:27 -07:00
parent a731a218fc
commit d03efef838
5 changed files with 58 additions and 80 deletions

View File

@@ -57,6 +57,7 @@
#include "nsHTMLCSSUtils.h"
#include "nsColor.h"
#include "nsAttrName.h"
#include "nsAutoPtr.h"
static
void ProcessBValue(const nsAString * aInputString, nsAString & aOutputString,
@@ -465,8 +466,9 @@ nsresult
nsHTMLCSSUtils::SetCSSProperty(nsIDOMElement *aElement, nsIAtom * aProperty, const nsAString & aValue,
PRBool aSuppressTransaction)
{
ChangeCSSInlineStyleTxn *txn;
nsresult result = CreateCSSPropertyTxn(aElement, aProperty, aValue, &txn, PR_FALSE);
nsRefPtr<ChangeCSSInlineStyleTxn> txn;
nsresult result = CreateCSSPropertyTxn(aElement, aProperty, aValue,
getter_AddRefs(txn), PR_FALSE);
if (NS_SUCCEEDED(result)) {
if (aSuppressTransaction) {
result = txn->DoTransaction();
@@ -475,8 +477,6 @@ nsHTMLCSSUtils::SetCSSProperty(nsIDOMElement *aElement, nsIAtom * aProperty, con
result = mHTMLEditor->DoTransaction(txn);
}
}
// The transaction system (if any) has taken ownership of txn
NS_IF_RELEASE(txn);
return result;
}
@@ -499,8 +499,9 @@ nsresult
nsHTMLCSSUtils::RemoveCSSProperty(nsIDOMElement *aElement, nsIAtom * aProperty, const nsAString & aValue,
PRBool aSuppressTransaction)
{
ChangeCSSInlineStyleTxn *txn;
nsresult result = CreateCSSPropertyTxn(aElement, aProperty, aValue, &txn, PR_TRUE);
nsRefPtr<ChangeCSSInlineStyleTxn> txn;
nsresult result = CreateCSSPropertyTxn(aElement, aProperty, aValue,
getter_AddRefs(txn), PR_TRUE);
if (NS_SUCCEEDED(result)) {
if (aSuppressTransaction) {
result = txn->DoTransaction();
@@ -509,8 +510,6 @@ nsHTMLCSSUtils::RemoveCSSProperty(nsIDOMElement *aElement, nsIAtom * aProperty,
result = mHTMLEditor->DoTransaction(txn);
}
}
// The transaction system (if any) has taken ownership of txn
NS_IF_RELEASE(txn);
return result;
}