Bug 1463985 - part 6: Rename EditSubAction::splitNode and EditSubAction::joinNode to EditSubAction::eSplitNode and EditSubAction::eJoinNodes r?m_kato
MozReview-Commit-ID: Lk0UKyzWK8d
--- a/editor/libeditor/EditAction.h
+++ b/editor/libeditor/EditAction.h
@@ -28,18 +28,21 @@ enum class EditSubAction : int32_t
eInsertNode,
// eCreateNode indicates to create a new node and insert it into the DOM tree.
eCreateNode,
// eDeleteNode indicates to remove a node from the DOM tree.
eDeleteNode,
- splitNode,
- joinNode,
+ // eSplitNode indicates to split a node to 2 nodes.
+ eSplitNode,
+
+ // eJoinNodes indicates to join 2 nodes.
+ eJoinNodes,
deleteText = 1003,
// Text edit commands
insertText = 2000,
insertIMEText,
deleteSelection,
setTextProperty,
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -1494,17 +1494,17 @@ EditorBase::SplitNodeWithTransaction(
if (NS_WARN_IF(!aStartOfRightNode.IsSet()) ||
NS_WARN_IF(!aStartOfRightNode.GetContainerAsContent())) {
aError.Throw(NS_ERROR_INVALID_ARG);
return nullptr;
}
MOZ_ASSERT(aStartOfRightNode.IsSetAndValid());
AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
- *this, EditSubAction::splitNode,
+ *this, EditSubAction::eSplitNode,
nsIEditor::eNext);
// XXX Unfortunately, storing offset of the split point in
// SplitNodeTransaction is necessary for now. We should fix this
// in a follow up bug.
Unused << aStartOfRightNode.Offset();
RefPtr<SplitNodeTransaction> transaction =
@@ -1561,17 +1561,17 @@ EditorBase::JoinNodes(nsINode* aLeftNode
nsresult
EditorBase::JoinNodesWithTransaction(nsINode& aLeftNode,
nsINode& aRightNode)
{
nsCOMPtr<nsINode> parent = aLeftNode.GetParentNode();
MOZ_ASSERT(parent);
AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
- *this, EditSubAction::joinNode,
+ *this, EditSubAction::eJoinNodes,
nsIEditor::ePrevious);
// Remember some values; later used for saved selection updating.
// Find the offset between the nodes to be joined.
int32_t offset = parent->ComputeIndexOf(&aRightNode);
// Find the number of children of the lefthand node
uint32_t oldLeftNodeLen = aLeftNode.Length();