From 5e45cd4c44d0cb122243234d336f478fa2f5b3c1 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 5 Nov 2008 19:32:37 +0000 Subject: [PATCH] Revert the last few patches. I'll commit a more general fix all at once. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27280 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferParams.cpp | 56 ++++---------------------------------------- src/BufferParams.h | 2 -- 2 files changed, 4 insertions(+), 54 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index f1d009279d..3a8b25b5e7 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -1468,40 +1468,6 @@ void BufferParams::setDocumentClass(DocumentClass const * const tc) { } -void BufferParams::removeExcludedModules() -{ - // remove any modules the new base class excludes - list oldModules = getModules(); - clearLayoutModules(); - list::const_iterator oit = oldModules.begin(); - list::const_iterator oen = oldModules.end(); - list const & provmods = baseClass()->providedModules(); - list const & exclmods = baseClass()->excludedModules(); - for (; oit != oen; ++oit) { - string const & modname = *oit; - // are we excluded by the document class? - if (find(exclmods.begin(), exclmods.end(), modname) != exclmods.end()) { - LYXERR0("Module " << modname << " dropped because excluded by document class."); - continue; - } - // determine whether some provided module excludes us or we exclude it - list::const_iterator pit = provmods.begin(); - list::const_iterator pen = provmods.end(); - bool excluded = false; - for (; !excluded && pit != pen; ++pit) { - if (!LyXModule::areCompatible(modname, *pit)) { - LYXERR0("Module " << modname << - " dropped becuase it conflicts with provided module " << *pit); - excluded = true; - } - } - if (excluded) - continue; - layoutModules_.push_back(*oit); - } -} - - void BufferParams::addDefaultModules() { // add any default modules not already in use @@ -1557,14 +1523,12 @@ bool BufferParams::checkModuleConsistency() { continue; } // are we excluded by the document class? - // FIXME This can probably be removed, since removeExcludedModules ought - // already to have done this test. if (find(exclmods.begin(), exclmods.end(), modname) != exclmods.end()) { consistent = false; - LYXERR0("WARNING: Module " << modname << " should already have been dropped!"); + LYXERR0("Module " << modname << " dropped because excluded by document class."); continue; } - // FIXME This test can probably also be dropped, for the same reason. + // determine whether some provided module excludes us or we exclude it list::const_iterator pit = provmods.begin(); list::const_iterator pen = provmods.end(); @@ -1572,7 +1536,8 @@ bool BufferParams::checkModuleConsistency() { for (; !excluded && pit != pen; ++pit) { if (!LyXModule::areCompatible(modname, *pit)) { consistent = false; - LYXERR0("WARNING: Module " << modname << " should already have been dropped!"); + LYXERR0("Module " << modname << + " dropped becuase it conflicts with provided module " << *pit); excluded = true; } } @@ -1662,20 +1627,7 @@ bool BufferParams::setBaseClass(string const & classname) } pimpl_->baseClass_ = classname; - // the previous document class may have loaded some modules that the - // new one excludes, and the new class may provide, etc, some that - // conflict with ones that were already loaded. So we need to go - // through the list and fix everything. I suppose there are various - // ways this could be done, but the following seems to work at the - // moment. (Thanks to Philippe Charpentier for helping work out all - // the bugs---rgh.) - // - // first, we remove any modules the new document class excludes - removeExcludedModules(); - // next, we add any default modules the new class provides addDefaultModules(); - // finally, we perform a general consistency check on the set of - // loaded modules checkModuleConsistency(); return true; diff --git a/src/BufferParams.h b/src/BufferParams.h index 55e67aaa64..af7333364b 100644 --- a/src/BufferParams.h +++ b/src/BufferParams.h @@ -346,8 +346,6 @@ private: /// void readRemovedModules(Lexer &); /// - void removeExcludedModules(); - /// void addDefaultModules(); /// checks for consistency among modules: makes sure requirements /// are met, no modules exclude one another, etc, and resolves any -- 2.39.2