Bug 1451672 - part 6: Rename EditorBase::JoinNodesImpl() to EditorBase::DoJoinNodes() r?m_kato
MozReview-Commit-ID: 9fqa4fKkAF5
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -3253,19 +3253,19 @@ EditorBase::DoSplitNode(const EditorDOMP
}
}
// We don't need to set selection here because the caller should do that
// in any case.
}
nsresult
-EditorBase::JoinNodesImpl(nsINode* aNodeToKeep,
- nsINode* aNodeToJoin,
- nsINode* aParent)
+EditorBase::DoJoinNodes(nsINode* aNodeToKeep,
+ nsINode* aNodeToJoin,
+ nsINode* aParent)
{
MOZ_ASSERT(aNodeToKeep);
MOZ_ASSERT(aNodeToJoin);
MOZ_ASSERT(aParent);
uint32_t firstNodeLength = aNodeToJoin->Length();
int32_t joinOffset;
--- a/editor/libeditor/EditorBase.h
+++ b/editor/libeditor/EditorBase.h
@@ -808,30 +808,30 @@ public:
* node if necessary), returns no error.
* Otherwise, an error.
*/
void DoSplitNode(const EditorDOMPoint& aStartOfRightNode,
nsIContent& aNewLeftNode,
ErrorResult& aError);
/**
- * JoinNodesImpl() merges contents in aNodeToJoin to aNodeToKeep and remove
+ * DoJoinNodes() merges contents in aNodeToJoin to aNodeToKeep and remove
* aNodeToJoin from the DOM tree. aNodeToJoin and aNodeToKeep must have
* same parent, aParent. Additionally, if one of aNodeToJoin or aNodeToKeep
* is a text node, the other must be a text node.
*
* @param aNodeToKeep The node that will remain after the join.
* @param aNodeToJoin The node that will be joined with aNodeToKeep.
* There is no requirement that the two nodes be of the
* same type.
* @param aParent The parent of aNodeToKeep
*/
- nsresult JoinNodesImpl(nsINode* aNodeToKeep,
- nsINode* aNodeToJoin,
- nsINode* aParent);
+ nsresult DoJoinNodes(nsINode* aNodeToKeep,
+ nsINode* aNodeToJoin,
+ nsINode* aParent);
/**
* Return the offset of aChild in aParent. Asserts fatally if parent or
* child is null, or parent is not child's parent.
* FYI: aChild must not be being removed from aParent. In such case, these
* methods may return wrong index if aChild doesn't have previous
* sibling or next sibling.
*/
--- a/editor/libeditor/JoinNodeTransaction.cpp
+++ b/editor/libeditor/JoinNodeTransaction.cpp
@@ -84,17 +84,17 @@ JoinNodeTransaction::DoTransaction()
return NS_ERROR_INVALID_ARG;
}
// Set this instance's mParent. Other methods will see a non-null mParent
// and know all is well
mParent = leftParent;
mOffset = mLeftNode->Length();
- return mEditorBase->JoinNodesImpl(mRightNode, mLeftNode, mParent);
+ return mEditorBase->DoJoinNodes(mRightNode, mLeftNode, mParent);
}
//XXX: What if instead of split, we just deleted the unneeded children of
// mRight and re-inserted mLeft?
NS_IMETHODIMP
JoinNodeTransaction::UndoTransaction()
{
if (NS_WARN_IF(!mParent) ||
--- a/editor/libeditor/SplitNodeTransaction.cpp
+++ b/editor/libeditor/SplitNodeTransaction.cpp
@@ -131,18 +131,18 @@ SplitNodeTransaction::UndoTransaction()
NS_WARN_IF(!mParent) ||
NS_WARN_IF(!mStartOfRightNode.IsSet())) {
return NS_ERROR_NOT_INITIALIZED;
}
// This assumes Do inserted the new node in front of the prior existing node
// XXX Perhaps, we should reset mStartOfRightNode with current first child
// of the right node.
- return mEditorBase->JoinNodesImpl(mStartOfRightNode.GetContainer(),
- mNewLeftNode, mParent);
+ return mEditorBase->DoJoinNodes(mStartOfRightNode.GetContainer(),
+ mNewLeftNode, mParent);
}
/* Redo cannot simply resplit the right node, because subsequent transactions
* on the redo stack may depend on the left node existing in its previous
* state.
*/
NS_IMETHODIMP
SplitNodeTransaction::RedoTransaction()