Automated import from //branches/donutburger/...@141168,141168
diff --git a/core/java/com/android/internal/widget/EditStyledText.java b/core/java/com/android/internal/widget/EditStyledText.java
index 3da9753..b36707e 100644
--- a/core/java/com/android/internal/widget/EditStyledText.java
+++ b/core/java/com/android/internal/widget/EditStyledText.java
@@ -933,8 +933,13 @@
Log.d(LOG_TAG, "--- setStyledTextSpan:" + mMode + ","
+ start + "," + end);
}
- mEST.getText().setSpan(span, start, end,
- Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ if (start < end) {
+ mEST.getText().setSpan(span, start, end,
+ Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ } else {
+ mEST.getText().setSpan(span, end, start,
+ Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ }
}
private void changeSizeSelectedText(int size) {