X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTrans.cpp;h=8a74b9ab4c016f949bf598acb523743bd9e0089d;hb=a1da60642c0541b6ebac85dd8b64de8ff993c256;hp=0b642bcb731998c08b09a88776073cb4f703ae60;hpb=f1cba8ff64b369792fd49f5ddf90e8126ab476ac;p=lyx.git diff --git a/src/Trans.cpp b/src/Trans.cpp index 0b642bcb73..8a74b9ab4c 100644 --- a/src/Trans.cpp +++ b/src/Trans.cpp @@ -21,7 +21,6 @@ #include "LyXRC.h" #include "Text.h" -#include "support/convert.h" #include "support/debug.h" #include "support/docstream.h" #include "support/FileName.h" @@ -72,7 +71,9 @@ static TeXAccent lyx_accent_table[] = { {TEX_GRAVE, 0x0300, "grave", LFUN_ACCENT_GRAVE}, {TEX_MACRON, 0x0304, "macron", LFUN_ACCENT_MACRON}, {TEX_TILDE, 0x0303, "tilde", LFUN_ACCENT_TILDE}, - {TEX_UNDERBAR, 0x0320, "underbar", LFUN_ACCENT_UNDERBAR}, + {TEX_PERISPOMENI, 0x0342, "perispomeni", LFUN_ACCENT_PERISPOMENI}, + {TEX_UNDERBAR, 0x0320, "underbar", LFUN_ACCENT_UNDERBAR}, // COMBINING MINUS SIGN BELOW or 0x0331 COMBINING MACRON BELOW ? + {TEX_CEDILLA, 0x0327, "cedilla", LFUN_ACCENT_CEDILLA}, {TEX_UNDERDOT, 0x0323, "underdot", LFUN_ACCENT_UNDERDOT}, {TEX_CIRCUMFLEX, 0x0302, "circumflex", LFUN_ACCENT_CIRCUMFLEX}, @@ -171,7 +172,7 @@ enum { KCOMB = 1, KMOD, KMAP, - KXMOD, + KXMOD }; @@ -189,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; } } @@ -279,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)); @@ -428,10 +433,9 @@ tex_accent getkeymod(string const & p) // TransFSMData -TransFSMData::TransFSMData() +TransFSMData::TransFSMData() : deadkey_(0), deadkey2_(0), init_state_(0), + deadkey_state_(0), combined_state_(0), currentState(0) { - deadkey_ = deadkey2_ = 0; - deadkey_info_.accent = deadkey2_info_.accent = TEX_NOACCENT; } @@ -581,7 +585,7 @@ Trans TransManager::default_; TransManager::TransManager() - : active_(0) + : active_(&default_) {}