aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-06-04 18:01:50 +0900
committerJean Chalard <jchalard@google.com>2014-06-04 18:01:50 +0900
commitf8b4524c0e62e684ad2e8fabcaaa32b9fb9d94e7 (patch)
tree27b75979d713488e9afb2a0cd8ccc8bef2550159
parent2660b70f806b5b8eb4aca8abf1fb734a21773d29 (diff)
downloadlatinime-f8b4524c0e62e684ad2e8fabcaaa32b9fb9d94e7.tar.gz
latinime-f8b4524c0e62e684ad2e8fabcaaa32b9fb9d94e7.tar.xz
latinime-f8b4524c0e62e684ad2e8fabcaaa32b9fb9d94e7.zip
Allow multiple shortcuts for a personal dictionary word
Bug: 13869301 Change-Id: Icd77a308f85cc16dccffe65a532471c738d6fbc5
-rw-r--r--java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java
index 80d4cc44f..eda81940f 100644
--- a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java
+++ b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java
@@ -167,7 +167,9 @@ public class UserDictionaryAddWordContents {
// should not insert, because either A. the word exists with no shortcut, in which
// case the exact same thing we want to insert is already there, or B. the word
// exists with at least one shortcut, in which case it has priority on our word.
- if (hasWord(newWord, context)) return CODE_ALREADY_PRESENT;
+ if (TextUtils.isEmpty(newShortcut) && hasWord(newWord, context)) {
+ return CODE_ALREADY_PRESENT;
+ }
// Disallow duplicates. If the same word with no shortcut is defined, remove it; if
// the same word with the same shortcut is defined, remove it; but we don't mind if