]> git.lyx.org Git - lyx.git/blobdiff - src/Encoding.cpp
SCons: msvc does not need this /TP option any more after we rename .C => .cpp. Also...
[lyx.git] / src / Encoding.cpp
index a4cd882f7316d65e8c4be75d10d628f281cebcb8..ae03c09b4869006f41363bf09f4bdca4e2112c66 100644 (file)
 
 #include <sstream>
 
-
-namespace lyx {
-
-using support::FileName;
-
 #ifndef CXX_GLOBAL_CSTD
 using std::strtol;
 #endif
-
 using std::endl;
 using std::string;
 
 
+namespace lyx {
+
+using support::FileName;
+
 Encodings encodings;
 
 namespace {
@@ -521,26 +519,32 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
                        string const iconvname = lex.getString();
                        lex.next();
                        string const width = lex.getString();
-                       bool fixedwidth;
+                       bool fixedwidth;;
                        if (width == "fixed")
                                fixedwidth = true;
                        else if (width == "variable")
                                fixedwidth = false;
-                       else
+                       else {
+                                fixedwidth = false;
                                lex.printError("Encodings::read: "
                                               "Unknown width: `$$Token'");
+                        }
+                        
                        lex.next();
                        string const p = lex.getString();
                        Encoding::Package package;
                        if (p == "none")
-                               package = Encoding::none;
+                                package = Encoding::none;
                        else if (p == "inputenc")
                                package = Encoding::inputenc;
                        else if (p == "CJK")
                                package = Encoding::CJK;
-                       else
+                       else {
+                                package = Encoding::none;
                                lex.printError("Encodings::read: "
                                               "Unknown package: `$$Token'");
+                        }
+                        
                        LYXERR(Debug::INFO) << "Reading encoding " << name << endl;
                        encodinglist[name] = Encoding(name, latexname,
                                                      iconvname, fixedwidth,