mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-14 05:44:20 +00:00
Bug 788106 - Band-aid ArrayIndexOutOfBoundsException. r=bnicholson
This commit is contained in:
parent
ee47afaaef
commit
d2d6bb8007
@ -81,7 +81,8 @@ class FontSizePreference extends DialogPreference {
|
||||
setButtonState(mPreviewFontIndex);
|
||||
mDecreaseFontButton.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
updatePreviewFontSize(mFontTwipValues[--mPreviewFontIndex]);
|
||||
mPreviewFontIndex = Math.max(mPreviewFontIndex - 1, 0);
|
||||
updatePreviewFontSize(mFontTwipValues[mPreviewFontIndex]);
|
||||
mIncreaseFontButton.setEnabled(true);
|
||||
// If we reached the minimum index, disable the button.
|
||||
if (mPreviewFontIndex == 0) {
|
||||
@ -91,7 +92,8 @@ class FontSizePreference extends DialogPreference {
|
||||
});
|
||||
mIncreaseFontButton.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
updatePreviewFontSize(mFontTwipValues[++mPreviewFontIndex]);
|
||||
mPreviewFontIndex = Math.min(mPreviewFontIndex + 1, mFontTwipValues.length - 1);
|
||||
updatePreviewFontSize(mFontTwipValues[mPreviewFontIndex]);
|
||||
|
||||
mDecreaseFontButton.setEnabled(true);
|
||||
// If we reached the maximum index, disable the button.
|
||||
|
Loading…
x
Reference in New Issue
Block a user