mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 765831 - Part 2: Clamp bogus selection indexes passed to setSelection(). r=blassey
This commit is contained in:
parent
0e8e38a31e
commit
fad3377b1a
@ -234,10 +234,12 @@ public class GeckoInputConnection
|
||||
|
||||
@Override
|
||||
public boolean setSelection(int start, int end) {
|
||||
GeckoAppShell.sendEventToGecko(
|
||||
GeckoEvent.createIMEEvent(GeckoEvent.IME_SET_SELECTION, start, end - start));
|
||||
|
||||
return super.setSelection(start, end);
|
||||
// Some IMEs call setSelection() with negative or stale indexes, so clamp them.
|
||||
Span newSelection = Span.clamp(start, end, getEditable());
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createIMEEvent(GeckoEvent.IME_SET_SELECTION,
|
||||
newSelection.start,
|
||||
newSelection.length));
|
||||
return super.setSelection(newSelection.start, newSelection.end);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user