X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftrans_mgr.C;h=eea9e01464da853a18bb675671ccee5a0d6d7121;hb=a69e7a45780e94f4330a91facfe35126c678e34e;hp=ed240cb5910ae21aba1e51e55d381f415a7a68a4;hpb=85798535a19919e82cc94a177a8414c542a9c5bf;p=lyx.git diff --git a/src/trans_mgr.C b/src/trans_mgr.C index ed240cb591..eea9e01464 100644 --- a/src/trans_mgr.C +++ b/src/trans_mgr.C @@ -17,6 +17,7 @@ #include "support/lstrings.h" using std::endl; +using std::pair; extern string DoAccent(string const &, tex_accent); extern string DoAccent(char, tex_accent); @@ -84,8 +85,7 @@ string TransDeadkeyState::normalkey(char c, char * trans) } if (l == 0) { // Not an exception. Check if it allowed - if (current_view->buffer()->params.allowAccents == true || - countChar(deadkey_info_.allowed, c) > 0) { + if (countChar(deadkey_info_.allowed, c) > 0) { res = DoAccent(c, deadkey_info_.accent); } else { // Not allowed @@ -288,16 +288,18 @@ void TransManager::insertVerbatim(string const & str, LyXText * text) for (int i = 0; i < l; ++i){ if (str[i] == '\"' - && text->GetFont(text->cursor.par, - text->cursor.pos).latex() == LyXFont::OFF) + && text->GetFont(current_view->buffer(),text->cursor.par(), + text->cursor.pos()).latex() == LyXFont::OFF + && text->GetFont(current_view->buffer(),text->cursor.par(), + text->cursor.pos()).language()->lang() != "hebrew") current_view->insertCorrectQuote(); else - text->InsertChar(str[i]); + text->InsertChar(current_view, str[i]); } } -void TransManager::insert(string str, LyXText * text) +void TransManager::insert(string const & str, LyXText * text) { // Go through the character encoding only if the current // encoding (chset_->name()) matches the current font_norm @@ -311,7 +313,7 @@ void TransManager::insert(string str, LyXText * text) // Could not find an encoding InsetLatexAccent ins(str); if (ins.CanDisplay()) { - text->InsertInset(new InsetLatexAccent(ins)); + text->InsertInset(current_view, new InsetLatexAccent(ins)); } else { insertVerbatim(str, text); } @@ -339,7 +341,7 @@ void TransManager::deadkey(char c, tex_accent accent, LyXText * t) KmodInfo i; i.accent = accent; i.allowed = lyx_accent_table[accent].native; - i.data.clear(); + i.data.erase(); i.exception_list = 0; string res = trans_fsm_.currentState->deadkey(c, i);