]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
This commit adds some new functionality to the modules stuff. In particular, it intro...
[lyx.git] / src / BufferParams.cpp
index bc316e24f43558535c094f87b01da8a96392d0a8..9e2ff3c57e20702ea2b02280480f8880b1158e42 100644 (file)
@@ -810,6 +810,14 @@ void BufferParams::writeFile(ostream & os) const
 
 void BufferParams::validate(LaTeXFeatures & features) const
 {
+       if (!getTextClass().requires().empty()) {
+               vector<string> req = getTextClass().requires();
+               for (vector<string>::const_iterator it = req.begin();
+                    it != req.end(); ++it) {
+                       features.require(*it);
+               }
+       }
+
        if (outputChanges) {
                bool dvipost    = LaTeXFeatures::isAvailable("dvipost");
                bool xcolorsoul = LaTeXFeatures::isAvailable("soul") &&
@@ -1413,7 +1421,7 @@ void BufferParams::makeTextClass()
                                                "may not be possible.\n"), from_utf8(modName));
                        frontend::Alert::warning(_("Package not available"), msg);
                }
-               FileName layout_file = libFileSearch("layouts", lm->filename);
+               FileName layout_file = libFileSearch("layouts", lm->getFilename());
                textClass_->read(layout_file, TextClass::MODULE);
        }
 }
@@ -1425,7 +1433,7 @@ vector<string> const & BufferParams::getModules() const {
 
 
 
-bool BufferParams::addLayoutModule(string modName) {
+bool BufferParams::addLayoutModule(string const & modName) {
        LayoutModuleList::const_iterator it = layoutModules_.begin();
        LayoutModuleList::const_iterator end = layoutModules_.end();
        for (; it != end; it++) {