Bug 725233 Get rid of hacky text event dispatchers, they are not necessary due to bug 622247 r=jimm

This commit is contained in:
Masayuki Nakano 2012-02-20 14:26:16 +09:00
Родитель ca295e718c
Коммит bc72e6452f
1 изменённых файлов: 6 добавлений и 22 удалений

Просмотреть файл

@ -1268,20 +1268,13 @@ nsTextStore::InsertTextAtSelection(DWORD dwFlags,
if (mWindow && !mWindow->Destroyed()) {
nsTextEvent event(true, NS_TEXT_TEXT, mWindow);
mWindow->InitEvent(event);
if (!cch) {
// XXX See OnEndComposition comment on inserting empty strings
event.theText = NS_LITERAL_STRING(" ");
mWindow->DispatchWindowEvent(&event);
}
event.theText.Assign(pchText, cch);
event.theText.ReplaceSubstring(NS_LITERAL_STRING("\r\n"),
NS_LITERAL_STRING("\n"));
mWindow->DispatchWindowEvent(&event);
if (mWindow && !mWindow->Destroyed()) {
event.theText.Assign(pchText, cch);
event.theText.ReplaceSubstring(NS_LITERAL_STRING("\r\n"),
NS_LITERAL_STRING("\n"));
mWindow->DispatchWindowEvent(&event);
if (mWindow && !mWindow->Destroyed()) {
compEvent.message = NS_COMPOSITION_END;
mWindow->DispatchWindowEvent(&compEvent);
}
compEvent.message = NS_COMPOSITION_END;
mWindow->DispatchWindowEvent(&compEvent);
}
}
}
@ -1443,15 +1436,6 @@ nsTextStore::OnEndComposition(ITfCompositionView* pComposition)
// Use NS_TEXT_TEXT to commit composition string
nsTextEvent textEvent(true, NS_TEXT_TEXT, mWindow);
mWindow->InitEvent(textEvent);
if (!mCompositionString.Length()) {
// XXX HACK! HACK! NS_TEXT_TEXT handler specifically rejects
// first-time empty strings as workaround for another IME bug
// and our request will be rejected if this is the first time
// we are sending NS_TEXT_TEXT. The workaround is to send it a
// non-empty dummy string first.
textEvent.theText = NS_LITERAL_STRING(" ");
mWindow->DispatchWindowEvent(&textEvent);
}
textEvent.theText = mCompositionString;
textEvent.theText.ReplaceSubstring(NS_LITERAL_STRING("\r\n"),
NS_LITERAL_STRING("\n"));