Bug 1463985 - part 22: Rename EditSubAction::insertQuotation to EditSubAction::eInsertQuotation r?m_kato draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 28 May 2018 23:22:19 +0900
changeset 801992 173ca882a661140a0de6850d546fd515a1c23d4f
parent 801991 cab068c347e8dee9ab60962de78f793b44e1f808
child 801993 304048d0d609a382d7ed2e7fe2434909612e93ac
push id111796
push usermasayuki@d-toybox.com
push dateThu, 31 May 2018 06:40:56 +0000
reviewersm_kato
bugs1463985
milestone62.0a1
Bug 1463985 - part 22: Rename EditSubAction::insertQuotation to EditSubAction::eInsertQuotation r?m_kato According to this usage, perhaps, we can remove this from EditSubAction and this should be moved to new EditAction. MozReview-Commit-ID: HzfcC051rNB
editor/libeditor/EditAction.h
editor/libeditor/HTMLEditRules.cpp
editor/libeditor/HTMLEditorDataTransfer.cpp
--- a/editor/libeditor/EditAction.h
+++ b/editor/libeditor/EditAction.h
@@ -91,17 +91,18 @@ enum class EditSubAction : int32_t
 
   // eCreateOrChangeDefinitionList indicates to create new definition list or
   // change existing list to a definition list.
   eCreateOrChangeDefinitionList,
 
   // eInsertElement indicates to insert an element.
   eInsertElement,
 
-  insertQuotation,
+  // eInsertQuotation indicates to insert an element and make it "quoted text".
+  eInsertQuotation,
 
   htmlPaste = 3012,
   loadHTML,
   resetTextProperties,
   setAbsolutePosition,
   removeAbsolutePosition,
   decreaseZIndex,
   increaseZIndex,
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -89,17 +89,17 @@ IsStyleCachePreservingSubAction(EditSubA
          aEditSubAction == EditSubAction::eCreateOrChangeList ||
          aEditSubAction == EditSubAction::eIndent ||
          aEditSubAction == EditSubAction::eOutdent ||
          aEditSubAction == EditSubAction::eSetOrClearAlignment ||
          aEditSubAction == EditSubAction::eCreateOrRemoveBlock ||
          aEditSubAction == EditSubAction::eRemoveList ||
          aEditSubAction == EditSubAction::eCreateOrChangeDefinitionList ||
          aEditSubAction == EditSubAction::eInsertElement ||
-         aEditSubAction == EditSubAction::insertQuotation;
+         aEditSubAction == EditSubAction::eInsertQuotation;
 }
 
 static nsAtom&
 ParagraphSeparatorElement(ParagraphSeparator separator)
 {
   switch (separator) {
     default:
       MOZ_FALLTHROUGH_ASSERT("Unexpected paragraph separator!");
--- a/editor/libeditor/HTMLEditorDataTransfer.cpp
+++ b/editor/libeditor/HTMLEditorDataTransfer.cpp
@@ -1585,17 +1585,17 @@ HTMLEditor::PasteAsQuotation(int32_t aSe
 }
 
 NS_IMETHODIMP
 HTMLEditor::PasteAsCitedQuotation(const nsAString& aCitation,
                                   int32_t aSelectionType)
 {
   AutoPlaceholderBatch beginBatching(this);
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                      *this, EditSubAction::insertQuotation,
+                                      *this, EditSubAction::eInsertQuotation,
                                       nsIEditor::eNext);
 
   // get selection
   RefPtr<Selection> selection = GetSelection();
   NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
 
   // give rules a chance to handle or cancel
   EditSubActionInfo subActionInfo(EditSubAction::eInsertElement);
@@ -1795,17 +1795,17 @@ HTMLEditor::InsertAsPlaintextQuotation(c
                                        nsINode** aNodeInserted)
 {
   // get selection
   RefPtr<Selection> selection = GetSelection();
   NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
 
   AutoPlaceholderBatch beginBatching(this);
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                      *this, EditSubAction::insertQuotation,
+                                      *this, EditSubAction::eInsertQuotation,
                                       nsIEditor::eNext);
 
   // give rules a chance to handle or cancel
   EditSubActionInfo subActionInfo(EditSubAction::eInsertElement);
   bool cancel, handled;
   // Protect the edit rules object from dying
   RefPtr<TextEditRules> rules(mRules);
   nsresult rv =
@@ -1902,17 +1902,17 @@ HTMLEditor::InsertAsCitedQuotation(const
   }
 
   // get selection
   RefPtr<Selection> selection = GetSelection();
   NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
 
   AutoPlaceholderBatch beginBatching(this);
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                      *this, EditSubAction::insertQuotation,
+                                      *this, EditSubAction::eInsertQuotation,
                                       nsIEditor::eNext);
 
   // give rules a chance to handle or cancel
   EditSubActionInfo subActionInfo(EditSubAction::eInsertElement);
   bool cancel, handled;
   // Protect the edit rules object from dying
   RefPtr<TextEditRules> rules(mRules);
   nsresult rv =