Bug 1278014 part.12 Rename SelectionType::SELECTION_FIND to SelectionType::eFind r?smaug draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 09 Jun 2016 20:35:20 +0900
changeset 377657 2e67d576500ea47ef26deead22905c449325b3c9
parent 377656 f16f7b3b1424e983b73a46e1ae2285df85ee82d1
child 377658 2fde6f642814d5fe11c4db22d7666739eef82b6d
push id20850
push usermasayuki@d-toybox.com
push dateSat, 11 Jun 2016 06:51:43 +0000
reviewerssmaug
bugs1278014
milestone50.0a1
Bug 1278014 part.12 Rename SelectionType::SELECTION_FIND to SelectionType::eFind r?smaug MozReview-Commit-ID: BZxBnCDBghi
dom/base/nsISelectionController.idl
layout/generic/nsFrame.cpp
layout/generic/nsSelection.cpp
layout/generic/nsTextFrame.cpp
--- a/dom/base/nsISelectionController.idl
+++ b/dom/base/nsISelectionController.idl
@@ -289,17 +289,17 @@ enum class SelectionType : RawSelectionT
   eNormal = nsISelectionController::SELECTION_NORMAL,
   eSpellCheck = nsISelectionController::SELECTION_SPELLCHECK,
   eIMERawClause = nsISelectionController::SELECTION_IME_RAWINPUT,
   eIMESelectedRawClause = nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT,
   eIMEConvertedClause = nsISelectionController::SELECTION_IME_CONVERTEDTEXT,
   eIMESelectedClause =
     nsISelectionController::SELECTION_IME_SELECTEDCONVERTEDTEXT,
   eAccessibility = nsISelectionController::SELECTION_ACCESSIBILITY,
-  SELECTION_FIND = nsISelectionController::SELECTION_FIND,
+  eFind = nsISelectionController::SELECTION_FIND,
   SELECTION_URLSECONDARY = nsISelectionController::SELECTION_URLSECONDARY,
   SELECTION_URLSTRIKEOUT = nsISelectionController::SELECTION_URLSTRIKEOUT,
 };
 
 // Using anonymous enum to define constants because these constants may be
 // used at defining fixed size array in some header files (e.g.,
 // nsFrameSelection.h).  So, the values needs to be defined here, but we cannot
 // use static/const even with extern since it causes failing to link or
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -3371,17 +3371,17 @@ nsFrame::HandlePress(nsPresContext* aPre
     {
       //
       // If the user clicked inside a selection, then just
       // return without doing anything. We will handle placing
       // the caret later on when the mouse is released. We ignore
       // the spellcheck, find and url formatting selections.
       //
       if (curDetail->mSelectionType != SelectionType::eSpellCheck &&
-          curDetail->mSelectionType != SelectionType::SELECTION_FIND &&
+          curDetail->mSelectionType != SelectionType::eFind &&
           curDetail->mSelectionType != SelectionType::SELECTION_URLSECONDARY &&
           curDetail->mSelectionType != SelectionType::SELECTION_URLSTRIKEOUT &&
           curDetail->mStart <= offsets.StartOffset() &&
           offsets.EndOffset() <= curDetail->mEnd)
       {
         inSelection = true;
       }
 
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -126,17 +126,17 @@ ToChar(SelectionType aSelectionType)
     case SelectionType::eIMESelectedRawClause:
       return "SelectionType::eIMESelectedRawClause";
     case SelectionType::eIMEConvertedClause:
       return "SelectionType::eIMEConvertedClause";
     case SelectionType::eIMESelectedClause:
       return "SelectionType::eIMESelectedClause";
     case SelectionType::eAccessibility:
       return "SelectionType::eAccessibility";
-    case SelectionType::SELECTION_FIND:
+    case SelectionType::eFind:
       return "SelectionType::eFind";
     case SelectionType::SELECTION_URLSECONDARY:
       return "SelectionType::eURLSecondary";
     case SelectionType::SELECTION_URLSTRIKEOUT:
       return "SelectionType::eURLStrikeout";
     default:
       return "Invalid SelectionType";
   }
@@ -149,17 +149,17 @@ IsValidSelectionType(RawSelectionType aR
     case SelectionType::eNone:
     case SelectionType::eNormal:
     case SelectionType::eSpellCheck:
     case SelectionType::eIMERawClause:
     case SelectionType::eIMESelectedRawClause:
     case SelectionType::eIMEConvertedClause:
     case SelectionType::eIMESelectedClause:
     case SelectionType::eAccessibility:
-    case SelectionType::SELECTION_FIND:
+    case SelectionType::eFind:
     case SelectionType::SELECTION_URLSECONDARY:
     case SelectionType::SELECTION_URLSTRIKEOUT:
       return true;
     default:
       return false;
   }
 }
 
@@ -360,17 +360,17 @@ GetIndexFromSelectionType(SelectionType 
     case SelectionType::eIMESelectedRawClause:
       return 3;
     case SelectionType::eIMEConvertedClause:
       return 4;
     case SelectionType::eIMESelectedClause:
       return 5;
     case SelectionType::eAccessibility:
       return 6;
-    case SelectionType::SELECTION_FIND:
+    case SelectionType::eFind:
       return 7;
     case SelectionType::SELECTION_URLSECONDARY:
       return 8;
     case SelectionType::SELECTION_URLSTRIKEOUT:
       return 9;
     default:
       return -1;
   }
@@ -383,17 +383,17 @@ GetSelectionTypeFromIndex(int8_t aIndex)
   static const SelectionType kSelectionTypes[] = {
     SelectionType::eNormal,
     SelectionType::eSpellCheck,
     SelectionType::eIMERawClause,
     SelectionType::eIMESelectedRawClause,
     SelectionType::eIMEConvertedClause,
     SelectionType::eIMESelectedClause,
     SelectionType::eAccessibility,
-    SelectionType::SELECTION_FIND,
+    SelectionType::eFind,
     SelectionType::SELECTION_URLSECONDARY,
     SelectionType::SELECTION_URLSTRIKEOUT
   };
   if (NS_WARN_IF(aIndex < 0) ||
       NS_WARN_IF(static_cast<size_t>(aIndex) >= ArrayLength(kSelectionTypes))) {
     return SelectionType::eNormal;
   }
   return kSelectionTypes[aIndex];
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -5634,17 +5634,17 @@ nsTextFrame::GetSelectionTextColors(Sele
                                     nsTextPaintStyle& aTextPaintStyle,
                                     const TextRangeStyle &aRangeStyle,
                                     nscolor* aForeground,
                                     nscolor* aBackground)
 {
   switch (aSelectionType) {
     case SelectionType::eNormal:
       return aTextPaintStyle.GetSelectionColors(aForeground, aBackground);
-    case SelectionType::SELECTION_FIND:
+    case SelectionType::eFind:
       aTextPaintStyle.GetHighlightColors(aForeground, aBackground);
       return true;
     case SelectionType::SELECTION_URLSECONDARY:
       aTextPaintStyle.GetURLSecondaryColor(aForeground);
       *aBackground = NS_RGBA(0,0,0,0);
       return true;
     case SelectionType::eIMERawClause:
     case SelectionType::eIMESelectedRawClause: