X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTrans.cpp;h=b73b88490e8879d4b031e5988ea6b004aada9b35;hb=9b18a9b609c0af78b4bb08667fd8e02ebd897d5e;hp=9249e8e8d4e00acb814e07c4b038ae309f672f06;hpb=8a047a411235fcf5ba48f075e0a23a7cf1e3e8bb;p=lyx.git diff --git a/src/Trans.cpp b/src/Trans.cpp index 9249e8e8d4..b73b88490e 100644 --- a/src/Trans.cpp +++ b/src/Trans.cpp @@ -98,7 +98,7 @@ TeXAccent get_accent(FuncCode action) ++i; } struct TeXAccent temp = { static_cast(0), 0, - 0, static_cast(0)}; + nullptr, static_cast(0)}; return temp; } @@ -190,10 +190,10 @@ void Trans::addDeadkey(tex_accent accent, docstring const & keys) // FIXME This is a hack. // tmp is no valid UCS4 string, but misused to store the // accent. - docstring tmp; - tmp += char_type(0); - tmp += char_type(accent); - keymap_[keys[i]] = tmp; + docstring tmpd; + tmpd += char_type(0); + tmpd += char_type(accent); + keymap_[keys[i]] = tmpd; } } @@ -280,10 +280,14 @@ int Trans::load(Lexer & lex) && it->second[1] == accent_2) break; } + + // could not find accent2 on a key -- this should not happen. + if (it == end) + return -1; + docstring allowed; if (!lex.next()) return -1; - allowed = lex.getDocString(); LYXERR(Debug::KBMAP, "allowed: " << to_utf8(allowed)); @@ -299,7 +303,7 @@ int Trans::load(Lexer & lex) if (!lex.next(true)) return -1; - key_from = lex.getString()[0]; + key_from = static_cast(lex.getString()[0]); LYXERR(Debug::KBMAP, "\t`" << lex.getString() << '\''); if (!lex.next(true)) @@ -429,8 +433,8 @@ tex_accent getkeymod(string const & p) // TransFSMData -TransFSMData::TransFSMData() : deadkey_(0), deadkey2_(0), init_state_(0), - deadkey_state_(0), combined_state_(0), currentState(0) +TransFSMData::TransFSMData() : deadkey_(0), deadkey2_(0), init_state_(nullptr), + deadkey_state_(nullptr), combined_state_(nullptr), currentState(nullptr) { }