]> git.lyx.org Git - features.git/commitdiff
fix reading UTF8 encoded symbol file
authorAndré Pönitz <poenitz@gmx.net>
Sun, 22 Oct 2006 12:07:01 +0000 (12:07 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sun, 22 Oct 2006 12:07:01 +0000 (12:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15472 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/MathMacroTable.C
src/mathed/MathMacroTemplate.C
src/mathed/MathParser.C

index d7e2c0aa17f25a4a21cd28a2d117f341c80947a9..88e794d1d2f10696f85ad717d2297df841906565 100644 (file)
@@ -78,14 +78,6 @@ MacroTable & MacroTable::globalMacros()
 }
 
 
-// The local table.
-//MacroTable & MacroTable::localMacros()
-//{
-//     static MacroTable theLocalMacros;
-//     return theLocalMacros;
-//}
-
-
 bool MacroTable::has(docstring const & name) const
 {
        return find(name) != end();
@@ -102,14 +94,14 @@ MacroData const & MacroTable::get(docstring const & name) const
 
 void MacroTable::insert(docstring const & name, MacroData const & data)
 {
-       //lyxerr << "MacroTable::insert: " << name << endl;
+       //lyxerr << "MacroTable::insert: " << to_utf8(name) << endl;
        operator[](name) = data;
 }
 
 
 void MacroTable::insert(docstring const & def)
 {
-       //lyxerr << "MacroTable::insert, def: " << def << endl;
+       //lyxerr << "MacroTable::insert, def: " << to_utf8(def) << endl;
        std::istringstream is(to_utf8(def));
        MathMacroTemplate mac(is);
        insert(mac.name(), mac.asMacroData());
index d07ae26f7615733df3e054a3ffd1d6c8666de0c6..a260d193f9053874c1c679ff9b97feb44893665f 100644 (file)
@@ -80,7 +80,7 @@ auto_ptr<InsetBase> MathMacroTemplate::doClone() const
 
 void MathMacroTemplate::edit(LCursor & cur, bool)
 {
-       lyxerr << "MathMacroTemplate: edit left/right" << endl;
+       //lyxerr << "MathMacroTemplate: edit left/right" << endl;
        cur.push(*this);
 }
 
index a43a8dba27a0fd396eb6c665b8cb5c91c7632b61..eda20fefffdd9a678d852bc87d47f3700b710870 100644 (file)
@@ -325,7 +325,7 @@ private:
        ///
        void tokenize(docstring const & s);
        ///
-       void skipSpaceTokens(istream & is, char c);
+       void skipSpaceTokens(idocstream & is, char_type c);
        ///
        void push_back(Token const & t);
        ///
@@ -451,7 +451,7 @@ docstring Parser::getArg(char_type left, char_type right)
 }
 
 
-void Parser::skipSpaceTokens(istream & is, char c)
+void Parser::skipSpaceTokens(idocstream & is, char_type c)
 {
        // skip trailing spaces
        while (catcode(c) == catSpace || catcode(c) == catNewline)
@@ -466,7 +466,7 @@ void Parser::tokenize(istream & is)
 {
        // eat everything up to the next \end_inset or end of stream
        // and store it in s for further tokenization
-       docstring s;
+       std::string s;
        char c;
        while (is.get(c)) {
                s += c;
@@ -480,15 +480,15 @@ void Parser::tokenize(istream & is)
                is.unget();
 
        // tokenize buffer
-       tokenize(s);
+       tokenize(from_utf8(s));
 }
 
 
 void Parser::tokenize(docstring const & buffer)
 {
-       istringstream is(to_utf8(buffer), ios::in | ios::binary);
+       idocstringstream is(buffer, ios::in | ios::binary);
 
-       char c;
+       char_type c;
        while (is.get(c)) {
                //lyxerr << "reading c: " << c << endl;