Bug 1277756 part.4 Rename TextRangeType::NS_TEXTRANGE_RAWINPUT to TextRangeType::eRawClause r=smaug

MozReview-Commit-ID: KLC1VPiYTdz

--HG--
extra : rebase_source : 3f750e526bb04b26ed66d2c0fada14e7d5b43d73
This commit is contained in:
Masayuki Nakano 2016-06-03 18:48:37 +09:00
parent 6b5425853a
commit f4254e7f7f
12 changed files with 18 additions and 19 deletions

View File

@ -886,7 +886,7 @@ nsPluginInstanceOwner::GetCompositionString(uint32_t aType,
for (TextRange& range : *ranges) { for (TextRange& range : *ranges) {
uint8_t type = ATTR_INPUT; uint8_t type = ATTR_INPUT;
switch(range.mRangeType) { switch(range.mRangeType) {
case TextRangeType::NS_TEXTRANGE_RAWINPUT: case TextRangeType::eRawClause:
type = ATTR_INPUT; type = ATTR_INPUT;
break; break;
case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT: case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT:

View File

@ -138,7 +138,7 @@ static SelectionType
ToSelectionType(TextRangeType aTextRangeType) ToSelectionType(TextRangeType aTextRangeType)
{ {
switch (aTextRangeType) { switch (aTextRangeType) {
case TextRangeType::NS_TEXTRANGE_RAWINPUT: case TextRangeType::eRawClause:
return nsISelectionController::SELECTION_IME_RAWINPUT; return nsISelectionController::SELECTION_IME_RAWINPUT;
case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT: case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT:
return nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT; return nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT;

View File

@ -2422,7 +2422,7 @@ nsEditor::InsertTextIntoTextNodeImpl(const nsAString& aStringToInsert,
for (uint32_t i = 0; i < (ranges ? ranges->Length() : 0); ++i) { for (uint32_t i = 0; i < (ranges ? ranges->Length() : 0); ++i) {
const TextRange& textRange = ranges->ElementAt(i); const TextRange& textRange = ranges->ElementAt(i);
if (!textRange.Length() || if (!textRange.Length() ||
textRange.mRangeType != TextRangeType::NS_TEXTRANGE_RAWINPUT) { textRange.mRangeType != TextRangeType::eRawClause) {
continue; continue;
} }
if (!mPhonetic) { if (!mPhonetic) {

View File

@ -624,7 +624,7 @@ TextEventDispatcher::PendingComposition::AppendClause(
} }
switch (aTextRangeType) { switch (aTextRangeType) {
case TextRangeType::NS_TEXTRANGE_RAWINPUT: case TextRangeType::eRawClause:
case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT: case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT:
case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT: case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT:
case TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT: { case TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT: {
@ -669,7 +669,7 @@ TextEventDispatcher::PendingComposition::Set(const nsAString& aString,
if (!aRanges || aRanges->IsEmpty()) { if (!aRanges || aRanges->IsEmpty()) {
// Create dummy range if aString isn't empty. // Create dummy range if aString isn't empty.
if (!aString.IsEmpty()) { if (!aString.IsEmpty()) {
rv = AppendClause(str.Length(), TextRangeType::NS_TEXTRANGE_RAWINPUT); rv = AppendClause(str.Length(), TextRangeType::eRawClause);
if (NS_WARN_IF(NS_FAILED(rv))) { if (NS_WARN_IF(NS_FAILED(rv))) {
return rv; return rv;
} }

View File

@ -152,7 +152,7 @@ public:
* the pending composition string. * the pending composition string.
* *
* @param aLength Length of the clause. * @param aLength Length of the clause.
* @param aTextRangeType One of NS_TEXTRANGE_RAWINPUT, * @param aTextRangeType One of TextRangeType::eRawClause,
* NS_TEXTRANGE_SELECTEDRAWTEXT, * NS_TEXTRANGE_SELECTEDRAWTEXT,
* NS_TEXTRANGE_CONVERTEDTEXT or * NS_TEXTRANGE_CONVERTEDTEXT or
* NS_TEXTRANGE_SELECTEDCONVERTEDTEXT. * NS_TEXTRANGE_SELECTEDCONVERTEDTEXT.

View File

@ -132,8 +132,7 @@ enum class TextRangeType : RawTextRangeType
{ {
eUninitialized = 0x00, eUninitialized = 0x00,
eCaret = 0x01, eCaret = 0x01,
NS_TEXTRANGE_RAWINPUT = eRawClause = nsITextInputProcessor::ATTR_RAW_CLAUSE,
nsITextInputProcessor::ATTR_RAW_CLAUSE,
NS_TEXTRANGE_SELECTEDRAWTEXT = NS_TEXTRANGE_SELECTEDRAWTEXT =
nsITextInputProcessor::ATTR_SELECTED_RAW_CLAUSE, nsITextInputProcessor::ATTR_SELECTED_RAW_CLAUSE,
NS_TEXTRANGE_CONVERTEDTEXT = NS_TEXTRANGE_CONVERTEDTEXT =

View File

@ -63,7 +63,7 @@ IsValidRawTextRangeValue(RawTextRangeType aRawTextRangeType)
switch (static_cast<TextRangeType>(aRawTextRangeType)) { switch (static_cast<TextRangeType>(aRawTextRangeType)) {
case TextRangeType::eUninitialized: case TextRangeType::eUninitialized:
case TextRangeType::eCaret: case TextRangeType::eCaret:
case TextRangeType::NS_TEXTRANGE_RAWINPUT: case TextRangeType::eRawClause:
case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT: case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT:
case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT: case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT:
case TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT: case TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT:
@ -94,8 +94,8 @@ ToChar(TextRangeType aTextRangeType)
return "TextRangeType::eUninitialized"; return "TextRangeType::eUninitialized";
case TextRangeType::eCaret: case TextRangeType::eCaret:
return "TextRangeType::eCaret"; return "TextRangeType::eCaret";
case TextRangeType::NS_TEXTRANGE_RAWINPUT: case TextRangeType::eRawClause:
return "NS_TEXTRANGE_RAWINPUT"; return "TextRangeType::eRawClause";
case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT: case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT:
return "NS_TEXTRANGE_SELECTEDRAWTEXT"; return "NS_TEXTRANGE_SELECTEDRAWTEXT";
case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT: case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT:

View File

@ -3147,7 +3147,7 @@ nsWindow::GeckoViewSupport::OnImeReplaceText(int32_t aStart, int32_t aEnd,
TextRange range; TextRange range;
range.mStartOffset = 0; range.mStartOffset = 0;
range.mEndOffset = event.mData.Length(); range.mEndOffset = event.mData.Length();
range.mRangeType = TextRangeType::NS_TEXTRANGE_RAWINPUT; range.mRangeType = TextRangeType::eRawClause;
event.mRanges = new TextRangeArray(); event.mRanges = new TextRangeArray();
event.mRanges->AppendElement(range); event.mRanges->AppendElement(range);
} }

View File

@ -2740,7 +2740,7 @@ IMEInputHandler::ConvertToTextRangeType(uint32_t aUnderlineStyle,
if (aSelectedRange.length == 0) { if (aSelectedRange.length == 0) {
switch (aUnderlineStyle) { switch (aUnderlineStyle) {
case NSUnderlineStyleSingle: case NSUnderlineStyleSingle:
return TextRangeType::NS_TEXTRANGE_RAWINPUT; return TextRangeType::eRawClause;
case NSUnderlineStyleThick: case NSUnderlineStyleThick:
return TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT; return TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT;
default: default:

View File

@ -1830,7 +1830,7 @@ IMContextWrapper::SetTextRange(PangoAttrIterator* aPangoAttrIter,
* 3: If only attrForground is specified, we assumed the clause is * 3: If only attrForground is specified, we assumed the clause is
* NS_TEXTRANGE_SELECTEDRAWTEXT. * NS_TEXTRANGE_SELECTEDRAWTEXT.
* 4: If neither attrUnderline nor attrForeground is specified, we assumed * 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 * However, this rules are odd since there can be two or more selected
* clauses. Additionally, our old rules caused that IME developers/users * clauses. Additionally, our old rules caused that IME developers/users
@ -1852,7 +1852,7 @@ IMContextWrapper::SetTextRange(PangoAttrIterator* aPangoAttrIter,
if (!utf8ClauseStart && if (!utf8ClauseStart &&
utf8ClauseEnd == static_cast<gint>(strlen(aUTF8CompositionString)) && utf8ClauseEnd == static_cast<gint>(strlen(aUTF8CompositionString)) &&
aTextRange.mEndOffset == aUTF16CaretOffset) { 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. // 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 // So, if the caret is in the clause, we can assume that the clause is

View File

@ -1896,7 +1896,7 @@ PlatformToNSAttr(uint8_t aAttr)
case ATTR_INPUT_ERROR: case ATTR_INPUT_ERROR:
// case ATTR_FIXEDCONVERTED: // case ATTR_FIXEDCONVERTED:
case ATTR_INPUT: case ATTR_INPUT:
return TextRangeType::NS_TEXTRANGE_RAWINPUT; return TextRangeType::eRawClause;
case ATTR_CONVERTED: case ATTR_CONVERTED:
return TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT; return TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT;
case ATTR_TARGET_NOTCONVERTED: case ATTR_TARGET_NOTCONVERTED:

View File

@ -2056,7 +2056,7 @@ GetGeckoSelectionValue(TF_DISPLAYATTRIBUTE& aDisplayAttr)
case TF_ATTR_TARGET_NOTCONVERTED: case TF_ATTR_TARGET_NOTCONVERTED:
return TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT; return TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT;
default: 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 // we always pass in at least one range to eCompositionChange
newRange.mStartOffset = 0; newRange.mStartOffset = 0;
newRange.mEndOffset = action->mData.Length(); newRange.mEndOffset = action->mData.Length();
newRange.mRangeType = TextRangeType::NS_TEXTRANGE_RAWINPUT; newRange.mRangeType = TextRangeType::eRawClause;
action->mRanges->AppendElement(newRange); action->mRanges->AppendElement(newRange);
RefPtr<ITfRange> range; RefPtr<ITfRange> range;
@ -2473,7 +2473,7 @@ TSFTextStore::RecordCompositionUpdateAction()
TF_DISPLAYATTRIBUTE attr; TF_DISPLAYATTRIBUTE attr;
hr = GetDisplayAttribute(attrPropetry, range, &attr); hr = GetDisplayAttribute(attrPropetry, range, &attr);
if (FAILED(hr)) { if (FAILED(hr)) {
newRange.mRangeType = TextRangeType::NS_TEXTRANGE_RAWINPUT; newRange.mRangeType = TextRangeType::eRawClause;
} else { } else {
newRange.mRangeType = GetGeckoSelectionValue(attr); newRange.mRangeType = GetGeckoSelectionValue(attr);
if (GetColor(attr.crText, newRange.mRangeStyle.mForegroundColor)) { if (GetColor(attr.crText, newRange.mRangeStyle.mForegroundColor)) {