]> git.lyx.org Git - lyx.git/blobdiff - src/Encoding.cpp
* BufferView::updateMetrics(): split up the method in two for the SinglePar case.
[lyx.git] / src / Encoding.cpp
index a4cd882f7316d65e8c4be75d10d628f281cebcb8..c6441f1dc05607d49ee8f780c7f0400ada17c3c6 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,30 @@ 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 = false;
                        if (width == "fixed")
                                fixedwidth = true;
                        else if (width == "variable")
                                fixedwidth = false;
-                       else
+                       else {
                                lex.printError("Encodings::read: "
                                               "Unknown width: `$$Token'");
+                        }
+                        
                        lex.next();
                        string const p = lex.getString();
-                       Encoding::Package package;
+                       Encoding::Package package = Encoding::none;
                        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 {
                                lex.printError("Encodings::read: "
                                               "Unknown package: `$$Token'");
+                        }
+                        
                        LYXERR(Debug::INFO) << "Reading encoding " << name << endl;
                        encodinglist[name] = Encoding(name, latexname,
                                                      iconvname, fixedwidth,