symbols: steal keys and modmaps when merging if possible
Signed-off-by: Ran Benita <ran234@gmail.com>master
parent
a7d753e45a
commit
71a2593162
|
@ -509,18 +509,30 @@ MergeIncludedSymbols(SymbolsInfo *into, SymbolsInfo *from,
|
||||||
darray_foreach_from(group_name, from->group_names, group_names_in_both)
|
darray_foreach_from(group_name, from->group_names, group_names_in_both)
|
||||||
darray_append(into->group_names, *group_name);
|
darray_append(into->group_names, *group_name);
|
||||||
|
|
||||||
|
if (darray_empty(into->keys)) {
|
||||||
|
into->keys = from->keys;
|
||||||
|
darray_init(from->keys);
|
||||||
|
}
|
||||||
|
else {
|
||||||
darray_foreach(keyi, from->keys) {
|
darray_foreach(keyi, from->keys) {
|
||||||
keyi->merge = (merge == MERGE_DEFAULT ? keyi->merge : merge);
|
keyi->merge = (merge == MERGE_DEFAULT ? keyi->merge : merge);
|
||||||
if (!AddKeySymbols(into, keyi, false))
|
if (!AddKeySymbols(into, keyi, false))
|
||||||
into->errorCount++;
|
into->errorCount++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (darray_empty(into->modmaps)) {
|
||||||
|
into->modmaps = from->modmaps;
|
||||||
|
darray_init(from->modmaps);
|
||||||
|
}
|
||||||
|
else {
|
||||||
darray_foreach(mm, from->modmaps) {
|
darray_foreach(mm, from->modmaps) {
|
||||||
mm->merge = (merge == MERGE_DEFAULT ? mm->merge : merge);
|
mm->merge = (merge == MERGE_DEFAULT ? mm->merge : merge);
|
||||||
if (!AddModMapEntry(into, mm))
|
if (!AddModMapEntry(into, mm))
|
||||||
into->errorCount++;
|
into->errorCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
HandleSymbolsFile(SymbolsInfo *info, XkbFile *file, enum merge_mode merge);
|
HandleSymbolsFile(SymbolsInfo *info, XkbFile *file, enum merge_mode merge);
|
||||||
|
|
Loading…
Reference in New Issue