From 52612a0d1b0ce7796fa0a0b50bfda172ebc2a5ef Mon Sep 17 00:00:00 2001
From: Jean Chalard <jchalard@google.com>
Date: Fri, 23 Mar 2012 19:38:23 +0900
Subject: [PATCH] Fix a bug with negative coordinates, step 3

This implements the actual change, now that indentation is okay

Change-Id: Idd897f988394125611516431711c1e575df871df
---
 native/src/proximity_info.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/native/src/proximity_info.cpp b/native/src/proximity_info.cpp
index 69f6ef1be2..8507db94aa 100644
--- a/native/src/proximity_info.cpp
+++ b/native/src/proximity_info.cpp
@@ -156,7 +156,7 @@ void ProximityInfo::calculateNearbyKeyCodes(
     int insertPos = 0;
     inputCodes[insertPos++] = primaryKey;
     const int startIndex = getStartIndexFromCoordinates(x, y);
-
+    if (startIndex >= 0) {
         for (int i = 0; i < MAX_PROXIMITY_CHARS_SIZE; ++i) {
             const int32_t c = mProximityCharsArray[startIndex + i];
             if (c < KEYCODE_SPACE || c == primaryKey) {
@@ -208,7 +208,7 @@ void ProximityInfo::calculateNearbyKeyCodes(
                 }
             }
         }
-
+    }
     // Add a delimiter for the proximity characters
     for (int i = insertPos; i < MAX_PROXIMITY_CHARS_SIZE; ++i) {
         inputCodes[i] = NOT_A_CODE;
-- 
GitLab