Bug 1278014 part.9 Rename SelectionType::SELECTION_IME_CONVERTEDTEXT to SelectionType::eIMEConvertedClause r?smaug
MozReview-Commit-ID: 5UNqhB2ZEcZ
--- a/dom/base/nsISelectionController.idl
+++ b/dom/base/nsISelectionController.idl
@@ -285,18 +285,17 @@ typedef short RawSelectionType;
enum class SelectionType : RawSelectionType
{
eInvalid = -1,
eNone = nsISelectionController::SELECTION_NONE,
eNormal = nsISelectionController::SELECTION_NORMAL,
eSpellCheck = nsISelectionController::SELECTION_SPELLCHECK,
eIMERawClause = nsISelectionController::SELECTION_IME_RAWINPUT,
eIMESelectedRawClause = nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT,
- SELECTION_IME_CONVERTEDTEXT =
- nsISelectionController::SELECTION_IME_CONVERTEDTEXT,
+ eIMEConvertedClause = nsISelectionController::SELECTION_IME_CONVERTEDTEXT,
SELECTION_IME_SELECTEDCONVERTEDTEXT =
nsISelectionController::SELECTION_IME_SELECTEDCONVERTEDTEXT,
SELECTION_ACCESSIBILITY =
nsISelectionController::SELECTION_ACCESSIBILITY,
SELECTION_FIND = nsISelectionController::SELECTION_FIND,
SELECTION_URLSECONDARY = nsISelectionController::SELECTION_URLSECONDARY,
SELECTION_URLSTRIKEOUT = nsISelectionController::SELECTION_URLSTRIKEOUT,
};
--- a/editor/libeditor/nsEditor.cpp
+++ b/editor/libeditor/nsEditor.cpp
@@ -5143,17 +5143,17 @@ nsEditor::GetIMESelectionStartOffsetIn(n
nsresult rv = GetSelectionController(getter_AddRefs(selectionController));
NS_ENSURE_SUCCESS(rv, -1);
NS_ENSURE_TRUE(selectionController, -1);
int32_t minOffset = INT32_MAX;
static const SelectionType kIMESelectionTypes[] = {
SelectionType::eIMERawClause,
SelectionType::eIMESelectedRawClause,
- SelectionType::SELECTION_IME_CONVERTEDTEXT,
+ SelectionType::eIMEConvertedClause,
SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT
};
for (auto selectionType : kIMESelectionTypes) {
RefPtr<Selection> selection = GetSelection(selectionType);
if (!selection) {
continue;
}
for (uint32_t i = 0; i < selection->RangeCount(); i++) {
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -120,17 +120,17 @@ ToChar(SelectionType aSelectionType)
case SelectionType::eNormal:
return "SelectionType::eNormal";
case SelectionType::eSpellCheck:
return "SelectionType::eSpellCheck";
case SelectionType::eIMERawClause:
return "SelectionType::eIMERawClause";
case SelectionType::eIMESelectedRawClause:
return "SelectionType::eIMESelectedRawClause";
- case SelectionType::SELECTION_IME_CONVERTEDTEXT:
+ case SelectionType::eIMEConvertedClause:
return "SelectionType::eIMEConvertedClause";
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
return "SelectionType::eIMESelectedClause";
case SelectionType::SELECTION_ACCESSIBILITY:
return "SelectionType::eAccessibility";
case SelectionType::SELECTION_FIND:
return "SelectionType::eFind";
case SelectionType::SELECTION_URLSECONDARY:
@@ -146,17 +146,17 @@ static bool
IsValidSelectionType(RawSelectionType aRawSelectionType)
{
switch (static_cast<SelectionType>(aRawSelectionType)) {
case SelectionType::eNone:
case SelectionType::eNormal:
case SelectionType::eSpellCheck:
case SelectionType::eIMERawClause:
case SelectionType::eIMESelectedRawClause:
- case SelectionType::SELECTION_IME_CONVERTEDTEXT:
+ case SelectionType::eIMEConvertedClause:
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
case SelectionType::SELECTION_ACCESSIBILITY:
case SelectionType::SELECTION_FIND:
case SelectionType::SELECTION_URLSECONDARY:
case SelectionType::SELECTION_URLSTRIKEOUT:
return true;
default:
return false;
@@ -354,17 +354,17 @@ GetIndexFromSelectionType(SelectionType
case SelectionType::eNormal:
return 0;
case SelectionType::eSpellCheck:
return 1;
case SelectionType::eIMERawClause:
return 2;
case SelectionType::eIMESelectedRawClause:
return 3;
- case SelectionType::SELECTION_IME_CONVERTEDTEXT:
+ case SelectionType::eIMEConvertedClause:
return 4;
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
return 5;
case SelectionType::SELECTION_ACCESSIBILITY:
return 6;
case SelectionType::SELECTION_FIND:
return 7;
case SelectionType::SELECTION_URLSECONDARY:
@@ -380,17 +380,17 @@ GetIndexFromSelectionType(SelectionType
static SelectionType
GetSelectionTypeFromIndex(int8_t aIndex)
{
static const SelectionType kSelectionTypes[] = {
SelectionType::eNormal,
SelectionType::eSpellCheck,
SelectionType::eIMERawClause,
SelectionType::eIMESelectedRawClause,
- SelectionType::SELECTION_IME_CONVERTEDTEXT,
+ SelectionType::eIMEConvertedClause,
SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT,
SelectionType::SELECTION_ACCESSIBILITY,
SelectionType::SELECTION_FIND,
SelectionType::SELECTION_URLSECONDARY,
SelectionType::SELECTION_URLSTRIKEOUT
};
if (NS_WARN_IF(aIndex < 0) ||
NS_WARN_IF(static_cast<size_t>(aIndex) >= ArrayLength(kSelectionTypes))) {
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -343,17 +343,17 @@ public:
static int32_t GetUnderlineStyleIndexForSelectionType(
SelectionType aSelectionType)
{
switch (aSelectionType) {
case SelectionType::eIMERawClause:
return eIndexRawInput;
case SelectionType::eIMESelectedRawClause:
return eIndexSelRawText;
- case SelectionType::SELECTION_IME_CONVERTEDTEXT:
+ case SelectionType::eIMEConvertedClause:
return eIndexConvText;
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
return eIndexSelConvText;
case SelectionType::eSpellCheck:
return eIndexSpellChecker;
default:
NS_WARNING("non-IME selection type");
return eIndexRawInput;
@@ -5427,17 +5427,17 @@ gfxFloat
nsTextFrame::ComputeSelectionUnderlineHeight(
nsPresContext* aPresContext,
const gfxFont::Metrics& aFontMetrics,
SelectionType aSelectionType)
{
switch (aSelectionType) {
case SelectionType::eIMERawClause:
case SelectionType::eIMESelectedRawClause:
- case SelectionType::SELECTION_IME_CONVERTEDTEXT:
+ case SelectionType::eIMEConvertedClause:
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
return aFontMetrics.underlineSize;
case SelectionType::eSpellCheck: {
// The thickness of the spellchecker underline shouldn't honor the font
// metrics. It should be constant pixels value which is decided from the
// default font size. Note that if the actual font size is smaller than
// the default font size, we should use the actual font size because the
// computed value from the default font size can be too thick for the
@@ -5538,17 +5538,17 @@ nsTextFrame::DrawSelectionDecorations(gf
bool weDefineSelectionUnderline =
aTextPaintStyle.GetSelectionUnderlineForPaint(index, ¶ms.color,
&relativeSize, ¶ms.style);
switch (aSelectionType) {
case SelectionType::eIMERawClause:
case SelectionType::eIMESelectedRawClause:
- case SelectionType::SELECTION_IME_CONVERTEDTEXT:
+ case SelectionType::eIMEConvertedClause:
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT: {
// IME decoration lines should not be drawn on the both ends, i.e., we
// need to cut both edges of the decoration lines. Because same style
// IME selections can adjoin, but the users need to be able to know
// where are the boundaries of the selections.
//
// X: underline
//
@@ -5643,17 +5643,17 @@ nsTextFrame::GetSelectionTextColors(Sele
aTextPaintStyle.GetHighlightColors(aForeground, aBackground);
return true;
case SelectionType::SELECTION_URLSECONDARY:
aTextPaintStyle.GetURLSecondaryColor(aForeground);
*aBackground = NS_RGBA(0,0,0,0);
return true;
case SelectionType::eIMERawClause:
case SelectionType::eIMESelectedRawClause:
- case SelectionType::SELECTION_IME_CONVERTEDTEXT:
+ case SelectionType::eIMEConvertedClause:
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
if (aRangeStyle.IsDefined()) {
if (!aRangeStyle.IsForegroundColorDefined() &&
!aRangeStyle.IsBackgroundColorDefined()) {
*aForeground = aTextPaintStyle.GetTextColor();
*aBackground = NS_RGBA(0,0,0,0);
return false;
}
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -111,17 +111,17 @@ SelectionType
ToSelectionType(TextRangeType aTextRangeType)
{
switch (aTextRangeType) {
case TextRangeType::eRawClause:
return SelectionType::eIMERawClause;
case TextRangeType::eSelectedRawClause:
return SelectionType::eIMESelectedRawClause;
case TextRangeType::eConvertedClause:
- return SelectionType::SELECTION_IME_CONVERTEDTEXT;
+ return SelectionType::eIMEConvertedClause;
case TextRangeType::eSelectedClause:
return SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT;
default:
MOZ_CRASH("TextRangeType is invalid");
return SelectionType::eNormal;
}
}