]> git.lyx.org Git - lyx.git/commitdiff
short cut for using converter scripts from lib/scripts
authorAndré Pönitz <poenitz@gmx.net>
Wed, 17 Jul 2002 14:57:37 +0000 (14:57 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 17 Jul 2002 14:57:37 +0000 (14:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4681 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/converter.C
src/graphics/GraphicsConverter.C
src/lyx_main.C

index 452dfa8cf5f33a6b2900dcd1bc98a386d311046c..b952594f9f10532c2ddeab23f8b94de7dc4b3f65 100644 (file)
@@ -1,3 +1,10 @@
+
+2002-07-15  André Pönitz <poenitz@gmx.net>
+       
+       * converter.C: add support for $$s (scripts from lib/scripts dir)
+       * lyx_main.C: white space
+
+
 2002-07-17  John Levon  <moz@compsoc.man.ac.uk>
 
        * bufferlist.C:
index b36c0c9a34e8c44c08cbca8780d76eef827f7d63..0e72ca8958e9022b0292f1892a4c76d9b4bb39f0 100644 (file)
@@ -46,11 +46,14 @@ 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");
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -624,15 +627,15 @@ bool Converters::convert(Buffer const * buffer,
                                runLaTeX(buffer, latex_command_);
                        }
 
-                       string infile2 = (conv.original_dir)
+                       string const infile2 = (conv.original_dir)
                                ? infile : MakeRelPath(infile, path);
-                       string outfile2 = (conv.original_dir)
+                       string const 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");
 
                        if (!conv.parselog.empty())
                                command += " 2> " + QuoteName(infile2 + ".out");
index 1182811e4ddd65820701f11c2e0d7ee73314e90c..31ac475372c7c077a72cafbd03cbe4f9e0868679 100644 (file)
@@ -28,6 +28,8 @@
 #include <fstream>
 #include <sys/types.h> // needed for pid_t
 
+extern string system_lyxdir;
+
 using std::endl;
 
 namespace grfx {
@@ -272,6 +274,7 @@ bool build_script(string const & from_file,
        string const token_from("$$i");
        string const token_base("$$b");
        string const token_to("$$o");
+       string const token_lib("$$s");
 
        EdgePath::const_iterator it  = edgepath.begin();
        EdgePath::const_iterator end = edgepath.end();
@@ -292,6 +295,7 @@ bool build_script(string const & from_file,
                command = subst(command, token_from, "${infile}");
                command = subst(command, token_base, "${infile_base}");
                command = subst(command, token_to,   "${outfile}");
+               command = subst(command, token_lib,  system_lyxdir + "scripts");
 
                // Store in the shell script
                script << "\n" << command << "\n\n";
index 0e9e289c9e75c0c1fc41e065d21185b3f9ad9b38..0ac6fa81d799a9684dc051db9a6cf640e0ddd6b6 100644 (file)
@@ -240,7 +240,7 @@ void LyX::init(bool gui)
        // If we had a command line switch, system_lyxdir is already set
        string searchpath;
        if (!system_lyxdir.empty())
-               searchpath= MakeAbsPath(system_lyxdir) + ';';
+               searchpath = MakeAbsPath(system_lyxdir) + ';';
 
        // LYX_DIR_13x environment variable
        string const lyxdir = GetEnvPath("LYX_DIR_13x");