]> git.lyx.org Git - lyx.git/blobdiff - src/LayoutModuleList.cpp
remove tautology
[lyx.git] / src / LayoutModuleList.cpp
index f02c784a118d49e85e52679fdf36b16752ac6c8e..7b79531efc47a102bd4187caba9ce46cdefe7b3c 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "support/debug.h"
 
+#include <algorithm>
 #include <string>
 #include <vector>
 
@@ -34,7 +35,7 @@ namespace lyx {
 // moment. (Thanks to Philippe Charpentier for helping work out all 
 // the bugs---rgh.)
 bool LayoutModuleList::adaptToBaseClass(LayoutFile const * const lay,
-               std::list<string> removedModules)
+               std::list<string> const & removedModules)
 {
        // first, we remove any modules the new document class itself provides,
        // those it excludes, and those that conflict with ones it excludes.
@@ -47,7 +48,7 @@ bool LayoutModuleList::adaptToBaseClass(LayoutFile const * const lay,
        // loaded modules. it's a hassle that we have to do this now, since
        // we just went through them a bit ago, but things might have changed
        // with the loading of the default modules.
-       retval |= checkModuleConsistency(lay);
+       retval = (checkModuleConsistency(lay) || retval);
        return retval;
 }
 
@@ -62,7 +63,7 @@ bool LayoutModuleList::moduleCanBeAdded(string const & modName,
                if (*it == modName) 
                        return false;
 
-       LyXModule const * const lm = moduleList[modName];
+       LyXModule const * const lm = theModuleList[modName];
        if (!lm)
                return true;
 
@@ -207,7 +208,8 @@ bool LayoutModuleList::removeBadModules(LayoutFile const * const lay)
 // Perform a consistency check on the set of modules. We need to make
 // sure that none of the modules exclude each other and that requires
 // are satisfied.
-bool LayoutModuleList::checkModuleConsistency(LayoutFile const * const lay) {
+bool LayoutModuleList::checkModuleConsistency(LayoutFile const * const lay) 
+{
        bool consistent = true;
        LayoutModuleList oldModules = *this;
        clear();
@@ -234,7 +236,7 @@ bool LayoutModuleList::checkModuleConsistency(LayoutFile const * const lay) {
 
                // determine whether some provided module or some prior module
                // satisfies our requirements
-               LyXModule const * const oldmod = moduleList[modname];
+               LyXModule const * const oldmod = theModuleList[modname];
                if (!oldmod) {
                        LYXERR0("Default module " << modname << 
                                        " added although it is unavailable and can't check requirements.");