Bug 1463985 - part 5: Rename EditSubAction::deleteNode to EditSubAction::eDeleteNode r?m_kato draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 28 May 2018 21:19:34 +0900
changeset 801975 fd15a357ba7bf35f139c7a532a961b43d0ffebbe
parent 801974 08e5dc807c3036ace1d11a5943ef269e09400434
child 801976 d9855f71eec6d9b8bd31e8f4a5d7a19398404798
push id111796
push usermasayuki@d-toybox.com
push dateThu, 31 May 2018 06:40:56 +0000
reviewersm_kato
bugs1463985
milestone62.0a1
Bug 1463985 - part 5: Rename EditSubAction::deleteNode to EditSubAction::eDeleteNode r?m_kato MozReview-Commit-ID: 1K5bdzvNUaF
editor/libeditor/EditAction.h
editor/libeditor/HTMLTableEditor.cpp
--- a/editor/libeditor/EditAction.h
+++ b/editor/libeditor/EditAction.h
@@ -25,17 +25,19 @@ enum class EditSubAction : int32_t
   eRedo,
 
   // eInsertNode indicates to insert a new node into the DOM tree.
   eInsertNode,
 
   // eCreateNode indicates to create a new node and insert it into the DOM tree.
   eCreateNode,
 
-  deleteNode,
+  // eDeleteNode indicates to remove a node from the DOM tree.
+  eDeleteNode,
+
   splitNode,
   joinNode,
 
   deleteText = 1003,
 
   // Text edit commands
   insertText = 2000,
   insertIMEText,
--- a/editor/libeditor/HTMLTableEditor.cpp
+++ b/editor/libeditor/HTMLTableEditor.cpp
@@ -719,17 +719,17 @@ HTMLEditor::DeleteTableCell(int32_t aNum
 
   NS_ENSURE_SUCCESS(rv, rv);
   // Don't fail if we didn't find a table or cell
   NS_ENSURE_TRUE(table && cell, NS_SUCCESS_EDITOR_ELEMENT_NOT_FOUND);
 
   AutoPlaceholderBatch beginBatching(this);
   // Prevent rules testing until we're done
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                      *this, EditSubAction::deleteNode,
+                                      *this, EditSubAction::eDeleteNode,
                                       nsIEditor::eNext);
 
   RefPtr<Element> firstCell;
   rv = GetFirstSelectedCell(nullptr, getter_AddRefs(firstCell));
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (firstCell && selection->RangeCount() > 1) {
     // When > 1 selected cell,
@@ -905,17 +905,17 @@ HTMLEditor::DeleteTableCellContents()
   NS_ENSURE_SUCCESS(rv, rv);
   // Don't fail if no cell found
   NS_ENSURE_TRUE(cell, NS_SUCCESS_EDITOR_ELEMENT_NOT_FOUND);
 
 
   AutoPlaceholderBatch beginBatching(this);
   // Prevent rules testing until we're done
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                      *this, EditSubAction::deleteNode,
+                                      *this, EditSubAction::eDeleteNode,
                                       nsIEditor::eNext);
   //Don't let Rules System change the selection
   AutoTransactionsConserveSelection dontChangeSelection(this);
 
 
   RefPtr<Element> firstCell;
   rv = GetFirstSelectedCell(nullptr, getter_AddRefs(firstCell));
   NS_ENSURE_SUCCESS(rv, rv);
@@ -944,17 +944,17 @@ HTMLEditor::DeleteTableCellContents()
   return NS_OK;
 }
 
 nsresult
 HTMLEditor::DeleteCellContents(Element* aCell)
 {
   // Prevent rules testing until we're done
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                      *this, EditSubAction::deleteNode,
+                                      *this, EditSubAction::eDeleteNode,
                                       nsIEditor::eNext);
 
   while (nsCOMPtr<nsINode> child = aCell->GetLastChild()) {
     nsresult rv = DeleteNodeWithTransaction(*child);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   }
@@ -986,17 +986,17 @@ HTMLEditor::DeleteTableColumn(int32_t aN
   }
 
   // Check for counts too high
   aNumber = std::min(aNumber,(colCount-startColIndex));
 
   AutoPlaceholderBatch beginBatching(this);
   // Prevent rules testing until we're done
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                      *this, EditSubAction::deleteNode,
+                                      *this, EditSubAction::eDeleteNode,
                                       nsIEditor::eNext);
 
   // Test if deletion is controlled by selected cells
   RefPtr<Element> firstCell;
   rv = GetFirstSelectedCell(nullptr, getter_AddRefs(firstCell));
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint32_t rangeCount = selection->RangeCount();
@@ -1151,17 +1151,17 @@ HTMLEditor::DeleteTableRow(int32_t aNumb
   // Shortcut the case of deleting all rows in table
   if (!startRowIndex && aNumber >= rowCount) {
     return DeleteTable2(table, selection);
   }
 
   AutoPlaceholderBatch beginBatching(this);
   // Prevent rules testing until we're done
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                      *this, EditSubAction::deleteNode,
+                                      *this, EditSubAction::eDeleteNode,
                                       nsIEditor::eNext);
 
   RefPtr<Element> firstCell;
   rv = GetFirstSelectedCell(nullptr, getter_AddRefs(firstCell));
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint32_t rangeCount = selection->RangeCount();
 
@@ -1232,17 +1232,17 @@ HTMLEditor::DeleteRow(Element* aTable,
   RefPtr<Element> cell;
   RefPtr<Element> cellInDeleteRow;
   int32_t startRowIndex, startColIndex, rowSpan, colSpan, actualRowSpan, actualColSpan;
   bool    isSelected;
   int32_t colIndex = 0;
 
   // Prevent rules testing until we're done
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(*
-                                      this, EditSubAction::deleteNode,
+                                      this, EditSubAction::eDeleteNode,
                                       nsIEditor::eNext);
 
   // The list of cells we will change rowspan in
   //  and the new rowspan values for each
   nsTArray<RefPtr<Element> > spanCellList;
   nsTArray<int32_t> newSpanList;
 
   int32_t rowCount, colCount;
@@ -2152,17 +2152,17 @@ HTMLEditor::JoinTableCells(bool aMergeNo
           }
         }
       }
     }
 
     // All cell contents are merged. Delete the empty cells we accumulated
     // Prevent rules testing until we're done
     AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                        *this, EditSubAction::deleteNode,
+                                        *this, EditSubAction::eDeleteNode,
                                         nsIEditor::eNext);
 
     for (uint32_t i = 0, n = deleteList.Length(); i < n; i++) {
       RefPtr<Element> nodeToBeRemoved = deleteList[i];
       if (nodeToBeRemoved) {
         rv = DeleteNodeWithTransaction(*nodeToBeRemoved);
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return rv;
@@ -2268,17 +2268,17 @@ nsresult
 HTMLEditor::MergeCells(RefPtr<Element> aTargetCell,
                        RefPtr<Element> aCellToMerge,
                        bool aDeleteCellToMerge)
 {
   NS_ENSURE_TRUE(aTargetCell && aCellToMerge, NS_ERROR_NULL_POINTER);
 
   // Prevent rules testing until we're done
   AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
-                                      *this, EditSubAction::deleteNode,
+                                      *this, EditSubAction::eDeleteNode,
                                       nsIEditor::eNext);
 
   // Don't need to merge if cell is empty
   if (!IsEmptyCell(aCellToMerge)) {
     // Get index of last child in target cell
     // If we fail or don't have children,
     //  we insert at index 0
     int32_t insertIndex = 0;