aboutsummaryrefslogtreecommitdiffstats
path: root/native/src/correction.cpp
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-11-17 11:51:55 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-17 11:51:55 -0800
commitbd9cf88befcb89ad145c64c0b058a0c2fcec43ff (patch)
tree3c6634edbdf4cc4af34836b79314a8647adb76e3 /native/src/correction.cpp
parentf8a97a2552e713e7cb70df3f8aa6fa84fc851140 (diff)
parent0a66397106e57165ec8e27a6f868d275da9f3138 (diff)
downloadlatinime-bd9cf88befcb89ad145c64c0b058a0c2fcec43ff.tar.gz
latinime-bd9cf88befcb89ad145c64c0b058a0c2fcec43ff.tar.xz
latinime-bd9cf88befcb89ad145c64c0b058a0c2fcec43ff.zip
am 0a663971: am 620b1faf: Merge "Fix the touch calibration bug" into ics-mr1
* commit '0a66397106e57165ec8e27a6f868d275da9f3138': Fix the touch calibration bug
Diffstat (limited to 'native/src/correction.cpp')
-rw-r--r--native/src/correction.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/native/src/correction.cpp b/native/src/correction.cpp
index 8b6d3b23b..22ee75a24 100644
--- a/native/src/correction.cpp
+++ b/native/src/correction.cpp
@@ -751,6 +751,9 @@ int Correction::RankingAlgorithm::calculateFinalFreq(const int inputIndex, const
// \ .
// C \ .
// 0 R1 R2
+ if (factor <= 0) {
+ return -1;
+ }
multiplyRate((int)(factor * 100), &finalFreq);
} else if (squaredDistance == PROXIMITY_CHAR_WITHOUT_DISTANCE_INFO) {
multiplyRate(WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE, &finalFreq);