зеркало из https://github.com/mozilla/pjs.git
Bug 589844 - Return correct string from getTextBeforeCursor on Android; r=mwu a=blocking-fennec=2.0a1+
--HG-- branch : GECKO20b5pre_20100820_RELBRANCH
This commit is contained in:
Родитель
f8b1ab8dce
Коммит
110d1dd258
|
@ -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));
|
||||
|
|
Загрузка…
Ссылка в новой задаче