Kill the last place where the Builder was being used

I had missed that one

Change-Id: I9a5040a7a61e294396aa424de96a69dbb15f037a
main
Jean Chalard 2012-03-13 20:35:27 +09:00
parent 7b2d6a8f98
commit 8e19b1183e
2 changed files with 6 additions and 29 deletions

View File

@ -1977,23 +1977,23 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
return; return;
} }
final SuggestedWords.Builder builder; final SuggestedWords suggestedWords;
if (mCorrectionMode == Suggest.CORRECTION_FULL_BIGRAM) { if (mCorrectionMode == Suggest.CORRECTION_FULL_BIGRAM) {
final CharSequence prevWord = EditingUtils.getThisWord(getCurrentInputConnection(), final CharSequence prevWord = EditingUtils.getThisWord(getCurrentInputConnection(),
mSettingsValues.mWordSeparators); mSettingsValues.mWordSeparators);
if (!TextUtils.isEmpty(prevWord)) { if (!TextUtils.isEmpty(prevWord)) {
builder = mSuggest.getBigramPredictionWordBuilder(prevWord); suggestedWords = mSuggest.getBigramPredictionWordBuilder(prevWord).build();
} else { } else {
builder = null; suggestedWords = null;
} }
} else { } else {
builder = null; suggestedWords = null;
} }
if (null != builder && builder.size() > 0) { if (null != suggestedWords && suggestedWords.size() > 0) {
// Explicitly supply an empty typed word (the no-second-arg version of // Explicitly supply an empty typed word (the no-second-arg version of
// showSuggestions will retrieve the word near the cursor, we don't want that here) // showSuggestions will retrieve the word near the cursor, we don't want that here)
showSuggestions(builder.build(), ""); showSuggestions(suggestedWords, "");
} else { } else {
if (!isShowingPunctuationList()) setPunctuationSuggestions(); if (!isShowingPunctuationList()) setPunctuationSuggestions();
} }

View File

@ -141,29 +141,6 @@ public class SuggestedWords {
mIsPunctuationSuggestions, mShouldBlockAutoCorrectionBySafetyNet, mIsPunctuationSuggestions, mShouldBlockAutoCorrectionBySafetyNet,
mAllowsToBeAutoCorrected, mSuggestedWordInfoList); mAllowsToBeAutoCorrected, mSuggestedWordInfoList);
} }
public int size() {
return mSuggestedWordInfoList.size();
}
public CharSequence getWord(int pos) {
return mSuggestedWordInfoList.get(pos).mWord;
}
public boolean allowsToBeAutoCorrected() {
return mAllowsToBeAutoCorrected;
}
@Override
public String toString() {
// Pretty-print method to help debug
return "SuggestedWords.Builder:"
+ " mTypedWordValid=" + mTypedWordValid
+ " mHasMinimalSuggestion=" + mHasMinimalSuggestion
+ " mIsPunctuationSuggestions=" + mIsPunctuationSuggestions
+ " mShouldBlockAutoCorrectionBySafetyNet="
+ mShouldBlockAutoCorrectionBySafetyNet;
}
} }
public static class SuggestedWordInfo { public static class SuggestedWordInfo {