diff options
| author | Fabrice Di Meglio <fdimeglio@google.com> | 2013-02-11 18:27:34 -0800 |
|---|---|---|
| committer | Fabrice Di Meglio <fdimeglio@google.com> | 2013-02-12 13:12:13 -0800 |
| commit | 6d9fe5bd22b531bfce69b146254a4791c76acddc (patch) | |
| tree | a4e7fee99c29961e17955f771b03fb1318d0bbd5 /core/java/android/text/SpannableStringBuilder.java | |
| parent | 981e60edc3ed91ea8b5e1dae98669b88b175e19b (diff) | |
Clean Paint.mBidiFlags as it is no longer used
See bug #7623824
Change-Id: Ie2f9422821f6dcc73c99e8695f448e966b587b1d
Diffstat (limited to 'core/java/android/text/SpannableStringBuilder.java')
| -rw-r--r-- | core/java/android/text/SpannableStringBuilder.java | 63 |
1 files changed, 21 insertions, 42 deletions
diff --git a/core/java/android/text/SpannableStringBuilder.java b/core/java/android/text/SpannableStringBuilder.java index 0f30d25f7d15..9e4367117a15 100644 --- a/core/java/android/text/SpannableStringBuilder.java +++ b/core/java/android/text/SpannableStringBuilder.java @@ -1130,20 +1130,20 @@ public class SpannableStringBuilder implements CharSequence, GetChars, Spannable * {@hide} */ public void drawTextRun(Canvas c, int start, int end, int contextStart, int contextEnd, - float x, float y, int flags, Paint p) { + float x, float y, Paint p) { checkRange("drawTextRun", start, end); int contextLen = contextEnd - contextStart; int len = end - start; if (contextEnd <= mGapStart) { - c.drawTextRun(mText, start, len, contextStart, contextLen, x, y, flags, p); + c.drawTextRun(mText, start, len, contextStart, contextLen, x, y, p); } else if (contextStart >= mGapStart) { c.drawTextRun(mText, start + mGapLength, len, contextStart + mGapLength, - contextLen, x, y, flags, p); + contextLen, x, y, p); } else { char[] buf = TextUtils.obtain(contextLen); getChars(contextStart, contextEnd, buf, 0); - c.drawTextRun(buf, start - contextStart, len, 0, contextLen, x, y, flags, p); + c.drawTextRun(buf, start - contextStart, len, 0, contextLen, x, y, p); TextUtils.recycle(buf); } } @@ -1200,7 +1200,7 @@ public class SpannableStringBuilder implements CharSequence, GetChars, Spannable * Don't call this yourself -- exists for Paint to use internally. * {@hide} */ - public float getTextRunAdvances(int start, int end, int contextStart, int contextEnd, int flags, + public float getTextRunAdvances(int start, int end, int contextStart, int contextEnd, float[] advances, int advancesPos, Paint p) { float ret; @@ -1210,44 +1210,15 @@ public class SpannableStringBuilder implements CharSequence, GetChars, Spannable if (end <= mGapStart) { ret = p.getTextRunAdvances(mText, start, len, contextStart, contextLen, - flags, advances, advancesPos); + advances, advancesPos); } else if (start >= mGapStart) { ret = p.getTextRunAdvances(mText, start + mGapLength, len, - contextStart + mGapLength, contextLen, flags, advances, advancesPos); + contextStart + mGapLength, contextLen, advances, advancesPos); } else { char[] buf = TextUtils.obtain(contextLen); getChars(contextStart, contextEnd, buf, 0); ret = p.getTextRunAdvances(buf, start - contextStart, len, - 0, contextLen, flags, advances, advancesPos); - TextUtils.recycle(buf); - } - - return ret; - } - - /** - * Don't call this yourself -- exists for Paint to use internally. - * {@hide} - */ - public float getTextRunAdvances(int start, int end, int contextStart, int contextEnd, int flags, - float[] advances, int advancesPos, Paint p, int reserved) { - - float ret; - - int contextLen = contextEnd - contextStart; - int len = end - start; - - if (end <= mGapStart) { - ret = p.getTextRunAdvances(mText, start, len, contextStart, contextLen, - flags, advances, advancesPos, reserved); - } else if (start >= mGapStart) { - ret = p.getTextRunAdvances(mText, start + mGapLength, len, - contextStart + mGapLength, contextLen, flags, advances, advancesPos, reserved); - } else { - char[] buf = TextUtils.obtain(contextLen); - getChars(contextStart, contextEnd, buf, 0); - ret = p.getTextRunAdvances(buf, start - contextStart, len, - 0, contextLen, flags, advances, advancesPos, reserved); + 0, contextLen, advances, advancesPos); TextUtils.recycle(buf); } @@ -1270,7 +1241,7 @@ public class SpannableStringBuilder implements CharSequence, GetChars, Spannable * * @param contextStart the start index of the context * @param contextEnd the (non-inclusive) end index of the context - * @param flags either DIRECTION_RTL or DIRECTION_LTR + * @param flags reserved * @param offset the cursor position to move from * @param cursorOpt how to move the cursor, one of CURSOR_AFTER, * CURSOR_AT_OR_AFTER, CURSOR_BEFORE, @@ -1281,22 +1252,30 @@ public class SpannableStringBuilder implements CharSequence, GetChars, Spannable */ @Deprecated public int getTextRunCursor(int contextStart, int contextEnd, int flags, int offset, - int cursorOpt, Paint p) { + int cursorOpt, Paint p) { + return getTextRunCursor(contextStart, contextEnd, offset, cursorOpt, p); + } + + /** + * @hide + */ + public int getTextRunCursor(int contextStart, int contextEnd, int offset, + int cursorOpt, Paint p) { int ret; int contextLen = contextEnd - contextStart; if (contextEnd <= mGapStart) { ret = p.getTextRunCursor(mText, contextStart, contextLen, - flags, offset, cursorOpt); + offset, cursorOpt); } else if (contextStart >= mGapStart) { ret = p.getTextRunCursor(mText, contextStart + mGapLength, contextLen, - flags, offset + mGapLength, cursorOpt) - mGapLength; + offset + mGapLength, cursorOpt) - mGapLength; } else { char[] buf = TextUtils.obtain(contextLen); getChars(contextStart, contextEnd, buf, 0); ret = p.getTextRunCursor(buf, 0, contextLen, - flags, offset - contextStart, cursorOpt) + contextStart; + offset - contextStart, cursorOpt) + contextStart; TextUtils.recycle(buf); } |
