From ccfcd71b36c28a14ef6e7c575c1d78ea639e37f3 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 9 Dec 2009 11:53:16 +0000 Subject: [PATCH] Get rid of Token::asString(), which is equivalent to cs(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32439 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/tex2lyx/Parser.cpp | 8 +------- src/tex2lyx/Parser.h | 4 +--- src/tex2lyx/preamble.cpp | 4 ++-- src/tex2lyx/text.cpp | 6 +++--- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/tex2lyx/Parser.cpp b/src/tex2lyx/Parser.cpp index 70ffb5eed5..0b6bbe2db2 100644 --- a/src/tex2lyx/Parser.cpp +++ b/src/tex2lyx/Parser.cpp @@ -110,12 +110,6 @@ ostream & operator<<(ostream & os, Token const & t) } -string Token::asString() const -{ - return cs_; -} - - string Token::asInput() const { if (cat_ == catComment) @@ -492,7 +486,7 @@ string Parser::verbatimOption() putback(); res += '{' + verbatim_item() + '}'; } else - res += t.asString(); + res += t.cs(); } } return res; diff --git a/src/tex2lyx/Parser.h b/src/tex2lyx/Parser.h index ed2c7211eb..af4e030a29 100644 --- a/src/tex2lyx/Parser.h +++ b/src/tex2lyx/Parser.h @@ -77,14 +77,12 @@ public: /// Token(docstring const & cs, CatCode cat) : cs_(to_utf8(cs)), cat_(cat) {} - /// + /// Returns the token as string std::string const & cs() const { return cs_; } /// Returns the catcode of the token CatCode cat() const { return cat_; } /// char character() const { return cs_.empty() ? 0 : cs_[0]; } - /// Returns the token as string - std::string asString() const; /// Returns the token verbatim std::string asInput() const; diff --git a/src/tex2lyx/preamble.cpp b/src/tex2lyx/preamble.cpp index c7745677ee..b91040b20c 100644 --- a/src/tex2lyx/preamble.cpp +++ b/src/tex2lyx/preamble.cpp @@ -347,7 +347,7 @@ void handle_package(Parser &p, string const & name, string const & opts, if (opts.find(",") == string::npos && one_language == true) { if (opts == "ascii") //change ascii to auto to be in the unicode range, see - //http://bugzilla.lyx.org/show_bug.cgi?id=4719 + //http://www.lyx.org/trac/ticket/4719 h_inputencoding = "auto"; else if (!opts.empty()) h_inputencoding = opts; @@ -741,7 +741,7 @@ void parse_preamble(Parser & p, ostream & os, else if (t.cs() == "def") { string name = p.get_token().cs(); while (p.next_token().cat() != catBegin) - name += p.get_token().asString(); + name += p.get_token().cs(); if (!in_lyx_preamble) h_preamble << "\\def\\" << name << '{' << p.verbatim_item() << "}"; diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index eb88a96958..188152078b 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -1484,9 +1484,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, else simple = false; } else - paramtext += p.get_token().asString(); + paramtext += p.get_token().cs(); } else { - paramtext += p.get_token().asString(); + paramtext += p.get_token().cs(); simple = false; } } @@ -1816,7 +1816,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, else if (t.cs() == "listof") { p.skip_spaces(true); - string const name = p.get_token().asString(); + string const name = p.get_token().cs(); if (context.textclass.floats().typeExist(name)) { context.check_layout(os); begin_inset(os, "FloatList ");