]> git.lyx.org Git - lyx.git/blobdiff - src/lyxtextclass.C
minimal effort implementation of:
[lyx.git] / src / lyxtextclass.C
index 1790d979b6e2cd4a8b7999f9be39ea323206420d..040cad964961d3efd74390559901a9d18e15f9c7 100644 (file)
@@ -24,6 +24,8 @@
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
 #include "support/filetools.h"
+#include "support/os.h"
+
 #include <boost/filesystem/operations.hpp>
 namespace fs = boost::filesystem;
 
@@ -34,6 +36,7 @@ using lyx::support::makeDisplayPath;
 using lyx::support::quoteName;
 using lyx::support::rtrim;
 using lyx::support::subst;
+using lyx::support::addName;
 
 using std::endl;
 using std::find_if;
@@ -71,7 +74,7 @@ bool layout2layout(string const & filename, string const & tempfile)
        }
 
        std::ostringstream command;
-       command << "python " << quoteName(script)
+       command << lyx::support::os::python() << ' ' << quoteName(script)
                << ' ' << quoteName(filename)
                << ' ' << quoteName(tempfile);
        string const command_str = command.str();
@@ -513,7 +516,6 @@ void LyXTextClass::readOutputType(LyXLex & lexrc)
        keyword_item outputTypeTags[] = {
                { "docbook", DOCBOOK },
                { "latex", LATEX },
-               { "linuxdoc", LINUXDOC },
                { "literate", LITERATE }
        };
 
@@ -525,7 +527,6 @@ void LyXTextClass::readOutputType(LyXLex & lexrc)
                lexrc.printError("Unknown output type `$$Token'");
                return;
        case LATEX:
-       case LINUXDOC:
        case DOCBOOK:
        case LITERATE:
                outputType_ = static_cast<OutputType>(le);
@@ -917,15 +918,17 @@ bool LyXTextClass::load(string const & path) const
        if (loaded_)
                return true;
 
-       // Read style-file, current directory is searched before system ones
-       string real_file = path + "/" + name_ + ".layout";
-       if (!fs::exists(real_file))
-               real_file = libFileSearch("layouts", name_, "layout");
-       loaded_ = const_cast<LyXTextClass*>(this)->read(real_file) == 0;
+       // Read style-file, provided path is searched before the system ones
+       string layout_file;
+       if (!path.empty())
+               layout_file = addName(path, name_ + ".layout");
+       if (layout_file.empty() || !fs::exists(layout_file))
+               layout_file = libFileSearch("layouts", name_, "layout");
+       loaded_ = const_cast<LyXTextClass*>(this)->read(layout_file) == 0;
 
        if (!loaded_) {
                lyxerr << "Error reading `"
-                      << makeDisplayPath(real_file)
+                      << makeDisplayPath(layout_file)
                       << "'\n(Check `" << name_
                       << "')\nCheck your installation and "
                        "try Options/Reconfigure..." << endl;