Bug 1278014 part.4 Rename SelectionType::SELECTION_NONE to SelectionType::eNone r?smaug draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 09 Jun 2016 18:07:18 +0900
changeset 377649 af4076e96f5a3559c8e05e95f6dbfceb7edbc559
parent 377648 dd16a236ffd9fa152f2a985c63c4e7263845a994
child 377650 c9ebef101aab87cc3ddd9132bbf148071dde686a
push id20850
push usermasayuki@d-toybox.com
push dateSat, 11 Jun 2016 06:51:43 +0000
reviewerssmaug
bugs1278014
milestone50.0a1
Bug 1278014 part.4 Rename SelectionType::SELECTION_NONE to SelectionType::eNone r?smaug MozReview-Commit-ID: BRfzs8sColP
dom/base/nsISelectionController.idl
layout/generic/nsSelection.cpp
layout/generic/nsTextFrame.cpp
--- a/dom/base/nsISelectionController.idl
+++ b/dom/base/nsISelectionController.idl
@@ -280,17 +280,17 @@ interface nsISelectionController : nsISe
    { 0xb6, 0xf9, 0x0b, 0x8a, 0xe4, 0x37, 0x2a, 0x3b }}
 
 namespace mozilla {
 
 typedef short RawSelectionType;
 enum class SelectionType : RawSelectionType
 {
   eInvalid = -1,
-  SELECTION_NONE = nsISelectionController::SELECTION_NONE,
+  eNone = nsISelectionController::SELECTION_NONE,
   SELECTION_NORMAL = nsISelectionController::SELECTION_NORMAL,
   SELECTION_SPELLCHECK = nsISelectionController::SELECTION_SPELLCHECK,
   SELECTION_IME_RAWINPUT = nsISelectionController::SELECTION_IME_RAWINPUT,
   SELECTION_IME_SELECTEDRAWTEXT =
     nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT,
   SELECTION_IME_CONVERTEDTEXT =
     nsISelectionController::SELECTION_IME_CONVERTEDTEXT,
   SELECTION_IME_SELECTEDCONVERTEDTEXT =
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -110,17 +110,17 @@ static void printRange(nsRange *aDomRang
 namespace mozilla {
 
 const char*
 ToChar(SelectionType aSelectionType)
 {
   switch (aSelectionType) {
     case SelectionType::eInvalid:
       return "SelectionType::eInvalid";
-    case SelectionType::SELECTION_NONE:
+    case SelectionType::eNone:
       return "SelectionType::eNone";
     case SelectionType::SELECTION_NORMAL:
       return "SelectionType::eNormal";
     case SelectionType::SELECTION_SPELLCHECK:
       return "SelectionType::eSpellCheck";
     case SelectionType::SELECTION_IME_RAWINPUT:
       return "SelectionType::eIMERawClause";
     case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
@@ -141,17 +141,17 @@ ToChar(SelectionType aSelectionType)
       return "Invalid SelectionType";
   }
 }
 
 static bool
 IsValidSelectionType(RawSelectionType aRawSelectionType)
 {
   switch (static_cast<SelectionType>(aRawSelectionType)) {
-    case SelectionType::SELECTION_NONE:
+    case SelectionType::eNone:
     case SelectionType::SELECTION_NORMAL:
     case SelectionType::SELECTION_SPELLCHECK:
     case SelectionType::SELECTION_IME_RAWINPUT:
     case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
     case SelectionType::SELECTION_IME_CONVERTEDTEXT:
     case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
     case SelectionType::SELECTION_ACCESSIBILITY:
     case SelectionType::SELECTION_FIND:
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -5777,17 +5777,17 @@ bool SelectionIterator::GetNextSegment(g
     return false;
   
   // save offset into transformed string now
   uint32_t runOffset = mIterator.GetSkippedOffset();
   
   uint32_t index = mIterator.GetOriginalOffset() - mOriginalRange.start;
   SelectionDetails* sdptr = mSelectionDetails[index];
   SelectionType selectionType =
-    sdptr ? sdptr->mSelectionType : SelectionType::SELECTION_NONE;
+    sdptr ? sdptr->mSelectionType : SelectionType::eNone;
   TextRangeStyle style;
   if (sdptr) {
     style = sdptr->mTextRangeStyle;
   }
   for (++index; index < mOriginalRange.Length(); ++index) {
     if (sdptr != mSelectionDetails[index])
       break;
   }
@@ -6287,22 +6287,22 @@ nsTextFrame::GetCaretColorAt(int32_t aOf
       isSolidTextColor = false;
     }
   }
 
   nsTextPaintStyle textPaintStyle(this);
   textPaintStyle.SetResolveColors(isSolidTextColor);
   SelectionDetails* details = GetSelectionDetails();
   SelectionDetails* sdptr = details;
-  SelectionType selectionType = SelectionType::SELECTION_NONE;
+  SelectionType selectionType = SelectionType::eNone;
   while (sdptr) {
     int32_t start = std::max(0, sdptr->mStart - contentOffset);
     int32_t end = std::min(contentLength, sdptr->mEnd - contentOffset);
     if (start <= offsetInFrame && offsetInFrame < end &&
-        (selectionType == SelectionType::SELECTION_NONE ||
+        (selectionType == SelectionType::eNone ||
          sdptr->mSelectionType < selectionType)) {
       nscolor foreground, background;
       if (GetSelectionTextColors(sdptr->mSelectionType, textPaintStyle,
                                  sdptr->mTextRangeStyle,
                                  &foreground, &background)) {
         if (!isSolidTextColor &&
             NS_IS_SELECTION_SPECIAL_COLOR(foreground)) {
           result = NS_RGBA(0, 0, 0, 255);