mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1051689 Ensure to complete the last pending action r=emk
This commit is contained in:
parent
49861055d6
commit
0ac6705f98
@ -963,14 +963,12 @@ nsTextStore::DidLockGranted()
|
|||||||
mNativeCaretIsCreated = false;
|
mNativeCaretIsCreated = false;
|
||||||
}
|
}
|
||||||
if (IsReadWriteLocked()) {
|
if (IsReadWriteLocked()) {
|
||||||
if (IsPendingCompositionUpdateIncomplete()) {
|
// FreeCJ (TIP for Traditional Chinese) calls SetSelection() to set caret
|
||||||
// FreeCJ (TIP for Traditional Chinese) calls SetSelection() to set caret
|
// to the start of composition string and insert a full width space for
|
||||||
// to the start of composition string and insert a full width space for
|
// a placeholder with a call of SetText(). After that, it calls
|
||||||
// a placeholder with a call of SetText(). After that, it calls
|
// OnUpdateComposition() without new range. Therefore, let's record the
|
||||||
// OnUpdateComposition() without new range. Therefore, let's record the
|
// composition update information here.
|
||||||
// composition update information here.
|
CompleteLastActionIfStillIncomplete();
|
||||||
RecordCompositionUpdateAction();
|
|
||||||
}
|
|
||||||
|
|
||||||
FlushPendingActions();
|
FlushPendingActions();
|
||||||
}
|
}
|
||||||
@ -1787,6 +1785,7 @@ nsTextStore::SetSelectionInternal(const TS_SELECTION_ACP* pSelection,
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CompleteLastActionIfStillIncomplete();
|
||||||
PendingAction* action = mPendingActions.AppendElement();
|
PendingAction* action = mPendingActions.AppendElement();
|
||||||
action->mType = PendingAction::SELECTION_SET;
|
action->mType = PendingAction::SELECTION_SET;
|
||||||
action->mSelectionStart = pSelection->acpStart;
|
action->mSelectionStart = pSelection->acpStart;
|
||||||
@ -2812,6 +2811,7 @@ nsTextStore::RecordCompositionStartAction(ITfCompositionView* pComposition,
|
|||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CompleteLastActionIfStillIncomplete();
|
||||||
PendingAction* action = mPendingActions.AppendElement();
|
PendingAction* action = mPendingActions.AppendElement();
|
||||||
action->mType = PendingAction::COMPOSITION_START;
|
action->mType = PendingAction::COMPOSITION_START;
|
||||||
action->mSelectionStart = start;
|
action->mSelectionStart = start;
|
||||||
@ -2842,6 +2842,7 @@ nsTextStore::RecordCompositionEndAction()
|
|||||||
|
|
||||||
MOZ_ASSERT(mComposition.IsComposing());
|
MOZ_ASSERT(mComposition.IsComposing());
|
||||||
|
|
||||||
|
CompleteLastActionIfStillIncomplete();
|
||||||
PendingAction* action = mPendingActions.AppendElement();
|
PendingAction* action = mPendingActions.AppendElement();
|
||||||
action->mType = PendingAction::COMPOSITION_END;
|
action->mType = PendingAction::COMPOSITION_END;
|
||||||
action->mData = mComposition.mString;
|
action->mData = mComposition.mString;
|
||||||
|
@ -540,6 +540,14 @@ protected:
|
|||||||
lastAction.mIncomplete;
|
lastAction.mIncomplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CompleteLastActionIfStillIncomplete()
|
||||||
|
{
|
||||||
|
if (!IsPendingCompositionUpdateIncomplete()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
RecordCompositionUpdateAction();
|
||||||
|
}
|
||||||
|
|
||||||
// When On*Composition() is called without document lock, we need to flush
|
// When On*Composition() is called without document lock, we need to flush
|
||||||
// the recorded actions at quitting the method.
|
// the recorded actions at quitting the method.
|
||||||
// AutoPendingActionAndContentFlusher class is usedful for it.
|
// AutoPendingActionAndContentFlusher class is usedful for it.
|
||||||
|
Loading…
Reference in New Issue
Block a user