// TransManager
+// Initialize static member.
+Trans TransManager::default_;
+
+
TransManager::TransManager()
: active_(0), t1_(new Trans), t2_(new Trans)
{}
-Trans * TransManager::default_ = new Trans;
-
-
TransManager::~TransManager()
{
delete t1_;
void TransManager::DisableKeymap()
{
- active_ = default_;
+ active_ = &default_;
lyxerr[Debug::KBMAP] << "Disabling keymap" << endl;
}
void TransManager::insertVerbatim(string const & str, LyXText * text)
{
- int l = str.length();
+ string::size_type const l = str.length();
- for (int i = 0; i < l; ++i){
+ for (string::size_type i = 0; i < l; ++i) {
if (str[i] == '\"'
&& text->GetFont(current_view->buffer(),text->cursor.par(),
text->cursor.pos()).latex() == LyXFont::OFF
void TransManager::deadkey(char c, tex_accent accent, LyXText * t)
{
- if (c == 0 && active_ != default_) {
+ if (c == 0 && active_ != &default_) {
// A deadkey was pressed that cannot be printed
// or a accent command was typed in the minibuffer
KmodInfo i;
}
}
- if (active_ == default_ || c == 0) {
+ if (active_ == &default_ || c == 0) {
KmodInfo i;
i.accent = accent;
i.allowed = lyx_accent_table[accent].native;