mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 781038 - Part 1: Span and select the Editable's actual length. r=blassey
This commit is contained in:
parent
1753f534be
commit
231bda0d2e
@ -1149,16 +1149,19 @@ class GeckoInputConnection
|
||||
}
|
||||
|
||||
private void setEditable(String contents) {
|
||||
int prevLength = mEditable.length();
|
||||
mEditable.removeSpan(this);
|
||||
mEditable.replace(0, mEditable.length(), contents);
|
||||
mEditable.setSpan(this, 0, contents.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
Selection.setSelection(mEditable, contents.length());
|
||||
mEditable.replace(0, prevLength, contents);
|
||||
int newLength = mEditable.length();
|
||||
mEditable.setSpan(this, 0, newLength, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
Selection.setSelection(mEditable, newLength);
|
||||
}
|
||||
|
||||
private void initEditable(String contents) {
|
||||
mEditable = mEditableFactory.newEditable(contents);
|
||||
mEditable.setSpan(this, 0, contents.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
Selection.setSelection(mEditable, contents.length());
|
||||
int newLength = mEditable.length();
|
||||
mEditable.setSpan(this, 0, newLength, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
Selection.setSelection(mEditable, newLength);
|
||||
}
|
||||
|
||||
protected final boolean hasCompositionString() {
|
||||
|
Loading…
Reference in New Issue
Block a user