From f4254e7f7fa69b8819b003b952cf52513cdc1f77 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Fri, 3 Jun 2016 18:48:37 +0900 Subject: [PATCH] Bug 1277756 part.4 Rename TextRangeType::NS_TEXTRANGE_RAWINPUT to TextRangeType::eRawClause r=smaug MozReview-Commit-ID: KLC1VPiYTdz --HG-- extra : rebase_source : 3f750e526bb04b26ed66d2c0fada14e7d5b43d73 --- dom/plugins/base/nsPluginInstanceOwner.cpp | 2 +- editor/libeditor/IMETextTxn.cpp | 2 +- editor/libeditor/nsEditor.cpp | 2 +- widget/TextEventDispatcher.cpp | 4 ++-- widget/TextEventDispatcher.h | 2 +- widget/TextRange.h | 3 +-- widget/WidgetEventImpl.cpp | 6 +++--- widget/android/nsWindow.cpp | 2 +- widget/cocoa/TextInputHandler.mm | 2 +- widget/gtk/IMContextWrapper.cpp | 4 ++-- widget/windows/IMMHandler.cpp | 2 +- widget/windows/TSFTextStore.cpp | 6 +++--- 12 files changed, 18 insertions(+), 19 deletions(-) diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index a5745159b8dc..af09e8d0a3ca 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -886,7 +886,7 @@ nsPluginInstanceOwner::GetCompositionString(uint32_t aType, for (TextRange& range : *ranges) { uint8_t type = ATTR_INPUT; switch(range.mRangeType) { - case TextRangeType::NS_TEXTRANGE_RAWINPUT: + case TextRangeType::eRawClause: type = ATTR_INPUT; break; case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT: diff --git a/editor/libeditor/IMETextTxn.cpp b/editor/libeditor/IMETextTxn.cpp index 11a4cf0059fc..51333f781140 100644 --- a/editor/libeditor/IMETextTxn.cpp +++ b/editor/libeditor/IMETextTxn.cpp @@ -138,7 +138,7 @@ static SelectionType ToSelectionType(TextRangeType aTextRangeType) { switch (aTextRangeType) { - case TextRangeType::NS_TEXTRANGE_RAWINPUT: + case TextRangeType::eRawClause: return nsISelectionController::SELECTION_IME_RAWINPUT; case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT: return nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT; diff --git a/editor/libeditor/nsEditor.cpp b/editor/libeditor/nsEditor.cpp index aba7ef4e846a..732384ed3b4b 100644 --- a/editor/libeditor/nsEditor.cpp +++ b/editor/libeditor/nsEditor.cpp @@ -2422,7 +2422,7 @@ nsEditor::InsertTextIntoTextNodeImpl(const nsAString& aStringToInsert, for (uint32_t i = 0; i < (ranges ? ranges->Length() : 0); ++i) { const TextRange& textRange = ranges->ElementAt(i); if (!textRange.Length() || - textRange.mRangeType != TextRangeType::NS_TEXTRANGE_RAWINPUT) { + textRange.mRangeType != TextRangeType::eRawClause) { continue; } if (!mPhonetic) { diff --git a/widget/TextEventDispatcher.cpp b/widget/TextEventDispatcher.cpp index efcdbdf6df3f..b8d614835ec4 100644 --- a/widget/TextEventDispatcher.cpp +++ b/widget/TextEventDispatcher.cpp @@ -624,7 +624,7 @@ TextEventDispatcher::PendingComposition::AppendClause( } switch (aTextRangeType) { - case TextRangeType::NS_TEXTRANGE_RAWINPUT: + case TextRangeType::eRawClause: case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT: case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT: case TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT: { @@ -669,7 +669,7 @@ TextEventDispatcher::PendingComposition::Set(const nsAString& aString, if (!aRanges || aRanges->IsEmpty()) { // Create dummy range if aString isn't empty. if (!aString.IsEmpty()) { - rv = AppendClause(str.Length(), TextRangeType::NS_TEXTRANGE_RAWINPUT); + rv = AppendClause(str.Length(), TextRangeType::eRawClause); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } diff --git a/widget/TextEventDispatcher.h b/widget/TextEventDispatcher.h index d236d4621b96..53803c78911e 100644 --- a/widget/TextEventDispatcher.h +++ b/widget/TextEventDispatcher.h @@ -152,7 +152,7 @@ public: * the pending composition string. * * @param aLength Length of the clause. - * @param aTextRangeType One of NS_TEXTRANGE_RAWINPUT, + * @param aTextRangeType One of TextRangeType::eRawClause, * NS_TEXTRANGE_SELECTEDRAWTEXT, * NS_TEXTRANGE_CONVERTEDTEXT or * NS_TEXTRANGE_SELECTEDCONVERTEDTEXT. diff --git a/widget/TextRange.h b/widget/TextRange.h index 58679414813d..0bfce6e6a683 100644 --- a/widget/TextRange.h +++ b/widget/TextRange.h @@ -132,8 +132,7 @@ enum class TextRangeType : RawTextRangeType { eUninitialized = 0x00, eCaret = 0x01, - NS_TEXTRANGE_RAWINPUT = - nsITextInputProcessor::ATTR_RAW_CLAUSE, + eRawClause = nsITextInputProcessor::ATTR_RAW_CLAUSE, NS_TEXTRANGE_SELECTEDRAWTEXT = nsITextInputProcessor::ATTR_SELECTED_RAW_CLAUSE, NS_TEXTRANGE_CONVERTEDTEXT = diff --git a/widget/WidgetEventImpl.cpp b/widget/WidgetEventImpl.cpp index 129b788d8dc9..2434ac81e258 100644 --- a/widget/WidgetEventImpl.cpp +++ b/widget/WidgetEventImpl.cpp @@ -63,7 +63,7 @@ IsValidRawTextRangeValue(RawTextRangeType aRawTextRangeType) switch (static_cast(aRawTextRangeType)) { case TextRangeType::eUninitialized: case TextRangeType::eCaret: - case TextRangeType::NS_TEXTRANGE_RAWINPUT: + case TextRangeType::eRawClause: case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT: case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT: case TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT: @@ -94,8 +94,8 @@ ToChar(TextRangeType aTextRangeType) return "TextRangeType::eUninitialized"; case TextRangeType::eCaret: return "TextRangeType::eCaret"; - case TextRangeType::NS_TEXTRANGE_RAWINPUT: - return "NS_TEXTRANGE_RAWINPUT"; + case TextRangeType::eRawClause: + return "TextRangeType::eRawClause"; case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT: return "NS_TEXTRANGE_SELECTEDRAWTEXT"; case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT: diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 3c18d9bc14d6..2442312e57fc 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -3147,7 +3147,7 @@ nsWindow::GeckoViewSupport::OnImeReplaceText(int32_t aStart, int32_t aEnd, TextRange range; range.mStartOffset = 0; range.mEndOffset = event.mData.Length(); - range.mRangeType = TextRangeType::NS_TEXTRANGE_RAWINPUT; + range.mRangeType = TextRangeType::eRawClause; event.mRanges = new TextRangeArray(); event.mRanges->AppendElement(range); } diff --git a/widget/cocoa/TextInputHandler.mm b/widget/cocoa/TextInputHandler.mm index cb993e1b99a1..73e995de41ce 100644 --- a/widget/cocoa/TextInputHandler.mm +++ b/widget/cocoa/TextInputHandler.mm @@ -2740,7 +2740,7 @@ IMEInputHandler::ConvertToTextRangeType(uint32_t aUnderlineStyle, if (aSelectedRange.length == 0) { switch (aUnderlineStyle) { case NSUnderlineStyleSingle: - return TextRangeType::NS_TEXTRANGE_RAWINPUT; + return TextRangeType::eRawClause; case NSUnderlineStyleThick: return TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT; default: diff --git a/widget/gtk/IMContextWrapper.cpp b/widget/gtk/IMContextWrapper.cpp index 52fced7a7be6..b963d979407b 100644 --- a/widget/gtk/IMContextWrapper.cpp +++ b/widget/gtk/IMContextWrapper.cpp @@ -1830,7 +1830,7 @@ IMContextWrapper::SetTextRange(PangoAttrIterator* aPangoAttrIter, * 3: If only attrForground is specified, we assumed the clause is * NS_TEXTRANGE_SELECTEDRAWTEXT. * 4: If neither attrUnderline nor attrForeground is specified, we assumed - * the clause is NS_TEXTRANGE_RAWINPUT. + * 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 @@ -1852,7 +1852,7 @@ IMContextWrapper::SetTextRange(PangoAttrIterator* aPangoAttrIter, if (!utf8ClauseStart && utf8ClauseEnd == static_cast(strlen(aUTF8CompositionString)) && aTextRange.mEndOffset == aUTF16CaretOffset) { - aTextRange.mRangeType = TextRangeType::NS_TEXTRANGE_RAWINPUT; + aTextRange.mRangeType = TextRangeType::eRawClause; } // Typically, the caret is set at the start of the selected clause. // So, if the caret is in the clause, we can assume that the clause is diff --git a/widget/windows/IMMHandler.cpp b/widget/windows/IMMHandler.cpp index 99f39e511b0f..95161d9683e5 100644 --- a/widget/windows/IMMHandler.cpp +++ b/widget/windows/IMMHandler.cpp @@ -1896,7 +1896,7 @@ PlatformToNSAttr(uint8_t aAttr) case ATTR_INPUT_ERROR: // case ATTR_FIXEDCONVERTED: case ATTR_INPUT: - return TextRangeType::NS_TEXTRANGE_RAWINPUT; + return TextRangeType::eRawClause; case ATTR_CONVERTED: return TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT; case ATTR_TARGET_NOTCONVERTED: diff --git a/widget/windows/TSFTextStore.cpp b/widget/windows/TSFTextStore.cpp index 4f78b22eb4be..a46d09f2d6ed 100644 --- a/widget/windows/TSFTextStore.cpp +++ b/widget/windows/TSFTextStore.cpp @@ -2056,7 +2056,7 @@ GetGeckoSelectionValue(TF_DISPLAYATTRIBUTE& aDisplayAttr) case TF_ATTR_TARGET_NOTCONVERTED: return TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT; default: - return TextRangeType::NS_TEXTRANGE_RAWINPUT; + return TextRangeType::eRawClause; } } @@ -2428,7 +2428,7 @@ TSFTextStore::RecordCompositionUpdateAction() // we always pass in at least one range to eCompositionChange newRange.mStartOffset = 0; newRange.mEndOffset = action->mData.Length(); - newRange.mRangeType = TextRangeType::NS_TEXTRANGE_RAWINPUT; + newRange.mRangeType = TextRangeType::eRawClause; action->mRanges->AppendElement(newRange); RefPtr range; @@ -2473,7 +2473,7 @@ TSFTextStore::RecordCompositionUpdateAction() TF_DISPLAYATTRIBUTE attr; hr = GetDisplayAttribute(attrPropetry, range, &attr); if (FAILED(hr)) { - newRange.mRangeType = TextRangeType::NS_TEXTRANGE_RAWINPUT; + newRange.mRangeType = TextRangeType::eRawClause; } else { newRange.mRangeType = GetGeckoSelectionValue(attr); if (GetColor(attr.crText, newRange.mRangeStyle.mForegroundColor)) {