mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 13:56:29 +00:00
Bug 589844 - Return correct string from getTextBeforeCursor on Android; r=mwu a=blocking-fennec=2.0a1+
This commit is contained in:
parent
e2ebc7dee3
commit
48b404ba18
@ -234,10 +234,17 @@ public class GeckoInputConnection
|
||||
|
||||
/* Compatible with both positive and negative length
|
||||
(no need for separate code for getTextBeforeCursor) */
|
||||
int textStart = length > 0 ? mSelectionStart :
|
||||
mSelectionStart + length > 0 ? mSelectionStart + length : 0;
|
||||
int textLength = length > 0 ? length:
|
||||
textStart == 0 ? mSelectionStart : length;
|
||||
int textStart = mSelectionStart;
|
||||
int textLength = length;
|
||||
|
||||
if (length < 0) {
|
||||
textStart += length;
|
||||
textLength = -length;
|
||||
if (textStart < 0) {
|
||||
textStart = 0;
|
||||
textLength = mSelectionStart;
|
||||
}
|
||||
}
|
||||
|
||||
GeckoAppShell.sendEventToGecko(
|
||||
new GeckoEvent(GeckoEvent.IME_GET_TEXT, textStart, textLength));
|
||||
|
Loading…
x
Reference in New Issue
Block a user