]> git.lyx.org Git - lyx.git/blobdiff - src/TextClass.cpp
silence warning
[lyx.git] / src / TextClass.cpp
index ae2dd9f220c10ac58478363c8633d5197d980909..ba1ce19b4d66af6bd131020e230f52ec3e8974b5 100644 (file)
@@ -35,7 +35,6 @@
 
 #include <sstream>
 
-
 using namespace std;
 using namespace lyx::support;
 
@@ -259,8 +258,7 @@ bool TextClass::read(FileName const & filename, ReadType rt)
                                                            "layout");
 
                                if (tmp.empty()) {
-                                       lexrc.printError("Could not find input"
-                                                        "file: " + inc);
+                                       lexrc.printError("Could not find input file: " + inc);
                                        error = true;
                                } else if (read(tmp, MERGE)) {
                                        lexrc.printError("Error reading input"
@@ -396,17 +394,9 @@ bool TextClass::read(FileName const & filename, ReadType rt)
 
                case TC_REQUIRES: {
                        lexrc.eatLine();
-                       string const packages = lexrc.getString();
-                       vector<string> req = getVectorFromString(packages);
-                       if (requires_.empty()) {
-                               requires_ = req;
-                               break;
-                       }
-                       for (vector<string>::const_iterator it = req.begin();
-                            it != req.end(); ++it) {
-                               if (find(requires_.begin(), requires_.end(), *it) == requires_.end())
-                                       requires_.push_back(*it);
-                       }
+                       vector<string> const req 
+                               = getVectorFromString(lexrc.getString());
+                       requires_.insert(req.begin(), req.end());
                        break;
                }
 
@@ -668,7 +658,7 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
        FontInfo labelfont = inherit_font;
        ColorCode bgcolor(Color_background);
        string preamble;
-       vector<string> requires;
+       set<string> requires;
        bool multipar = false;
        bool passthru = false;
        bool needprotect = false;
@@ -753,8 +743,9 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
                        break;
                case IL_REQUIRES: {
                        lexrc.eatLine();
-                       string const packages = lexrc.getString();
-                       requires = getVectorFromString(packages);
+                       vector<string> const req 
+                               = getVectorFromString(lexrc.getString());
+                       requires.insert(req.begin(), req.end());
                        break;
                }
                case IL_END: