Bug 1277756 part.1 Make anonymous enum for NS_TEXTRANGE_* to an enum class named "TextRangeType" r=smaug

For making our code clearer by the stronger type check, we should change the anonymous enum for NS_TEXTRANGE_* to enum class whose name is "TextRangeType" and whose type is "RawTextRangeType" which is an alias of uint8_t.

Additionally, this also adds some utility methods for them.

Note that some lines which are changed by this patch become over 80 characters but it will be fixed by the following patches.

MozReview-Commit-ID: 76izA1WqTkp
This commit is contained in:
Masayuki Nakano
2016-06-04 09:49:21 +09:00
parent 89e835de7b
commit afa7c7379f
16 changed files with 155 additions and 150 deletions

View File

@@ -886,16 +886,16 @@ nsPluginInstanceOwner::GetCompositionString(uint32_t aType,
for (TextRange& range : *ranges) {
uint8_t type = ATTR_INPUT;
switch(range.mRangeType) {
case NS_TEXTRANGE_RAWINPUT:
case TextRangeType::NS_TEXTRANGE_RAWINPUT:
type = ATTR_INPUT;
break;
case NS_TEXTRANGE_SELECTEDRAWTEXT:
case TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT:
type = ATTR_TARGET_NOTCONVERTED;
break;
case NS_TEXTRANGE_CONVERTEDTEXT:
case TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT:
type = ATTR_CONVERTED;
break;
case NS_TEXTRANGE_SELECTEDCONVERTEDTEXT:
case TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT:
type = ATTR_TARGET_CONVERTED;
break;
default: