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
|
@Override
|
||||||
public boolean setSelection(int start, int end) {
|
public boolean setSelection(int start, int end) {
|
||||||
GeckoAppShell.sendEventToGecko(
|
// Some IMEs call setSelection() with negative or stale indexes, so clamp them.
|
||||||
GeckoEvent.createIMEEvent(GeckoEvent.IME_SET_SELECTION, start, end - start));
|
Span newSelection = Span.clamp(start, end, getEditable());
|
||||||
|
GeckoAppShell.sendEventToGecko(GeckoEvent.createIMEEvent(GeckoEvent.IME_SET_SELECTION,
|
||||||
return super.setSelection(start, end);
|
newSelection.start,
|
||||||
|
newSelection.length));
|
||||||
|
return super.setSelection(newSelection.start, newSelection.end);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user