Bug 1463985 - part 7: Rename EditSubAction::eDeleteText to EditSubAction::deleteText r?m_kato
And the odd number assign does not make sense anymore. So, removes it.
MozReview-Commit-ID: JSyMNcrNhpP
--- a/editor/libeditor/EditAction.h
+++ b/editor/libeditor/EditAction.h
@@ -34,17 +34,18 @@ enum class EditSubAction : int32_t
eDeleteNode,
// eSplitNode indicates to split a node to 2 nodes.
eSplitNode,
// eJoinNodes indicates to join 2 nodes.
eJoinNodes,
- deleteText = 1003,
+ // eDeleteText indicates to delete some characters form a text node.
+ eDeleteText,
// Text edit commands
insertText = 2000,
insertIMEText,
deleteSelection,
setTextProperty,
removeTextProperty,
outputText,
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -2983,17 +2983,17 @@ EditorBase::DeleteTextWithTransaction(Ch
{
RefPtr<DeleteTextTransaction> transaction =
DeleteTextTransaction::MaybeCreate(*this, aCharData, aOffset, aLength);
if (NS_WARN_IF(!transaction)) {
return NS_ERROR_FAILURE;
}
AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
- *this, EditSubAction::deleteText,
+ *this, EditSubAction::eDeleteText,
nsIEditor::ePrevious);
// Let listeners know what's up
if (!mActionListeners.IsEmpty()) {
AutoActionListenerArray listeners(mActionListeners);
for (auto& listener : listeners) {
listener->WillDeleteText(&aCharData, aOffset, aLength);
}
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -7128,17 +7128,17 @@ HTMLEditRules::GetPromotedPoint(RulesEnd
{
MOZ_ASSERT(IsEditorDataAvailable());
// we do one thing for text actions, something else entirely for other
// actions
if (aEditSubAction == EditSubAction::insertText ||
aEditSubAction == EditSubAction::insertIMEText ||
aEditSubAction == EditSubAction::insertBreak ||
- aEditSubAction == EditSubAction::deleteText) {
+ aEditSubAction == EditSubAction::eDeleteText) {
bool isSpace, isNBSP;
nsCOMPtr<nsIContent> content =
aNode.IsContent() ? aNode.AsContent() : nullptr;
nsCOMPtr<nsIContent> temp;
int32_t newOffset = aOffset;
// for text actions, we want to look backwards (or forwards, as
// appropriate) for additional whitespace or nbsp's. We may have to act on
// these later even though they are outside of the initial selection. Even
@@ -7377,17 +7377,17 @@ HTMLEditRules::PromoteRange(nsRange& aRa
endOffset = block->Length();
}
}
}
if (aEditSubAction == EditSubAction::insertText ||
aEditSubAction == EditSubAction::insertIMEText ||
aEditSubAction == EditSubAction::insertBreak ||
- aEditSubAction == EditSubAction::deleteText) {
+ aEditSubAction == EditSubAction::eDeleteText) {
if (!startNode->IsContent() ||
!endNode->IsContent()) {
// GetPromotedPoint cannot promote node when action type is text
// operation and selected node isn't content node.
return;
}
}