From e3ff98f1ff5808429133cb43b362b66c23532343 Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Wed, 29 Apr 2009 06:42:18 +0000 Subject: [PATCH] FR [ 2552854 ] Combobox AutoCompletion should ignore diacritics https://sourceforge.net/tracker/?func=detail&aid=2552854&group_id=176962&atid=879335 --- client/src/org/compiere/grid/ed/AutoCompletion.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/src/org/compiere/grid/ed/AutoCompletion.java b/client/src/org/compiere/grid/ed/AutoCompletion.java index 46e10a189f..7e8f428e7d 100644 --- a/client/src/org/compiere/grid/ed/AutoCompletion.java +++ b/client/src/org/compiere/grid/ed/AutoCompletion.java @@ -33,6 +33,7 @@ import org.compiere.swing.CComboBox; *
  • BF [ 1735043 ] AutoCompletion: drop down box is showed even if i press Caps *
  • FR [ 1820783 ] AutoCompletion: posibility to toggle strict mode *
  • BF [ 1820778 ] ESC(cancel editing) key not working if you are on VComboBox + *
  • FR [ 2552854 ] Combobox AutoCompletion should ignore diacritics */ public class AutoCompletion extends PlainDocument { private static final long serialVersionUID = 1L; @@ -262,13 +263,15 @@ public class AutoCompletion extends PlainDocument { } /** - * Checks if str1 starts with str2 (ignores case) + * Checks if str1 starts with str2 (ignores case, trim whitespaces, strip diacritics) * @param str1 * @param str2 * @return true if str1 starts with str2 */ - private boolean startsWithIgnoreCase(String str1, String str2) { - return str1.toUpperCase().startsWith(str2.toUpperCase()); + protected boolean startsWithIgnoreCase(String str1, String str2) { + String s1 = org.compiere.util.Util.stripDiacritics(str1.toUpperCase()).trim(); + String s2 = org.compiere.util.Util.stripDiacritics(str2.toUpperCase()).trim(); + return s1.startsWith(s2); } } \ No newline at end of file