]> git.lyx.org Git - lyx.git/blobdiff - src/ModuleList.cpp
Fulfill promise to Andre: TextClass_ptr --> TextClassPtr.
[lyx.git] / src / ModuleList.cpp
index 1095cb60a8b5a278188063b8c975a81560a78602..71e1aaf0d0a262643a69e2be2b29d394d3344fb3 100644 (file)
  */
 
 #include <config.h>
+
 #include "debug.h"
 #include "Lexer.h"
 #include "ModuleList.h"
+
 #include "support/docstring.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
 
+#include <algorithm>
        
-namespace lyx{
-
+using std::endl;
 using std::map;
 using std::string;
 using std::vector;
-using std::endl;
+
+namespace lyx{
+
 using support::FileName;
 using support::libFileSearch;
 using support::makeDisplayPath;
@@ -88,35 +92,35 @@ bool ModuleList::load() {
                default:
                        string const modName = lex.getString();
                        LYXERR(Debug::TCLASS) << "Module name: " << modName << endl;
-                       if (lex.next()) {
-                               string const fname = lex.getString();
-                               LYXERR(Debug::TCLASS) << "Filename: " << fname << endl;
-                               if (lex.next()) {
-                                       string const desc = lex.getString();
-                                       LYXERR(Debug::TCLASS) << "Description: " << desc << endl;
-                                       //FIXME Add packages
-                                       if (lex.next()) {
-                                               string packages = lex.getString();
-                                               LYXERR(Debug::TCLASS) << "Packages: " << packages << endl;
-                                               vector<string> pkgs;
-                                               while (!packages.empty()) {
-                                                       string p;
-                                                       packages = support::split(packages, p, ',');
-                                                       pkgs.push_back(p);
-                                               }
-                                               // This code is run when we have
-                                               // modName, fname, desc, and pkgs
-                                               addLayoutModule(modName, fname, desc, pkgs);
-                                       }
-                               }
+                       if (!lex.next())
+                               break;
+                       string const fname = lex.getString();
+                       LYXERR(Debug::TCLASS) << "Filename: " << fname << endl;
+                       if (!lex.next())
+                               break;
+                       string const desc = lex.getString();
+                       LYXERR(Debug::TCLASS) << "Description: " << desc << endl;
+                       //FIXME Add packages
+                       if (!lex.next())
+                               break;
+                       string packages = lex.getString();
+                       LYXERR(Debug::TCLASS) << "Packages: " << packages << endl;
+                       vector<string> pkgs;
+                       while (!packages.empty()) {
+                               string p;
+                               packages = support::split(packages, p, ',');
+                               pkgs.push_back(p);
                        }
+                       // This code is run when we have
+                       // modName, fname, desc, and pkgs
+                       addLayoutModule(modName, fname, desc, pkgs);
                } // end switch
        } //end while
        
        LYXERR(Debug::TCLASS) << "End of parsing of lyxmodules.lst" << endl;
 
        if (!moduleList.empty())
-               sort(moduleList.begin(), moduleList.end(), moduleSorter());
+               std::sort(moduleList.begin(), moduleList.end(), moduleSorter());
        return true;
 }