Bug 1156062 part 5 - Make CreateBR return regular pointer; r=ehsan

This commit is contained in:
Aryeh Gregor 2016-04-23 18:31:55 +09:00
Родитель 258c4350c5
Коммит ff29bf2138
6 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -1134,7 +1134,7 @@ nsHTMLEditor::TabInTable(bool inIsShift, bool* outHandled)
return NS_OK;
}
already_AddRefed<Element>
Element*
nsHTMLEditor::CreateBR(nsINode* aNode, int32_t aOffset, EDirection aSelect)
{
nsCOMPtr<nsIDOMNode> parent = GetAsDOMNode(aNode);
@ -1143,7 +1143,7 @@ nsHTMLEditor::CreateBR(nsINode* aNode, int32_t aOffset, EDirection aSelect)
// We assume everything is fine if the br is not null, irrespective of retval
CreateBRImpl(address_of(parent), &offset, address_of(outBRNode), aSelect);
nsCOMPtr<Element> ret = do_QueryInterface(outBRNode);
return ret.forget();
return ret;
}
NS_IMETHODIMP nsHTMLEditor::CreateBR(nsIDOMNode *aNode, int32_t aOffset, nsCOMPtr<nsIDOMNode> *outBRNode, EDirection aSelect)
@ -4773,7 +4773,7 @@ nsHTMLEditor::CopyLastEditableChildStyles(nsIDOMNode * aPreviousBlock, nsIDOMNod
childElement = childElement->GetParentElement();
}
if (deepestStyle) {
*aOutBrNode = GetAsDOMNode(CreateBR(deepestStyle, 0).take());
*aOutBrNode = GetAsDOMNode(CreateBR(deepestStyle, 0));
NS_ENSURE_STATE(*aOutBrNode);
}
return NS_OK;

Просмотреть файл

@ -426,8 +426,8 @@ protected:
// key event helpers
NS_IMETHOD TabInTable(bool inIsShift, bool *outHandled);
already_AddRefed<mozilla::dom::Element> CreateBR(nsINode* aNode,
int32_t aOffset, EDirection aSelect = eNone);
mozilla::dom::Element* CreateBR(nsINode* aNode, int32_t aOffset,
EDirection aSelect = eNone);
NS_IMETHOD CreateBR(nsIDOMNode *aNode, int32_t aOffset,
nsCOMPtr<nsIDOMNode> *outBRNode, nsIEditor::EDirection aSelect = nsIEditor::eNone) override;

Просмотреть файл

@ -436,7 +436,7 @@ nsPlaintextEditor::TypedText(const nsAString& aString, ETypingAction aAction)
}
}
already_AddRefed<Element>
Element*
nsPlaintextEditor::CreateBRImpl(nsCOMPtr<nsINode>* aInOutParent,
int32_t* aInOutOffset,
EDirection aSelect)
@ -447,7 +447,7 @@ nsPlaintextEditor::CreateBRImpl(nsCOMPtr<nsINode>* aInOutParent,
CreateBRImpl(address_of(parent), aInOutOffset, address_of(br), aSelect);
*aInOutParent = do_QueryInterface(parent);
nsCOMPtr<Element> ret(do_QueryInterface(br));
return ret.forget();
return ret;
}
nsresult

Просмотреть файл

@ -180,9 +180,9 @@ protected:
// key event helpers
NS_IMETHOD CreateBR(nsIDOMNode *aNode, int32_t aOffset,
nsCOMPtr<nsIDOMNode> *outBRNode, EDirection aSelect = eNone);
already_AddRefed<mozilla::dom::Element>
CreateBRImpl(nsCOMPtr<nsINode>* aInOutParent, int32_t* aInOutOffset,
EDirection aSelect);
mozilla::dom::Element* CreateBRImpl(nsCOMPtr<nsINode>* aInOutParent,
int32_t* aInOutOffset,
EDirection aSelect);
nsresult CreateBRImpl(nsCOMPtr<nsIDOMNode>* aInOutParent,
int32_t* aInOutOffset,
nsCOMPtr<nsIDOMNode>* outBRNode,

Просмотреть файл

@ -193,7 +193,7 @@ nsWSRunObject::PrepareToSplitAcrossBlocks(nsHTMLEditor* aHTMLEd,
// public instance methods
//--------------------------------------------------------------------------------------------
already_AddRefed<Element>
Element*
nsWSRunObject::InsertBreak(nsCOMPtr<nsINode>* aInOutParent,
int32_t* aInOutOffset,
nsIEditor::EDirection aSelect)

Просмотреть файл

@ -203,9 +203,9 @@ class MOZ_STACK_CLASS nsWSRunObject
// and makes any needed adjustments to ws around that point.
// example of fixup: normalws after {aInOutParent,aInOutOffset}
// needs to begin with nbsp.
already_AddRefed<mozilla::dom::Element>
InsertBreak(nsCOMPtr<nsINode>* aInOutParent, int32_t* aInOutOffset,
nsIEditor::EDirection aSelect);
mozilla::dom::Element* InsertBreak(nsCOMPtr<nsINode>* aInOutParent,
int32_t* aInOutOffset,
nsIEditor::EDirection aSelect);
// InsertText inserts a string at {aInOutParent,aInOutOffset} and makes any
// needed adjustments to ws around that point. Example of fixup: