mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 975383 part.6 Remove compositionupdate dispatchers in nsTextStore of Windows r=emk
This commit is contained in:
parent
b752645569
commit
968046b014
@ -1578,8 +1578,6 @@ nsTextStore::FlushPendingActions()
|
|||||||
"mSelectionLength=%d }",
|
"mSelectionLength=%d }",
|
||||||
this, action.mSelectionStart, action.mSelectionLength));
|
this, action.mSelectionStart, action.mSelectionLength));
|
||||||
|
|
||||||
MOZ_ASSERT(mComposition.mLastData.IsEmpty());
|
|
||||||
|
|
||||||
if (action.mAdjustSelection) {
|
if (action.mAdjustSelection) {
|
||||||
// Select composition range so the new composition replaces the range
|
// Select composition range so the new composition replaces the range
|
||||||
WidgetSelectionEvent selectionSet(true, NS_SELECTION_SET, mWidget);
|
WidgetSelectionEvent selectionSet(true, NS_SELECTION_SET, mWidget);
|
||||||
@ -1649,29 +1647,12 @@ nsTextStore::FlushPendingActions()
|
|||||||
action.mData.ReplaceSubstring(NS_LITERAL_STRING("\r\n"),
|
action.mData.ReplaceSubstring(NS_LITERAL_STRING("\r\n"),
|
||||||
NS_LITERAL_STRING("\n"));
|
NS_LITERAL_STRING("\n"));
|
||||||
|
|
||||||
if (action.mData != mComposition.mLastData) {
|
|
||||||
PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
|
|
||||||
("TSF: 0x%p nsTextStore::FlushPendingActions(), "
|
|
||||||
"dispatching compositionupdate event...", this));
|
|
||||||
WidgetCompositionEvent compositionUpdate(true, NS_COMPOSITION_UPDATE,
|
|
||||||
mWidget);
|
|
||||||
mWidget->InitEvent(compositionUpdate);
|
|
||||||
compositionUpdate.data = action.mData;
|
|
||||||
mComposition.mLastData = compositionUpdate.data;
|
|
||||||
mWidget->DispatchWindowEvent(&compositionUpdate);
|
|
||||||
if (!mWidget || mWidget->Destroyed()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MOZ_ASSERT(action.mData == mComposition.mLastData);
|
|
||||||
|
|
||||||
PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
|
PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
|
||||||
("TSF: 0x%p nsTextStore::FlushPendingActions(), "
|
("TSF: 0x%p nsTextStore::FlushPendingActions(), "
|
||||||
"dispatching text event...", this));
|
"dispatching text event...", this));
|
||||||
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
|
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
|
||||||
mWidget->InitEvent(textEvent);
|
mWidget->InitEvent(textEvent);
|
||||||
textEvent.theText = mComposition.mLastData;
|
textEvent.theText = action.mData;
|
||||||
if (action.mRanges->IsEmpty()) {
|
if (action.mRanges->IsEmpty()) {
|
||||||
TextRange wholeRange;
|
TextRange wholeRange;
|
||||||
wholeRange.mStartOffset = 0;
|
wholeRange.mStartOffset = 0;
|
||||||
@ -1692,29 +1673,13 @@ nsTextStore::FlushPendingActions()
|
|||||||
|
|
||||||
action.mData.ReplaceSubstring(NS_LITERAL_STRING("\r\n"),
|
action.mData.ReplaceSubstring(NS_LITERAL_STRING("\r\n"),
|
||||||
NS_LITERAL_STRING("\n"));
|
NS_LITERAL_STRING("\n"));
|
||||||
if (action.mData != mComposition.mLastData) {
|
|
||||||
PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
|
|
||||||
("TSF: 0x%p nsTextStore::FlushPendingActions(), "
|
|
||||||
"dispatching compositionupdate event...", this));
|
|
||||||
WidgetCompositionEvent compositionUpdate(true, NS_COMPOSITION_UPDATE,
|
|
||||||
mWidget);
|
|
||||||
mWidget->InitEvent(compositionUpdate);
|
|
||||||
compositionUpdate.data = action.mData;
|
|
||||||
mComposition.mLastData = compositionUpdate.data;
|
|
||||||
mWidget->DispatchWindowEvent(&compositionUpdate);
|
|
||||||
if (!mWidget || mWidget->Destroyed()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MOZ_ASSERT(action.mData == mComposition.mLastData);
|
|
||||||
|
|
||||||
PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
|
PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
|
||||||
("TSF: 0x%p nsTextStore::FlushPendingActions(), "
|
("TSF: 0x%p nsTextStore::FlushPendingActions(), "
|
||||||
"dispatching text event...", this));
|
"dispatching text event...", this));
|
||||||
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
|
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
|
||||||
mWidget->InitEvent(textEvent);
|
mWidget->InitEvent(textEvent);
|
||||||
textEvent.theText = mComposition.mLastData;
|
textEvent.theText = action.mData;
|
||||||
mWidget->DispatchWindowEvent(&textEvent);
|
mWidget->DispatchWindowEvent(&textEvent);
|
||||||
if (!mWidget || mWidget->Destroyed()) {
|
if (!mWidget || mWidget->Destroyed()) {
|
||||||
break;
|
break;
|
||||||
@ -1725,13 +1690,12 @@ nsTextStore::FlushPendingActions()
|
|||||||
"dispatching compositionend event...", this));
|
"dispatching compositionend event...", this));
|
||||||
WidgetCompositionEvent compositionEnd(true, NS_COMPOSITION_END,
|
WidgetCompositionEvent compositionEnd(true, NS_COMPOSITION_END,
|
||||||
mWidget);
|
mWidget);
|
||||||
compositionEnd.data = mComposition.mLastData;
|
compositionEnd.data = textEvent.theText;
|
||||||
mWidget->InitEvent(compositionEnd);
|
mWidget->InitEvent(compositionEnd);
|
||||||
mWidget->DispatchWindowEvent(&compositionEnd);
|
mWidget->DispatchWindowEvent(&compositionEnd);
|
||||||
if (!mWidget || mWidget->Destroyed()) {
|
if (!mWidget || mWidget->Destroyed()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mComposition.mLastData.Truncate();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PendingAction::SELECTION_SET: {
|
case PendingAction::SELECTION_SET: {
|
||||||
|
@ -327,10 +327,6 @@ protected:
|
|||||||
// inconsistencies/artifacts.
|
// inconsistencies/artifacts.
|
||||||
nsString mString;
|
nsString mString;
|
||||||
|
|
||||||
// The latest composition string which was dispatched by composition update
|
|
||||||
// event.
|
|
||||||
nsString mLastData;
|
|
||||||
|
|
||||||
// The start of the current active composition, in ACP offsets
|
// The start of the current active composition, in ACP offsets
|
||||||
LONG mStart;
|
LONG mStart;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user