am de42f3f2: Merge "Fix: Bug of I39e905b6ddfc8d3."

* commit 'de42f3f287529a05899cc27d485d119dbbc3863d':
  Fix: Bug of I39e905b6ddfc8d3.
This commit is contained in:
Keisuke Kuroyanagi 2014-03-06 01:47:25 -08:00 committed by Android Git Automerger
commit 769051c2e2

View file

@ -164,12 +164,15 @@ class ProximityInfoUtils {
const int gridWidth, const int mostCommonKeyWidth, const int keyCount, const int gridWidth, const int mostCommonKeyWidth, const int keyCount,
const int x, const int y, const int primaryKey, const char *const localeStr, const int x, const int y, const int primaryKey, const char *const localeStr,
const hash_map_compat<int, int> *const codeToKeyMap, int *proximities) { const hash_map_compat<int, int> *const codeToKeyMap, int *proximities) {
if (x == NOT_A_COORDINATE || y == NOT_A_COORDINATE) {
return;
}
const int mostCommonKeyWidthSquare = mostCommonKeyWidth * mostCommonKeyWidth; const int mostCommonKeyWidthSquare = mostCommonKeyWidth * mostCommonKeyWidth;
int insertPos = 0; int insertPos = 0;
proximities[insertPos++] = primaryKey; proximities[insertPos++] = primaryKey;
if (x == NOT_A_COORDINATE || y == NOT_A_COORDINATE) {
for (int i = insertPos; i < MAX_PROXIMITY_CHARS_SIZE; ++i) {
proximities[i] = NOT_A_CODE_POINT;
}
return;
}
const int startIndex = getStartIndexFromCoordinates(x, y, cellHeight, cellWidth, gridWidth); const int startIndex = getStartIndexFromCoordinates(x, y, cellHeight, cellWidth, gridWidth);
if (startIndex >= 0) { if (startIndex >= 0) {
for (int i = 0; i < MAX_PROXIMITY_CHARS_SIZE; ++i) { for (int i = 0; i < MAX_PROXIMITY_CHARS_SIZE; ++i) {