]> git.lyx.org Git - lyx.git/blobdiff - src/converter.C
another fix
[lyx.git] / src / converter.C
index 0e72ca8958e9022b0292f1892a4c76d9b4bb39f0..4b3bf5fe86701abdbc51142e966e4aadc34cac81 100644 (file)
@@ -46,14 +46,11 @@ using std::find_if;
 using std::reverse;
 using std::sort;
 
-extern string system_lyxdir;
-
 namespace {
 
 string const token_from("$$i");
 string const token_base("$$b");
 string const token_to("$$o");
-string const token_lib("$$s");
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -627,15 +624,16 @@ bool Converters::convert(Buffer const * buffer,
                                runLaTeX(buffer, latex_command_);
                        }
 
-                       string const infile2 = (conv.original_dir)
+                       string infile2 = (conv.original_dir)
                                ? infile : MakeRelPath(infile, path);
-                       string const outfile2 = (conv.original_dir)
+                       string outfile2 = (conv.original_dir)
                                ? outfile : MakeRelPath(outfile, path);
+
                        string command = conv.command;
                        command = subst(command, token_from, QuoteName(infile2));
                        command = subst(command, token_base, QuoteName(from_base));
                        command = subst(command, token_to, QuoteName(outfile2));
-                       command = subst(command, token_lib, system_lyxdir + "scripts");
+                       command = LibScriptSearch(command);
 
                        if (!conv.parselog.empty())
                                command += " 2> " + QuoteName(infile2 + ".out");
@@ -854,7 +852,7 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
        LaTeX latex(command, name, buffer->filePath());
        TeXErrors terr;
        int result = latex.run(terr,
-                              bv ? bv->owner()->getLyXFunc() : 0);
+                              bv ? &bv->owner()->getLyXFunc() : 0);
 
        if (bv) {
                if ((result & LaTeX::ERRORS)) {