]> git.lyx.org Git - features.git/commitdiff
Remove confusing warning
authorGeorg Baum <baum@lyx.org>
Mon, 4 Mar 2013 18:48:26 +0000 (19:48 +0100)
committerGeorg Baum <baum@lyx.org>
Mon, 4 Mar 2013 18:50:49 +0000 (19:50 +0100)
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().

src/tex2lyx/Parser.cpp
src/tex2lyx/Parser.h

index d0954cf5c1adb611cbfd9230d76b8cdf7f59736f..1f9ae6c3c553d9ebac9ca097a3713a715d582cf8 100644 (file)
@@ -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;
 }
 
 
index 28d5017bdff650531ef266ebf0dfc4ecd25cec09..89a2d1f3207ad88f1ca56479edd14c88d2cb2523 100644 (file)
@@ -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