Bug 1277756 part.6 Rename TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT to TextRangeType::eConvertedClause r?smaug draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 03 Jun 2016 19:05:32 +0900
changeset 375350 6c66c1b00dc08deb6e85817edd0b369b5040994e
parent 375349 967110e61dc2013eaf0103fe5653e8f1055573e4
child 375351 51b69fdbdbc9eff618b08c745db57bce8448bcf6
push id20248
push usermasayuki@d-toybox.com
push dateSat, 04 Jun 2016 00:57:57 +0000
reviewerssmaug
bugs1277756
milestone49.0a1
Bug 1277756 part.6 Rename TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT to TextRangeType::eConvertedClause r?smaug MozReview-Commit-ID: 3mexBm278As
dom/plugins/base/nsPluginInstanceOwner.cpp
editor/libeditor/IMETextTxn.cpp
widget/TextEventDispatcher.cpp
widget/TextEventDispatcher.h
widget/TextRange.h
widget/WidgetEventImpl.cpp
widget/cocoa/TextInputHandler.mm
widget/gtk/IMContextWrapper.cpp
widget/windows/IMMHandler.cpp
widget/windows/TSFTextStore.cpp
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -887,17 +887,17 @@ nsPluginInstanceOwner::GetCompositionStr
         uint8_t type = ATTR_INPUT;
         switch(range.mRangeType) {
           case TextRangeType::eRawClause:
             type = ATTR_INPUT;
             break;
           case TextRangeType::eSelectedRawClause:
             type = ATTR_TARGET_NOTCONVERTED;
             break;
-          case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT:
+          case TextRangeType::eConvertedClause:
             type = ATTR_CONVERTED;
             break;
           case TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT:
             type = ATTR_TARGET_CONVERTED;
             break;
           default:
             continue;
         }
