Bug 1189396 part.1 Implement IMENotification::SelectionChangeData::Clear() to initialize its members r=smaug

This commit is contained in:
Masayuki Nakano 2015-08-22 01:43:41 +09:00
parent 89da96e555
commit a662044ce2

View File

@ -410,12 +410,8 @@ struct IMENotification final
{
switch (aMessage) {
case NOTIFY_IME_OF_SELECTION_CHANGE:
mSelectionChangeData.mOffset = UINT32_MAX;
mSelectionChangeData.mString = new nsString();
mSelectionChangeData.mWritingMode = 0;
mSelectionChangeData.mReversed = false;
mSelectionChangeData.mCausedByComposition = false;
mSelectionChangeData.mCausedBySelectionEvent = false;
mSelectionChangeData.Clear();
break;
case NOTIFY_IME_OF_TEXT_CHANGE:
mTextChangeData.Clear();
@ -601,6 +597,19 @@ struct IMENotification final
{
return mOffset + Length() <= INT32_MAX;
}
void Clear()
{
mOffset = UINT32_MAX;
mString->Truncate();
mWritingMode = 0;
mReversed = false;
mCausedByComposition = false;
mCausedBySelectionEvent = false;
}
bool IsValid() const
{
return mOffset != UINT32_MAX;
}
};
struct TextChangeDataBase