aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-03-06 09:44:52 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-03-06 09:44:52 +0000
commitde42f3f287529a05899cc27d485d119dbbc3863d (patch)
treeae15574a6446b8d7459410b65dcd530c04272f57
parent3892991b80b1962454789f7233171620f70fb22b (diff)
parent9fd50e34a863c18da42d6cfc8f62986a387dd5f8 (diff)
downloadlatinime-de42f3f287529a05899cc27d485d119dbbc3863d.tar.gz
latinime-de42f3f287529a05899cc27d485d119dbbc3863d.tar.xz
latinime-de42f3f287529a05899cc27d485d119dbbc3863d.zip
Merge "Fix: Bug of I39e905b6ddfc8d3."
-rw-r--r--native/jni/src/suggest/core/layout/proximity_info_utils.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/native/jni/src/suggest/core/layout/proximity_info_utils.h b/native/jni/src/suggest/core/layout/proximity_info_utils.h
index bc8d5bc1d..6d2c11b09 100644
--- a/native/jni/src/suggest/core/layout/proximity_info_utils.h
+++ b/native/jni/src/suggest/core/layout/proximity_info_utils.h
@@ -164,12 +164,15 @@ class ProximityInfoUtils {
const int gridWidth, const int mostCommonKeyWidth, const int keyCount,
const int x, const int y, const int primaryKey, const char *const localeStr,
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;
int insertPos = 0;
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);
if (startIndex >= 0) {
for (int i = 0; i < MAX_PROXIMITY_CHARS_SIZE; ++i) {