]> git.lyx.org Git - lyx.git/blobdiff - src/trans.C
Hopefully fix the problem with stateText() in lyxfont.C
[lyx.git] / src / trans.C
index ee3b985ff8b769081166059850969ce06dfc9949..fd777ac4ae76f8fba7271f0f0a3da50eda2cecb6 100644 (file)
@@ -12,6 +12,8 @@
 #include "debug.h"
 #include "trans_mgr.h"
 
+using std::endl;
+
 
 // KmodInfo
 KmodInfo::KmodInfo()
@@ -64,9 +66,7 @@ Trans::~Trans()
 void Trans::InsertException(Trans::keyexc & exclist, char c,
                            string const & data, bool flag, tex_accent accent)
 {
-       keyexc p;
-
-       p = new Keyexc; 
+       keyexc p = new Keyexc; 
        p->next = exclist;
        p->c = c;
 
@@ -259,12 +259,11 @@ int Trans::Load(LyXLex & lex)
                break;
                case KMAP: {
                        unsigned char key_from;
-                       char * string_to;
 
                        if (lyxerr.debugging(Debug::KBMAP))
                                lyxerr << "KMAP:\t" << lex.text() << endl;
                        if (lex.next(true)) {
-                               key_from= lex.text()[0];
+                               key_from = lex.text()[0];
                                if (lyxerr.debugging(Debug::KBMAP))
                                        lyxerr << "\t`" << lex.text() << "'"
                                               << endl;
@@ -273,7 +272,8 @@ int Trans::Load(LyXLex & lex)
 
                        if (lex.next(true)) {
                                char const * t = lex.text();
-                               string_to = strcpy(new char[strlen(t)+1], t);
+                               char * string_to =
+                                       strcpy(new char[strlen(t)+1], t);
                                keymap_[key_from] = string_to;
                                if (lyxerr.debugging(Debug::KBMAP))
                                        lyxerr << "\t`" << string_to << "'"
@@ -371,7 +371,7 @@ int Trans::Load(string const & language)
        if (res == 0) {
                name_ = language;
        } else
-               name_.clear();
+               name_.erase();
 
        return res;
 }