Bug 1460509 - part 22: Mark HTMLEditRules::InsertBRIfNeededInternal() and its wrappers as MOZ_MUST_USE r?m_kato
MozReview-Commit-ID: 4ueY3i1QFuD
--- a/editor/libeditor/HTMLEditRules.h
+++ b/editor/libeditor/HTMLEditRules.h
@@ -180,25 +180,45 @@ protected:
/**
* CanContainParagraph() returns true if aElement can have a <p> element as
* its child or its descendant.
*/
bool CanContainParagraph(Element& aElement) const;
/**
+ * Insert normal <br> element into aNode when aNode is a block and it has
+ * no children.
+ */
+ MOZ_MUST_USE nsresult InsertBRIfNeeded(nsINode& aNode)
+ {
+ return InsertBRIfNeededInternal(aNode, false);
+ }
+
+ /**
+ * Insert moz-<br> element (<br type="_moz">) into aNode when aNode is a
+ * block and it has no children.
+ */
+ MOZ_MUST_USE nsresult InsertMozBRIfNeeded(nsINode& aNode)
+ {
+ return InsertBRIfNeededInternal(aNode, true);
+ }
+
+ /**
* Insert a normal <br> element or a moz-<br> element to aNode when
- * aNode is a block and it has no children.
+ * aNode is a block and it has no children. Use InsertBRIfNeeded() or
+ * InsertMozBRIfNeeded() instead.
*
* @param aNode Reference to a block parent.
* @param aInsertMozBR true if this should insert a moz-<br> element.
* Otherwise, i.e., this should insert a normal <br>
* element, false.
*/
- nsresult InsertBRIfNeededInternal(nsINode& aNode, bool aInsertMozBR);
+ MOZ_MUST_USE nsresult
+ InsertBRIfNeededInternal(nsINode& aNode, bool aInsertMozBR);
EditorDOMPoint GetGoodSelPointForNode(nsINode& aNode,
nsIEditor::EDirection aAction);
/**
* TryToJoinBlocksWithTransaction() tries to join two block elements. The
* right element is always joined to the left element. If the elements are
* the same type and not nested within each other,
@@ -572,34 +592,16 @@ protected:
* table element is its own nearest table element ancestor.
*/
bool InDifferentTableElements(nsINode* aNode1, nsINode* aNode2);
nsresult RemoveEmptyNodes();
nsresult SelectionEndpointInNode(nsINode* aNode, bool* aResult);
nsresult UpdateDocChangeRange(nsRange* aRange);
nsresult ConfirmSelectionInBody();
- /**
- * Insert normal <br> element into aNode when aNode is a block and it has
- * no children.
- */
- nsresult InsertBRIfNeeded(nsINode& aNode)
- {
- return InsertBRIfNeededInternal(aNode, false);
- }
-
- /**
- * Insert moz-<br> element (<br type="_moz">) into aNode when aNode is a
- * block and it has no children.
- */
- nsresult InsertMozBRIfNeeded(nsINode& aNode)
- {
- return InsertBRIfNeededInternal(aNode, true);
- }
-
bool IsEmptyInline(nsINode& aNode);
bool ListIsEmptyLine(nsTArray<OwningNonNull<nsINode>>& arrayOfNodes);
/**
* RemoveAlignment() removes align attributes, text-align properties and
* <center> elements in aNode.
*
* @param aNode Alignment information of the node and/or its