diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-11-28 23:10:30 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-11-28 23:10:30 +0100 |
commit | 088c3cf890cc2d96f2093e2116612cbf65bfaeea (patch) | |
tree | b4d3c68155f2de43432dd00c167d3029732be146 /widget/windows/TSFTextStore.cpp | |
parent | ec3829bf7266ebec111f41268c6c491356576df1 (diff) | |
parent | fe11e14d3cfc2900facf152257acda87280b6cdc (diff) | |
download | UXP-088c3cf890cc2d96f2093e2116612cbf65bfaeea.tar UXP-088c3cf890cc2d96f2093e2116612cbf65bfaeea.tar.gz UXP-088c3cf890cc2d96f2093e2116612cbf65bfaeea.tar.lz UXP-088c3cf890cc2d96f2093e2116612cbf65bfaeea.tar.xz UXP-088c3cf890cc2d96f2093e2116612cbf65bfaeea.zip |
Merge branch 'master' into Sync-weave
Diffstat (limited to 'widget/windows/TSFTextStore.cpp')
-rw-r--r-- | widget/windows/TSFTextStore.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/widget/windows/TSFTextStore.cpp b/widget/windows/TSFTextStore.cpp index 7224126b8..c80de831c 100644 --- a/widget/windows/TSFTextStore.cpp +++ b/widget/windows/TSFTextStore.cpp @@ -4247,14 +4247,14 @@ TSFTextStore::InsertTextAtSelectionInternal(const nsAString& aInsertStr, TS_SELECTION_ACP oldSelection = contentForTSF.Selection().ACP(); if (!mComposition.IsComposing()) { // Use a temporary composition to contain the text - PendingAction* compositionStart = mPendingActions.AppendElement(); + PendingAction* compositionStart = mPendingActions.AppendElements(2); + PendingAction* compositionEnd = compositionStart + 1; compositionStart->mType = PendingAction::COMPOSITION_START; compositionStart->mSelectionStart = oldSelection.acpStart; compositionStart->mSelectionLength = oldSelection.acpEnd - oldSelection.acpStart; compositionStart->mAdjustSelection = false; - PendingAction* compositionEnd = mPendingActions.AppendElement(); compositionEnd->mType = PendingAction::COMPOSITION_END; compositionEnd->mData = aInsertStr; @@ -4455,10 +4455,12 @@ TSFTextStore::RecordCompositionEndAction() } // When only setting selection is necessary, we should append it. if (pendingAction.mAdjustSelection) { + LONG selectionStart = pendingAction.mSelectionStart; + LONG selectionLength = pendingAction.mSelectionLength; PendingAction* setSelection = mPendingActions.AppendElement(); setSelection->mType = PendingAction::SET_SELECTION; - setSelection->mSelectionStart = pendingAction.mSelectionStart; - setSelection->mSelectionLength = pendingAction.mSelectionLength; + setSelection->mSelectionStart = selectionStart; + setSelection->mSelectionLength = selectionLength; setSelection->mSelectionReversed = false; } // Remove the redundant pending composition. |