[gnome-control-center] common: Fix search by skipping soft hyphens when normalizing



commit 11d5d850b2cfd3b27467d99cd5c14a9a422dbfc7
Author: Rui Matos <tiagomatos gmail com>
Date:   Tue Apr 26 16:46:58 2016 +0200

    common: Fix search by skipping soft hyphens when normalizing
    
    Commit b3be07609a9bae43947ee3e59d8982a7715c9acf introduced soft
    hyphens in panel names which causes searches to fail. Fix this by
    skipping soft hyphen when normalizing strings.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765617

 panels/common/cc-util.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/panels/common/cc-util.c b/panels/common/cc-util.c
index 2153a0b..7bff79b 100644
--- a/panels/common/cc-util.c
+++ b/panels/common/cc-util.c
@@ -36,6 +36,8 @@
                         ((c) >= 0x20D0 && (c) <= 0x20FF)  || \
                         ((c) >= 0xFE20 && (c) <= 0xFE2F))
 
+#define IS_SOFT_HYPHEN(c) ((c) == 0x00AD)
+
 /* Copied from tracker/src/libtracker-fts/tracker-parser-glib.c under the GPL
  * And then from gnome-shell/src/shell-util.c
  *
@@ -76,7 +78,7 @@ cc_util_normalize_casefold_and_unaccent (const char *str)
       next_utf8 = g_utf8_next_char (&tmp[i]);
       utf8_len = next_utf8 - &tmp[i];
 
-      if (IS_CDM_UCS4 ((guint32) unichar))
+      if (IS_CDM_UCS4 (unichar) || IS_SOFT_HYPHEN (unichar))
         {
           /* If the given unichar is a combining diacritical mark,
            * just update the original index, not the output one */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]