--- a/editor/libeditor/IMETextTxn.cpp
+++ b/editor/libeditor/IMETextTxn.cpp
@@ -137,17 +137,17 @@ IMETextTxn::GetTxnDescription(nsAString&
 static SelectionType
 ToSelectionType(TextRangeType aTextRangeType)
 {
   switch (aTextRangeType) {
     case TextRangeType::eRawClause:
       return nsISelectionController::SELECTION_IME_RAWINPUT;
     case TextRangeType::eSelectedRawClause:
       return nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT;
-    case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT:
+    case TextRangeType::eConvertedClause:
       return nsISelectionController::SELECTION_IME_CONVERTEDTEXT;
     case TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT:
       return nsISelectionController::SELECTION_IME_SELECTEDCONVERTEDTEXT;
     default:
       MOZ_CRASH("Selection type is invalid");
       return nsISelectionController::SELECTION_NORMAL;
   }
 }
--- a/widget/TextEventDispatcher.cpp
+++ b/widget/TextEventDispatcher.cpp
@@ -621,17 +621,17 @@ TextEventDispatcher::PendingComposition:
 {
   if (NS_WARN_IF(!aLength)) {
     return NS_ERROR_INVALID_ARG;
   }
 
   switch (aTextRangeType) {
     case TextRangeType::eRawClause:
     case TextRangeType::eSelectedRawClause:
-    case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT:
+    case TextRangeType::eConvertedClause:
     case TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT: {
       EnsureClauseArray();
       TextRange textRange;
       textRange.mStartOffset =
         mClauses->IsEmpty() ? 0 : mClauses->LastElement().mEndOffset;
       textRange.mEndOffset = textRange.mStartOffset + aLength;
       textRange.mRangeType = aTextRangeType;
       mClauses->AppendElement(textRange);
--- a/widget/TextEventDispatcher.h
+++ b/widget/TextEventDispatcher.h
@@ -149,17 +149,17 @@ public:
 
   /**
    * AppendClauseToPendingComposition() appends a clause information to
    * the pending composition string.
    *
    * @param aLength         Length of the clause.
    * @param aTextRangeType  One of TextRangeType::eRawClause,
    *                        TextRangeType::eSelectedRawClause,
-   *                        NS_TEXTRANGE_CONVERTEDTEXT or
+   *                        TextRangeType::eConvertedClause or
    *                        NS_TEXTRANGE_SELECTEDCONVERTEDTEXT.
    */
   nsresult AppendClauseToPendingComposition(uint32_t aLength,
                                             TextRangeType aTextRangeType)
   {
     return mPendingComposition.AppendClause(aLength, aTextRangeType);
   }
 
--- a/widget/TextRange.h
+++ b/widget/TextRange.h
@@ -129,18 +129,17 @@ struct TextRangeStyle
  ******************************************************************************/
 
 enum class TextRangeType : RawTextRangeType
 {
   eUninitialized = 0x00,
   eCaret = 0x01,
   eRawClause = nsITextInputProcessor::ATTR_RAW_CLAUSE,
   eSelectedRawClause = nsITextInputProcessor::ATTR_SELECTED_RAW_CLAUSE,
-  NS_TEXTRANGE_CONVERTEDTEXT =
-    nsITextInputProcessor::ATTR_CONVERTED_CLAUSE,
+  eConvertedClause = nsITextInputProcessor::ATTR_CONVERTED_CLAUSE,
   NS_TEXTRANGE_SELECTEDCONVERTEDTEXT =
     nsITextInputProcessor::ATTR_SELECTED_CLAUSE
 };
 
 bool IsValidRawTextRangeValue(RawTextRangeType aRawTextRangeValue);
 RawTextRangeType ToRawTextRangeType(TextRangeType aTextRangeType);
 TextRangeType ToTextRangeType(RawTextRangeType aRawTextRangeType);
 const char* ToChar(TextRangeType aTextRangeType);
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -60,17 +60,17 @@ ToChar(EventClassID aEventClassID)
 bool
 IsValidRawTextRangeValue(RawTextRangeType aRawTextRangeType)
 {
   switch (static_cast<TextRangeType>(aRawTextRangeType)) {
     case TextRangeType::eUninitialized:
     case TextRangeType::eCaret:
     case TextRangeType::eRawClause:
     case TextRangeType::eSelectedRawClause:
-    case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT:
+    case TextRangeType::eConvertedClause:
     case TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT:
       return true;
     default:
       return false;
   }
 }
 
 RawTextRangeType
@@ -93,18 +93,18 @@ ToChar(TextRangeType aTextRangeType)
     case TextRangeType::eUninitialized:
       return "TextRangeType::eUninitialized";
     case TextRangeType::eCaret:
       return "TextRangeType::eCaret";
     case TextRangeType::eRawClause:
       return "TextRangeType::eRawClause";
     case TextRangeType::eSelectedRawClause:
       return "TextRangeType::eSelectedRawClause";
-    case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT:
-      return "NS_TEXTRANGE_CONVERTEDTEXT";
+    case TextRangeType::eConvertedClause:
+      return "TextRangeType::eConvertedClause";
     case TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT:
       return "NS_TEXTRANGE_SELECTEDCONVERTEDTEXT";
     default:
       return "Invalid TextRangeType";
   }
 }
 
 /******************************************************************************
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -2746,17 +2746,17 @@ IMEInputHandler::ConvertToTextRangeType(
       default:
         NS_WARNING("Unexpected line style");
         return TextRangeType::eSelectedRawClause;
     }
   }
 
   switch (aUnderlineStyle) {
     case NSUnderlineStyleSingle:
-      return TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT;
+      return TextRangeType::eConvertedClause;
     case NSUnderlineStyleThick:
       return TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT;
     default:
       NS_WARNING("Unexpected line style");
       return TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT;
   }
 }
 
--- a/widget/gtk/IMContextWrapper.cpp
+++ b/widget/gtk/IMContextWrapper.cpp
@@ -1821,17 +1821,17 @@ IMContextWrapper::SetTextRange(PangoAttr
 
     /**
      * We need to judge the meaning of the clause for a11y.  Before we support
      * IME specific composition string style, we used following rules:
      *
      *   1: If attrUnderline and attrForground are specified, we assumed the
      *      clause is NS_TEXTRANGE_SELECTEDCONVERTEDTEXT.
      *   2: If only attrUnderline is specified, we assumed the clause is
-     *      NS_TEXTRANGE_CONVERTEDTEXT.
+     *      TextRangeType::eConvertedClause.
      *   3: If only attrForground is specified, we assumed the clause is
      *      TextRangeType::eSelectedRawClause.
      *   4: If neither attrUnderline nor attrForeground is specified, we assumed
      *      the clause is TextRangeType::eRawClause.
      *
      * However, this rules are odd since there can be two or more selected
      * clauses.  Additionally, our old rules caused that IME developers/users
      * cannot specify composition string style as they want.
@@ -1859,17 +1859,17 @@ IMContextWrapper::SetTextRange(PangoAttr
     // selected.
     else if (aTextRange.mStartOffset <= aUTF16CaretOffset &&
              aTextRange.mEndOffset > aUTF16CaretOffset) {
         aTextRange.mRangeType = TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT;
     }
     // Otherwise, we should assume that the clause is converted but not
     // selected.
     else {
-        aTextRange.mRangeType = TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT;
+        aTextRange.mRangeType = TextRangeType::eConvertedClause;
     }
 
     MOZ_LOG(gGtkIMLog, LogLevel::Debug,
         ("GTKIM: %p   SetTextRange(), succeeded, aTextRange= { "
          "mStartOffset=%u, mEndOffset=%u, mRangeType=%s, mRangeStyle=%s }",
          this, aTextRange.mStartOffset, aTextRange.mEndOffset,
          ToChar(aTextRange.mRangeType),
          GetTextRangeStyleText(aTextRange.mRangeStyle).get()));
--- a/widget/windows/IMMHandler.cpp
+++ b/widget/windows/IMMHandler.cpp
@@ -1893,17 +1893,17 @@ PlatformToNSAttr(uint8_t aAttr)
 {
   switch (aAttr)
   {
     case ATTR_INPUT_ERROR:
     // case ATTR_FIXEDCONVERTED:
     case ATTR_INPUT:
       return TextRangeType::eRawClause;
     case ATTR_CONVERTED:
-      return TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT;
+      return TextRangeType::eConvertedClause;
     case ATTR_TARGET_NOTCONVERTED:
       return TextRangeType::eSelectedRawClause;
     case ATTR_TARGET_CONVERTED:
       return TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT;
     default:
       NS_ASSERTION(false, "unknown attribute");
       return TextRangeType::eCaret;
   }
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -2047,17 +2047,17 @@ GetRangeExtent(ITfRange* aRange, LONG* a
 
 static TextRangeType
 GetGeckoSelectionValue(TF_DISPLAYATTRIBUTE& aDisplayAttr)
 {
   switch (aDisplayAttr.bAttr) {
     case TF_ATTR_TARGET_CONVERTED:
       return TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT;
     case TF_ATTR_CONVERTED:
-      return TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT;
+      return TextRangeType::eConvertedClause;
     case TF_ATTR_TARGET_NOTCONVERTED:
       return TextRangeType::eSelectedRawClause;
     default:
       return TextRangeType::eRawClause;
   }
 }
 
 HRESULT