The branch, master, has been updated. - Log -----------------------------------------------------------------
commit ae7bc12ab671d20d6ee9deef55b2e8b65f17c6bf Author: Richard Heck <[email protected]> Date: Wed Dec 5 11:16:21 2012 -0500 Disentangle moduleCanBeAdded for ordinary layout modules and the new (but not yet functioning, it seems) citation modules. This fixes a bug reported on the list: http://marc.info/?l=lyx-users&m=135456590710371&w=2 diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 404c9a2..e672525 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -2084,10 +2084,15 @@ void BufferParams::makeDocumentClass() } -bool BufferParams::moduleCanBeAdded(string const & modName) const +bool BufferParams::layoutModuleCanBeAdded(string const & modName) const { - return cite_engine_.moduleCanBeAdded(modName, baseClass()) && - layout_modules_.moduleCanBeAdded(modName, baseClass()); + return layout_modules_.moduleCanBeAdded(modName, baseClass()); +} + + +bool BufferParams::citationModuleCanBeAdded(string const & modName) const +{ + return cite_engine_.moduleCanBeAdded(modName, baseClass()); } diff --git a/src/BufferParams.h b/src/BufferParams.h index 98f79a5..80025ab 100644 --- a/src/BufferParams.h +++ b/src/BufferParams.h @@ -146,13 +146,15 @@ public: { return removed_modules_; } /// /// Add a module to the list of modules in use. This checks only that the - /// module is not already in the list, so use moduleIsCompatible first if - /// you want to check for compatibility. + /// module is not already in the list, so use layoutModuleCanBeAdeed first + /// if you want to check for compatibility. /// \return true if module was successfully added. bool addLayoutModule(std::string const & modName); /// checks to make sure module's requriements are satisfied, that it does /// not conflict with already-present modules, isn't already loaded, etc. - bool moduleCanBeAdded(std::string const & modName) const; + bool layoutModuleCanBeAdded(std::string const & modName) const; + /// same, but for citaton modules. + bool citationModuleCanBeAdded(std::string const & modName) const; /// void addRemovedModule(std::string const & modName) { removed_modules_.push_back(modName); } diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 31c95cf..fd26a81 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -1274,7 +1274,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr) case LFUN_LAYOUT_MODULE_ADD: { BufferParams const & params = buffer_.params(); - if (!params.moduleCanBeAdded(argument)) { + if (!params.layoutModuleCanBeAdded(argument)) { LYXERR0("Module `" << argument << "' cannot be added due to failed requirements or " "conflicts with installed modules."); diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 73ece2e..dbdf691 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -341,7 +341,7 @@ void ModuleSelectionManager::updateAddPB() string const modname = getAvailableModel()->getIDString(idx.row()); bool const enable = - container_->params().moduleCanBeAdded(modname); + container_->params().layoutModuleCanBeAdded(modname); addPB->setEnabled(enable); } commit 255ca92be24e45929beeaf0b5596586f6b3078f8 Author: Richard Heck <[email protected]> Date: Wed Dec 5 10:49:35 2012 -0500 Minor formatting stuff. diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 51c3d41..404c9a2 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -2061,17 +2061,16 @@ void BufferParams::makeDocumentClass() return; LayoutModuleList mods; - LayoutModuleList::iterator it; - LayoutModuleList::iterator en; - - it = layout_modules_.begin(); - en = layout_modules_.end(); + LayoutModuleList::iterator it = layout_modules_.begin(); + LayoutModuleList::iterator en = layout_modules_.end(); for (; it != en; ++it) mods.push_back(*it); + it = cite_engine_.begin(); en = cite_engine_.end(); for (; it != en; ++it) mods.push_back(*it); + doc_class_ = getDocumentClass(*baseClass(), mods); if (!local_layout.empty()) { ----------------------------------------------------------------------- Summary of changes: src/BufferParams.cpp | 20 ++++++++++++-------- src/BufferParams.h | 8 +++++--- src/BufferView.cpp | 2 +- src/frontends/qt4/GuiDocument.cpp | 2 +- 4 files changed, 19 insertions(+), 13 deletions(-) hooks/post-receive -- The LyX Source Repository
