Bug 1463985 - part 7: Rename EditSubAction::eDeleteText to EditSubAction::deleteText r?m_kato draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 28 May 2018 21:29:14 +0900
changeset 801977 236528341d05252ef13dce18f114846cebd4a218
parent 801976 d9855f71eec6d9b8bd31e8f4a5d7a19398404798
child 801978 dc2aa58f4b656301cbf1ca0506d155c1fee2fea8
push id111796
push usermasayuki@d-toybox.com
push dateThu, 31 May 2018 06:40:56 +0000
reviewersm_kato
bugs1463985
milestone62.0a1
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
editor/libeditor/EditAction.h
editor/libeditor/EditorBase.cpp
editor/libeditor/HTMLEditRules.cpp
--- 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;
      }
   }