Bug 762430 - Fix uninitialized nsresult in nsHTMLEditor::AbsolutelyPositionElement; r=ehsan

This commit is contained in:
Aryeh Gregor 2012-06-07 18:00:58 +03:00
parent a9cd8feaa1
commit 83c8a8199f

View File

@ -489,7 +489,6 @@ nsHTMLEditor::AbsolutelyPositionElement(nsIDOMElement * aElement,
return NS_OK;
nsAutoEditBatch batchIt(this);
nsresult res;
if (aEnabled) {
PRInt32 x, y;
@ -512,11 +511,11 @@ nsHTMLEditor::AbsolutelyPositionElement(nsIDOMElement * aElement,
nsINode* parentNode = element->GetNodeParent();
if (parentNode->GetChildCount() == 1) {
nsCOMPtr<nsIDOMNode> brNode;
res = CreateBR(parentNode->AsDOMNode(), 0, address_of(brNode));
nsresult res = CreateBR(parentNode->AsDOMNode(), 0, address_of(brNode));
NS_ENSURE_SUCCESS(res, res);
}
}
else {
res = NS_OK;
mHTMLCSSUtils->RemoveCSSProperty(aElement,
nsEditProperty::cssPosition,
EmptyString(), false);
@ -543,12 +542,13 @@ nsHTMLEditor::AbsolutelyPositionElement(nsIDOMElement * aElement,
if (element && element->IsHTML(nsGkAtoms::div) && !HasStyleOrIdOrClass(element)) {
nsHTMLEditRules* htmlRules = static_cast<nsHTMLEditRules*>(mRules.get());
NS_ENSURE_TRUE(htmlRules, NS_ERROR_FAILURE);
res = htmlRules->MakeSureElemStartsOrEndsOnCR(aElement);
nsresult res = htmlRules->MakeSureElemStartsOrEndsOnCR(aElement);
NS_ENSURE_SUCCESS(res, res);
res = RemoveContainer(aElement);
NS_ENSURE_SUCCESS(res, res);
}
}
return res;
return NS_OK;
}
NS_IMETHODIMP