diff options
author | 2014-01-16 04:32:32 +0900 | |
---|---|---|
committer | 2014-01-17 02:06:24 +0900 | |
commit | 60afa7000f14f8f8ca890236f636d45a2b59b61e (patch) | |
tree | 4b86a8acc51571e0d1319c697f7cd943a3f658de /java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java | |
parent | cdeeadf5caf00dd7cc73ebdd6f7196e96a76df00 (diff) | |
download | latinime-60afa7000f14f8f8ca890236f636d45a2b59b61e.tar.gz latinime-60afa7000f14f8f8ca890236f636d45a2b59b61e.tar.xz latinime-60afa7000f14f8f8ca890236f636d45a2b59b61e.zip |
Fix a bug specific to German capitalization.
Bug: 9663105
Change-Id: Ib68ee4edb135e96dfca229c1ccce308e7e638bdd
Diffstat (limited to 'java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java b/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java index 057e332e9..702688f93 100644 --- a/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java @@ -139,6 +139,20 @@ public final class CapsModeUtils { j--; } if (j <= 0 || Character.isWhitespace(prevChar)) { + if (spacingAndPunctuations.mUsesGermanRules) { + // In German typography rules, there is a specific case that the first character + // of a new line should not be capitalized if the previous line ends in a comma. + boolean hasNewLine = false; + while (--j >= 0 && Character.isWhitespace(prevChar)) { + if (Constants.CODE_ENTER == prevChar) { + hasNewLine = true; + } + prevChar = cs.charAt(j); + } + if (Constants.CODE_COMMA == prevChar && hasNewLine) { + return (TextUtils.CAP_MODE_CHARACTERS | TextUtils.CAP_MODE_WORDS) & reqModes; + } + } // There are only spacing chars between the start of the paragraph and the cursor, // defined as a isWhitespace() char that is neither a isSpaceChar() nor a tab. Both // MODE_WORDS and MODE_SENTENCES should be active. |