diff --git a/src/Buffer.cpp b/src/Buffer.cpp index c902db790a..7f5ebcb17f 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -515,7 +515,7 @@ void Buffer::cloneWithChildren(BufferMap & bufmap, CloneList * clones) const // The clone needs its own DocumentClass, since running updateBuffer() will // modify it, and we would otherwise be sharing it with the original Buffer. - buffer_clone->params().makeDocumentClass(); + buffer_clone->params().makeDocumentClass(true); ErrorList el; cap::switchBetweenClasses( params().documentClassPtr(), buffer_clone->params().documentClassPtr(), @@ -563,7 +563,7 @@ Buffer * Buffer::cloneBufferOnly() const { // The clone needs its own DocumentClass, since running updateBuffer() will // modify it, and we would otherwise be sharing it with the original Buffer. - buffer_clone->params().makeDocumentClass(); + buffer_clone->params().makeDocumentClass(true); ErrorList el; cap::switchBetweenClasses( params().documentClassPtr(), buffer_clone->params().documentClassPtr(), diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 4aaf5457f2..8c61d5a864 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -2044,12 +2044,12 @@ LayoutFileIndex const & BufferParams::baseClassID() const } -void BufferParams::makeDocumentClass() +void BufferParams::makeDocumentClass(bool const clone) { if (!baseClass()) return; - doc_class_ = &(DocumentClassBundle::get().makeDocumentClass(*baseClass(), layout_modules_)); + doc_class_ = &(DocumentClassBundle::get().makeDocumentClass(*baseClass(), layout_modules_, clone)); if (!local_layout.empty()) { if (!doc_class_->read(local_layout, TextClass::MODULE)) { diff --git a/src/BufferParams.h b/src/BufferParams.h index bb29f01d52..0c44b7f369 100644 --- a/src/BufferParams.h +++ b/src/BufferParams.h @@ -123,7 +123,7 @@ public: bool setBaseClass(std::string const & classname); /// Adds the module information to the baseClass information to /// create our local DocumentClass. - void makeDocumentClass(); + void makeDocumentClass(bool const clone = false); /// Returns the DocumentClass currently in use: the BaseClass as modified /// by modules. DocumentClass const & documentClass() const; diff --git a/src/TextClass.cpp b/src/TextClass.cpp index a15f8bf6a4..2a933de796 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -1313,7 +1313,7 @@ DocumentClassBundle & DocumentClassBundle::get() DocumentClass & DocumentClassBundle::makeDocumentClass( - LayoutFile const & baseClass, LayoutModuleList const & modlist) + LayoutFile const & baseClass, LayoutModuleList const & modlist, bool const clone) { DocumentClass & doc_class = newClass(baseClass); LayoutModuleList::const_iterator it = modlist.begin(); @@ -1327,10 +1327,11 @@ DocumentClass & DocumentClassBundle::makeDocumentClass( "this document but has not been found in the list of\n" "available modules. If you recently installed it, you\n" "probably need to reconfigure LyX.\n"), from_utf8(modName)); - frontend::Alert::warning(_("Module not available"), msg); + if (!clone) + frontend::Alert::warning(_("Module not available"), msg); continue; } - if (!lm->isAvailable()) { + if (!lm->isAvailable() && !clone) { docstring const prereqs = from_utf8(getStringFromVector(lm->prerequisites(), "\n\t")); docstring const msg = bformat(_("The module %1$s requires a package that is not\n" @@ -1343,7 +1344,7 @@ DocumentClass & DocumentClassBundle::makeDocumentClass( frontend::Alert::warning(_("Package not available"), msg, true); } FileName layout_file = libFileSearch("layouts", lm->getFilename()); - if (!doc_class.read(layout_file, TextClass::MODULE)) { + if (!doc_class.read(layout_file, TextClass::MODULE) && !clone) { docstring const msg = bformat(_("Error reading module %1$s\n"), from_utf8(modName)); frontend::Alert::warning(_("Read Error"), msg); diff --git a/src/TextClass.h b/src/TextClass.h index dc30062922..85f1fb4876 100644 --- a/src/TextClass.h +++ b/src/TextClass.h @@ -467,7 +467,8 @@ public: /// \return A new DocumentClass based on baseClass, with info added /// from the modules in modlist. DocumentClass & makeDocumentClass(LayoutFile const & baseClass, - LayoutModuleList const & modlist); + LayoutModuleList const & modlist, + bool const clone = false); private: /// control instantiation DocumentClassBundle() {} diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 315c32162c..a678755f8d 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -2151,7 +2151,7 @@ void GuiDocument::updateDefaultFormat() if (idx >= 0) { string const classname = classes_model_.getIDString(idx); param_copy.setBaseClass(classname); - param_copy.makeDocumentClass(); + param_copy.makeDocumentClass(true); } outputModule->defaultFormatCO->blockSignals(true); outputModule->defaultFormatCO->clear(); diff --git a/status.20x b/status.20x index 79e52dc048..bdaeb76692 100644 --- a/status.20x +++ b/status.20x @@ -77,6 +77,8 @@ What's new - Fix the missing dynamic menus in general and restore correctly from fullscreen. +- Prevent recurrent pop-up of "missing module requirements" warning (bug 8864). + * DOCUMENTATION AND LOCALIZATION