]> git.lyx.org Git - lyx.git/blobdiff - src/LayoutFile.cpp
listerrors.lyx : Update a link.
[lyx.git] / src / LayoutFile.cpp
index 6471f726aeaa774ff3cfcd787991ac92bf3afc50..541f2dae84290c8f69c305a0c713fc53e66b4f85 100644 (file)
@@ -27,8 +27,8 @@
 #include "support/lassert.h"
 #include "support/lstrings.h"
 
-#include <boost/bind.hpp>
-#include <boost/regex.hpp>
+#include "support/bind.h"
+#include "support/regex.h"
 
 #include <fstream>
 
@@ -37,9 +37,7 @@ using namespace lyx::support;
 
 namespace lyx {
 
-using boost::bind;
-using boost::regex;
-using boost::smatch;
+
 
 LayoutFile::LayoutFile(string const & fn, string const & cln,
                           string const & desc, string const & prereq,
@@ -105,10 +103,8 @@ bool LayoutFileList::read()
        LYXERR(Debug::TCLASS, "Reading textclasses from `" << real_file << "'.");
 
        if (real_file.empty()) {
-               LYXERR0("LayoutFileList::Read: unable to find textclass file  `"
-                   << makeDisplayPath(real_file.absFileName(), 1000)
-                   << "'.");
-               success = false;
+               LYXERR0("LayoutFileList::Read: unable to find textclass file  "
+                   << "`textclass.lst'.");
        } else if (!lex.setFile(real_file)) {
                LYXERR0("LayoutFileList::Read: lyxlex was not able to set file: "
                       << real_file << '.');
@@ -222,7 +218,7 @@ LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass)
        // stdclass.inc. That would give us something moderately usable.
        ofs << "# This layout is automatically generated\n"
               "# \\DeclareLaTeXClass{" << textclass << "}\n\n"
-              "Format 26\n"
+              "Format " << LAYOUT_FORMAT << "\n"
               "Input stdclass.inc\n\n"
            << layoutpost;
        ofs.close();
@@ -235,13 +231,12 @@ LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass)
 
        if (!tc->load(tempLayout.absFileName())) {
                // The only way this happens is because the hardcoded layout file 
-               // aboveis wrong or stdclass.inc cannot be found. So try again 
+               // above is wrong or stdclass.inc cannot be found. So try again 
                // without stdclass.inc.
                ofstream ofs2(tempLayout.toFilesystemEncoding().c_str());
                ofs2 << "# This layout is automatically generated\n"
                        "# \\DeclareLaTeXClass{" << textclass << "}\n\n"
-                       "Format 26\n"
-                       "Input stdclass.inc\n\n"
+                       "Format " << LAYOUT_FORMAT << "\n"
                     << layoutpost;
                ofs2.close();
                if (!tc->load(tempLayout.absFileName())) {
@@ -319,13 +314,7 @@ bool LayoutFileList::load(string const & name, string const & buf_path)
        }
 
        LayoutFile * tc = classmap_[name];
-       if (!tc->load(buf_path)) {
-               docstring s = bformat(_("The document class %1$s "
-                                  "could not be loaded."), from_utf8(name));
-               frontend::Alert::error(_("Could not load class"), s);
-               return false;
-       }
-       return true;
+       return tc->load(buf_path);
 }