From: Georg Baum Date: Mon, 4 Mar 2013 18:48:26 +0000 (+0100) Subject: Remove confusing warning X-Git-Tag: 2.1.0beta1~571 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=df4f08862e6827017664c4a56e7e251d03f80400;p=features.git Remove confusing warning I added it because of a misunderstanding. If the encoding is really set too late, to_utf8() in the Token constructor would probably fail, but a non-empty putback buffer is no problem, since it was always created via to_utf8() -> from_utf8(). --- diff --git a/src/tex2lyx/Parser.cpp b/src/tex2lyx/Parser.cpp index d0954cf5c1..1f9ae6c3c5 100644 --- a/src/tex2lyx/Parser.cpp +++ b/src/tex2lyx/Parser.cpp @@ -118,14 +118,9 @@ void debugToken(std::ostream & os, Token const & t, unsigned int flags) // Wrapper // -bool iparserdocstream::setEncoding(std::string const & e) +void iparserdocstream::setEncoding(std::string const & e) { is_ << lyx::setEncoding(e); - if (s_.empty()) - return true; - cerr << "Setting encoding " << e << " too late. The encoding of `" - << to_utf8(s_) << "´ is wrong." << std::endl; - return false; } @@ -266,7 +261,8 @@ bool Parser::setEncoding(std::string const & e) { //cerr << "setting encoding to " << e << std::endl; encoding_iconv_ = e; - return is_.setEncoding(e); + is_.setEncoding(e); + return true; } diff --git a/src/tex2lyx/Parser.h b/src/tex2lyx/Parser.h index 28d5017bdf..89a2d1f320 100644 --- a/src/tex2lyx/Parser.h +++ b/src/tex2lyx/Parser.h @@ -129,7 +129,7 @@ public: operator bool() const { return s_.empty() ? is_ : true; } /// change the encoding of the input stream to \p e (iconv name) - bool setEncoding(std::string const & e); + void setEncoding(std::string const & e); // add to the list of characters to read before actually reading // the stream