Text insertion from an input method such as Writing Tools can come in without there being any marked (preedit) text. In this case, if there is a selection, Qt's input-method protocol specifies that the receiver should remove the entire selection before processing the range of the input-method event. But we were not taking selection into account when computing the range passed to QInputMethodEvent, resulting in inserting the text at the wrong location. We now consider both marked and selected text when sanitizing and computing ranges. For now we assume that there can't be selected text and marked text at the same time, and we also assume that the incoming replacement range is not a subset of the selection range, as this would mean we would need to extract parts of the selection into the commit string up front. Change-Id: I8948735a10265f92c01bc4e01870a7870fb1081f Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 500d19bb54c8fff58b169bb3c5a9aaaa5277151f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%