1
0
mirror of https://git.lyx.org/repos/lyx.git synced 2025-01-11 03:03:06 +00:00

The default modules should be kept in order.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26801 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2008-10-07 15:53:05 +00:00
parent b0c6099330
commit 2078e09e67
5 changed files with 10 additions and 9 deletions

View File

@ -1483,9 +1483,9 @@ bool BufferParams::setBaseClass(string const & classname)
pimpl_->baseClass_ = classname; pimpl_->baseClass_ = classname;
// add any required modules not already in use // add any required modules not already in use
set<string> const & mods = baseClass()->defaultModules(); list<string> const & mods = baseClass()->defaultModules();
set<string>::const_iterator mit = mods.begin(); list<string>::const_iterator mit = mods.begin();
set<string>::const_iterator men = mods.end(); list<string>::const_iterator men = mods.end();
for (; mit != men; mit++) { for (; mit != men; mit++) {
string const & modName = *mit; string const & modName = *mit;
// see if we're already in use // see if we're already in use

View File

@ -64,7 +64,7 @@ public:
/// check whether the TeX class is available /// check whether the TeX class is available
bool isTeXClassAvailable() const { return texClassAvail_; } bool isTeXClassAvailable() const { return texClassAvail_; }
/// ///
std::set<std::string> const & defaultModules() const { return usemod_; } std::list<std::string> const & defaultModules() const { return usemod_; }
private: private:
/// Construct a layout with default values. Actual values loaded later. /// Construct a layout with default values. Actual values loaded later.
explicit LayoutFile(std::string const & filename, explicit LayoutFile(std::string const & filename,

View File

@ -492,7 +492,8 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
case TC_USEMODULE: { case TC_USEMODULE: {
lexrc.next(); lexrc.next();
string const module = lexrc.getString(); string const module = lexrc.getString();
usemod_.insert(module); if (find(usemod_.begin(), usemod_.end(), module) == usemod_.end())
usemod_.push_back(module);
break; break;
} }

View File

@ -252,7 +252,7 @@ protected:
/// latex packages requested by document class. /// latex packages requested by document class.
std::set<std::string> requires_; std::set<std::string> requires_;
/// modules wanted by document class /// modules wanted by document class
std::set<std::string> usemod_; std::list<std::string> usemod_;
/// ///
unsigned int columns_; unsigned int columns_;
/// ///

View File

@ -1594,9 +1594,9 @@ void GuiDocument::apply(BufferParams & params)
params.addLayoutModule(modules_sel_model_.getIDString(i)); params.addLayoutModule(modules_sel_model_.getIDString(i));
// update the list of removed modules // update the list of removed modules
params.clearRemovedModules(); params.clearRemovedModules();
set<string> const & reqmods = params.baseClass()->defaultModules(); list<string> const & reqmods = params.baseClass()->defaultModules();
set<string>::const_iterator rit = reqmods.begin(); list<string>::const_iterator rit = reqmods.begin();
set<string>::const_iterator ren = reqmods.end(); list<string>::const_iterator ren = reqmods.end();
// check each of the required modules // check each of the required modules
for (; rit != ren; rit++) { for (; rit != ren; rit++) {
vector<string>::const_iterator mit = params.getModules().begin(); vector<string>::const_iterator mit = params.getModules().begin();