}
-bool TransManager::setCharset(string const & str)
-{
- return chset_.loadFile(str);
-}
-
-
void TransManager::enablePrimary()
{
if (t1_->isDefined())
active_ = t1_.get();
- lyxerr[Debug::KBMAP] << "Enabling primary keymap" << endl;
+ LYXERR(Debug::KBMAP) << "Enabling primary keymap" << endl;
}
{
if (t2_->isDefined())
active_ = t2_.get();
- lyxerr[Debug::KBMAP] << "Enabling secondary keymap" << endl;
+ LYXERR(Debug::KBMAP) << "Enabling secondary keymap" << endl;
}
void TransManager::disableKeymap()
{
active_ = &default_;
- lyxerr[Debug::KBMAP] << "Disabling keymap" << endl;
+ LYXERR(Debug::KBMAP) << "Disabling keymap" << endl;
}
}
-void TransManager::insertVerbatim(docstring const & str, LyXText * text, LCursor & cur)
+void TransManager::insert(docstring const & str, LyXText * text, LCursor & cur)
{
for (string::size_type i = 0, n = str.size(); i < n; ++i)
text->insertChar(cur, str[i]);
}
-void TransManager::insert(docstring const & str, LyXText * text, LCursor & cur)
-{
- // Go through the character encoding only if the current
- // encoding (chset_->name()) matches the current font_norm
- // (lyrxc->font_norm)
-
- // Is false to speak about "only if" the current encoding will
- // almost always be equal to font_norm.
- pair<bool, int> enc = chset_.encodeString(to_utf8(str));
- if (chset_.getName() != lyxrc.font_norm ||
- !enc.first) {
- // Could not find an encoding
- insertVerbatim(str, text, cur);
- return;
- }
- text->insertChar(cur, enc.second);
-}
-
-
void TransManager::deadkey(char_type c, tex_accent accent, LyXText * t, LCursor & cur)
{
if (c == 0 && active_ != &default_) {