summaryrefslogtreecommitdiffstats
path: root/widget/windows/TSFTextStore.cpp
diff options
context:
space:
mode:
authorwicknix <39230578+wicknix@users.noreply.github.com>2019-04-15 18:58:07 -0500
committerGitHub <noreply@github.com>2019-04-15 18:58:07 -0500
commit5a1843c9f9e323627f9c35529e6a8c853d4dbb0d (patch)
tree62de3cd7cb8a6f75e568863bb73ca2deb80d87a9 /widget/windows/TSFTextStore.cpp
parent065f6f9e5ebc1ed6cfaadaf7851b6021fa94a013 (diff)
parent095ea556855b38138e39e713f482eb440f7da9b2 (diff)
downloadUXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.gz
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.lz
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.xz
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.zip
Merge pull request #1 from MoonchildProductions/master
keep up with mc
Diffstat (limited to 'widget/windows/TSFTextStore.cpp')
-rw-r--r--widget/windows/TSFTextStore.cpp10
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.