diff --git a/editor/libeditor/HTMLEditorDataTransfer.cpp b/editor/libeditor/HTMLEditorDataTransfer.cpp index 1ec693a4b48c..dcc920aea980 100644 --- a/editor/libeditor/HTMLEditorDataTransfer.cpp +++ b/editor/libeditor/HTMLEditorDataTransfer.cpp @@ -2096,16 +2096,17 @@ nsresult FindTargetNode(nsIDOMNode *aStart, nsCOMPtr &aResult) // Note: it doesn't matter if this fails. aStart->RemoveChild(child, getter_AddRefs(tmp)); - return NS_FOUND_TARGET; + return NS_SUCCESS_EDITOR_FOUND_TARGET; } } - // Note: Don't use NS_ENSURE_* here since we return a failure result to - // inicate that we found the magical cookie and we don't want to spam the - // console. rv = FindTargetNode(child, aResult); NS_ENSURE_SUCCESS(rv, rv); + if (rv == NS_SUCCESS_EDITOR_FOUND_TARGET) { + return NS_SUCCESS_EDITOR_FOUND_TARGET; + } + rv = child->GetNextSibling(getter_AddRefs(tmp)); NS_ENSURE_SUCCESS(rv, rv); @@ -2147,9 +2148,6 @@ HTMLEditor::CreateDOMFragmentFromPaste(const nsAString& aInputString, RemoveBodyAndHead(*contextAsNode); rv = FindTargetNode(contextAsNode, contextLeaf); - if (rv == NS_FOUND_TARGET) { - rv = NS_OK; - } NS_ENSURE_SUCCESS(rv, rv); } diff --git a/xpcom/base/ErrorList.h b/xpcom/base/ErrorList.h index f8294f818f8b..7fff45dd7786 100644 --- a/xpcom/base/ErrorList.h +++ b/xpcom/base/ErrorList.h @@ -606,9 +606,8 @@ /* 17: NS_ERROR_MODULE_EDITOR */ /* ======================================================================= */ #define MODULE NS_ERROR_MODULE_EDITOR - ERROR(NS_FOUND_TARGET, FAILURE(1)), - ERROR(NS_EDITOR_ELEMENT_NOT_FOUND, SUCCESS(1)), + ERROR(NS_SUCCESS_EDITOR_FOUND_TARGET, SUCCESS(2)), #undef MODULE