mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 788106 - Band-aid ArrayIndexOutOfBoundsException. r=bnicholson
This commit is contained in:
parent
98856ba73e
commit
c4268c1480
@ -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…
Reference in New Issue
Block a user