From: Lars Gullik Bjønnes Date: Mon, 14 Apr 2003 13:12:40 +0000 (+0000) Subject: lyxlex-2-a.diff X-Git-Tag: 1.6.10~16978 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e25012ddfad9b27467bb1af49f3e6bfcd863b408;p=lyx.git lyxlex-2-a.diff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6795 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 8844b1b958..809138fe74 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-04-14 Lars Gullik Bjønnes + + * lyxlex.[Ch] (text): delete function + * trans.C (Load): adjust + * paragraph_funcs.C (readParToken): adjust + 2003-04-14 Lars Gullik Bjønnes * lyxlex_pimpl.h: get rid of LEX_MAX_BUFF, change buff to be a diff --git a/src/frontends/xforms/FormPreferences.C b/src/frontends/xforms/FormPreferences.C index 6630f8c813..91f47461c2 100644 --- a/src/frontends/xforms/FormPreferences.C +++ b/src/frontends/xforms/FormPreferences.C @@ -223,7 +223,7 @@ void FormPreferences::build() folder = lang_opts_tab_->tabfolder_inner; fl_set_tabfolder_autofit(folder, FL_FIT); } - + // Stack tabs // Now add them to the tabfolder fl_addto_tabfolder(dialog_->tabfolder_prefs, diff --git a/src/lyxlex.C b/src/lyxlex.C index da19717fa9..c590c74c53 100644 --- a/src/lyxlex.C +++ b/src/lyxlex.C @@ -52,12 +52,6 @@ int LyXLex::getLineNo() const } -string const LyXLex::text() const -{ - return pimpl_->getString(); -} - - istream & LyXLex::getStream() { return pimpl_->is; diff --git a/src/lyxlex.h b/src/lyxlex.h index 5f94fc4d68..f78a653c9c 100644 --- a/src/lyxlex.h +++ b/src/lyxlex.h @@ -99,9 +99,6 @@ public: /// int findToken(char const * str[]); - /// - string const text() const; - /** Pushes a token list on a stack and replaces it with a new one. */ void pushTable(keyword_item *, int); diff --git a/src/lyxlex_pimpl.C b/src/lyxlex_pimpl.C index 3248c4a849..90e68b8ecd 100644 --- a/src/lyxlex_pimpl.C +++ b/src/lyxlex_pimpl.C @@ -171,7 +171,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */) // That is not fast... (Lgb) string dummy; getline(is, dummy); - + lyxerr[Debug::LYXLEX] << "Comment read: `" << c << dummy << '\'' << endl; #else @@ -184,7 +184,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */) if (c == '\"') { buff.clear(); - + do { is.get(cc); c = cc; @@ -212,7 +212,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */) // lot better to use the functions from cctype if (c > ' ' && is) { buff.clear(); - + do { buff.push_back(c); is.get(cc); @@ -255,7 +255,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */) if (c == '\\') { // escape buff.clear(); - + do { if (c == '\\') { // escape the next char @@ -277,7 +277,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */) // That is still not fast... (Lgb) string dummy; getline(is, dummy); - + lyxerr[Debug::LYXLEX] << "Comment read: `" << c << dummy << '\'' << endl; #else @@ -292,7 +292,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */) // string if (c == '\"') { buff.clear(); - + bool escaped = false; do { escaped = false; @@ -326,7 +326,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */) if (c > ' ' && is) { buff.clear(); - + do { if (c == '\\') { // escape the next char @@ -384,7 +384,7 @@ int LyXLex::Pimpl::lex() bool LyXLex::Pimpl::eatLine() { buff.clear(); - + unsigned char c = '\0'; char cc = 0; while (is && c != '\n') { @@ -433,7 +433,7 @@ bool LyXLex::Pimpl::nextToken() c = cc; if (c >= ' ' && is) { buff.clear(); - + if (c == '\\') { // first char == '\\' do { buff.push_back(c); diff --git a/src/paragraph_funcs.C b/src/paragraph_funcs.C index cd3937c8c4..1f807c05f9 100644 --- a/src/paragraph_funcs.C +++ b/src/paragraph_funcs.C @@ -973,11 +973,11 @@ int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & tok lex.eatLine(); #if USE_BOOST_FORMAT boost::format fmt(_("Unknown token: %1$s %2$s\n")); - fmt % token % lex.text(); + fmt % token % lex.getString(); string const s = fmt.str(); #else string const s = _("Unknown token: ") + token - + ' ' + lex.text() + '\n'; + + ' ' + lex.getString() + '\n'; #endif // we can do this here this way because we're actually reading // the buffer and don't care about LyXText right now. diff --git a/src/trans.C b/src/trans.C index 683869db62..3c191cdd9e 100644 --- a/src/trans.C +++ b/src/trans.C @@ -115,10 +115,10 @@ int Trans::Load(LyXLex & lex) case KMOD: { if (lyxerr.debugging(Debug::KBMAP)) - lyxerr << "KMOD:\t" << lex.text() << endl; + lyxerr << "KMOD:\t" << lex.getString() << endl; if (lex.next(true)) { if (lyxerr.debugging(Debug::KBMAP)) - lyxerr << "key\t`" << lex.text() + lyxerr << "key\t`" << lex.getString() << '\'' << endl; } else return -1; @@ -127,7 +127,7 @@ int Trans::Load(LyXLex & lex) if (lex.next(true)) { if (lyxerr.debugging(Debug::KBMAP)) - lyxerr << "accent\t`" << lex.text() + lyxerr << "accent\t`" << lex.getString() << '\'' << endl; } else return -1; @@ -143,7 +143,7 @@ int Trans::Load(LyXLex & lex) // so that this field is not present anymore. if (lex.next(true)) { if (lyxerr.debugging(Debug::KBMAP)) - lyxerr << "allowed\t`" << lex.text() + lyxerr << "allowed\t`" << lex.getString() << '\'' << endl; } else return -1; @@ -160,7 +160,7 @@ int Trans::Load(LyXLex & lex) lyxerr[Debug::KBMAP] << "KCOMB:" << endl; if (lex.next(true)) { - str= lex.text(); + str = lex.getString(); lyxerr[Debug::KBMAP] << str << endl; } else return -1; @@ -169,7 +169,7 @@ int Trans::Load(LyXLex & lex) if (accent_1 == TEX_NOACCENT) return -1; if (lex.next(true)) { - str = lex.text(); + str = lex.getString(); lyxerr[Debug::KBMAP] << str << endl; } else return -1; @@ -214,17 +214,17 @@ int Trans::Load(LyXLex & lex) unsigned char key_from; if (lyxerr.debugging(Debug::KBMAP)) - lyxerr << "KMAP:\t" << lex.text() << endl; + lyxerr << "KMAP:\t" << lex.getString() << endl; if (lex.next(true)) { - key_from = lex.text()[0]; + key_from = lex.getString()[0]; if (lyxerr.debugging(Debug::KBMAP)) - lyxerr << "\t`" << lex.text() << '\'' + lyxerr << "\t`" << lex.getString() << '\'' << endl; } else return -1; if (lex.next(true)) { - string string_to = lex.text(); + string const string_to = lex.getString(); keymap_[key_from] = string_to; if (lyxerr.debugging(Debug::KBMAP)) lyxerr << "\t`" << string_to << '\'' @@ -240,10 +240,10 @@ int Trans::Load(LyXLex & lex) string str; if (lyxerr.debugging(Debug::KBMAP)) - lyxerr << "KXMOD:\t" << lex.text() << endl; + lyxerr << "KXMOD:\t" << lex.getString() << endl; if (lex.next(true)) { if (lyxerr.debugging(Debug::KBMAP)) - lyxerr << "\t`" << lex.text() << '\'' + lyxerr << "\t`" << lex.getString() << '\'' << endl; accent = getkeymod(lex.getString()); } else @@ -251,17 +251,17 @@ int Trans::Load(LyXLex & lex) if (lex.next(true)) { if (lyxerr.debugging(Debug::KBMAP)) - lyxerr << "\t`" << lex.text() << '\'' + lyxerr << "\t`" << lex.getString() << '\'' << endl; - key = lex.text()[0]; + key = lex.getString()[0]; } else return -1; if (lex.next(true)) { if (lyxerr.debugging(Debug::KBMAP)) - lyxerr << "\t`" << lex.text() << '\'' + lyxerr << "\t`" << lex.getString() << '\'' << endl; - str = lex.text(); + str = lex.getString(); } else return -1;