- if (kmod_list_[accent]) {
- FreeException(kmod_list_[accent]->exception_list);
-
- delete kmod_list_[accent];
- }
-
- kmod_list_[accent] = new kmod_list_decl;
- kmod_list_[accent]->data = keys;
- kmod_list_[accent]->accent = accent;
- if (allowed == "native") {
- kmod_list_[accent]->allowed= lyx_accent_table[accent].native;
- } else {
- kmod_list_[accent]->allowed = allowed;
- }
-
- for(string::size_type i = 0; i < keys.length(); ++i) {
-#if 0
- string * temp =
- &keymap_[static_cast<unsigned char>(keys[i])];
-#warning this is not really clean we should find a cleaner way (Jug)
- *temp = "xx"; /* this is needed for the being sure that
- the below assignment is not assigned to
- a nullpointer (if size of string = 0)
- */
- (*temp)[0] = 0;
- (*temp)[1] = accent;
-#else
- string & temp =
- keymap_[static_cast<unsigned char>(keys[i])];
- if (!temp.empty()) {
- temp[0] = 0;
- temp[1] = accent;
- } else {
- // But the question remains: "Should we be allowed
- // to change bindings, without unbinding first?"
- // Lgb
- lyxerr << "Hey... keymap_[xx] not empty." << endl;
- temp.push_back(0);
- temp.push_back(accent);
- }
-#endif
+ KmodInfo tmp;
+ tmp.data = keys;
+ tmp.accent = accent;
+ kmod_list_[accent] = tmp;
+
+ for (string::size_type i = 0; i < keys.length(); ++i) {
+ string tmp;
+ tmp += char(0);
+ tmp += char(accent);
+ keymap_[keys[i]] = tmp;