]> git.lyx.org Git - lyx.git/blobdiff - src/chset.C
removed a warning from screen and added CFLAGS in lyx.spec.in.
[lyx.git] / src / chset.C
index f975be413b286531b644f7ce9baa8814ebb9555f..3cb66481060eec90f999e2aac499ce91930abd0b 100644 (file)
@@ -7,7 +7,7 @@
 #include "chset.h"
 #include "support/filetools.h"
 #include "lyxlex.h"
-#include "error.h"
+#include "debug.h"
 
 
 CharacterSet::CharacterSet()
@@ -31,7 +31,7 @@ void CharacterSet::freeMap()
                delete t;
        }
 
-       name_.erase();
+       name_.clear();
 }
 
 
@@ -43,11 +43,12 @@ bool CharacterSet::loadFile(const string& fname)
                return true;    // ascii 7-bit
 
        // open definition file
-       lyxerr.debug("Opening keymap file "+ fname+ ".cdef",Error::KBMAP);
+       lyxerr[Debug::KBMAP]
+               << "Opening keymap file " << fname << ".cdef" << endl;
        string filename = LibFileSearch("kbd", fname.c_str(), "cdef");
        FilePtr f(filename, FilePtr::read);
        if (filename.empty() || !f()) {
-               lyxerr.print("Unable to open keymap file");
+               lyxerr << "Unable to open keymap file" << endl;
                return true;            // no definition, use 7-bit ascii
        }
 
@@ -65,8 +66,8 @@ bool CharacterSet::loadFile(const string& fname)
                
                switch(lex.lex()){
                case LyXLex::LEX_FEOF :
-                       lyxerr.debug("End of parsing of .cdef file",
-                                    Error::KBMAP);
+                       lyxerr[Debug::KBMAP] << "End of parsing of .cdef file"
+                                            << endl;
                        break;
                default:
                        // Get Integer
@@ -86,9 +87,9 @@ bool CharacterSet::loadFile(const string& fname)
                        tempc->next=map_;
                        map_=tempc;
        
-                       if (lyxerr.debugging(Error::KBMAP))
-                               fprintf(stderr, "Chardef: %d to [%s]\n", 
-                                       n, tempc->str.c_str());
+                       if (lyxerr.debugging(Debug::KBMAP))
+                               lyxerr << "Chardef: " << n
+                                      << " to [" << tempc->str << "]" << endl;
                        break;
                }
        }
@@ -97,13 +98,14 @@ bool CharacterSet::loadFile(const string& fname)
 }
 
 
-bool CharacterSet::encodeString(string& str)
+bool CharacterSet::encodeString(string & str)
 {
        Cdef *t=map_;
     
        while(t) {
                if (t->str==str) {
-                       str = tostr(t->ic);
+                       // Can this fail? Why is ic an unsigned char?
+                       str = char(t->ic);
                        break;
                }
                t=t->next;