]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathFactory.cpp
simplify GuiToc / TocWidget interaction. Much can still be simplified...
[lyx.git] / src / mathed / MathFactory.cpp
index 8af81f3a8d573cb2bfa9b31fcf75a50150d38ccb..6ca7a4d9f6f39684b237289cb09842cb8e416e76 100644 (file)
 #include "insets/InsetCommand.h"
 
 #include "support/docstream.h"
+#include "support/FileName.h"
 #include "support/filetools.h" // LibFileSearch
 #include "support/lstrings.h"
 
 #include "frontends/FontLoader.h"
 
+#include "LyX.h" // use_gui
 
-namespace lyx {
-
-using support::libFileSearch;
-using support::split;
+using namespace std;
+using namespace lyx::support;
 
-using std::string;
-using std::endl;
-using std::istringstream;
-using std::vector;
+namespace lyx {
 
 bool has_math_fonts;
 
@@ -74,7 +71,7 @@ bool has_math_fonts;
 namespace {
 
 // file scope
-typedef std::map<docstring, latexkeys> WordList;
+typedef map<docstring, latexkeys> WordList;
 
 WordList theWordList;
 
@@ -102,14 +99,17 @@ bool math_font_available(docstring & name)
 
 void initSymbols()
 {
-       support::FileName const filename = libFileSearch(string(), "symbols");
+       if (!use_gui)
+               return;
+
+       FileName const filename = libFileSearch(string(), "symbols");
        LYXERR(Debug::MATHED, "read symbols from " << filename);
        if (filename.empty()) {
                lyxerr << "Could not find symbols file" << endl;
                return;
        }
 
-       std::ifstream fs(filename.toFilesystemEncoding().c_str());
+       ifstream fs(filename.toFilesystemEncoding().c_str());
        string line;
        bool skip = false;
        while (getline(fs, line)) {