X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fchset.C;h=3cb66481060eec90f999e2aac499ce91930abd0b;hb=a858be7332e331e0244e4dba7b0931b6072ffd3d;hp=f975be413b286531b644f7ce9baa8814ebb9555f;hpb=0eccdd1c3613e5170deb77b22174dd0afde833e9;p=lyx.git diff --git a/src/chset.C b/src/chset.C index f975be413b..3cb6648106 100644 --- a/src/chset.C +++ b/src/chset.C @@ -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;