Symbols: Don't include NoSymbols in the map
authorDaniel Stone <daniel@fooishbar.org>
Mon, 4 Jun 2012 12:01:33 +0000 (13:01 +0100)
committerDaniel Stone <daniel@fooishbar.org>
Mon, 4 Jun 2012 12:01:33 +0000 (13:01 +0100)
Instead of using NoSymbol in the map, we use num_syms == 0 to signify
the non-presence of a symbol.  So instead of adding NoSymbol mappings
to the list regardless, detect them and set num_syms == 0.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
src/xkbcomp/symbols.c

index 6e7ef40..dce840b 100644 (file)
@@ -1071,6 +1071,11 @@ AddSymbolsToKey(KeyInfo *key, struct xkb_keymap *keymap,
                 key->symsMapNumEntries[ndx][i] = 0;
                 break;
             }
+            if (key->symsMapNumEntries[ndx][i] == 1 &&
+                key->syms[ndx][key->symsMapIndex[ndx][i] + j] == XKB_KEY_NoSymbol) {
+                key->symsMapIndex[ndx][i] = -1;
+                key->symsMapNumEntries[ndx][i] = 0;
+            }
         }
     }
     for (j = key->numLevels[ndx] - 1;