]> git.lyx.org Git - lyx.git/blob - src/ImportLaTeX.C
fix the smallcaps drawing, move xfont metrics functions out from LyXFont, move non...
[lyx.git] / src / ImportLaTeX.C
1 /* This file is part of
2  * ====================================================== 
3  * 
4  *           LyX, The Document Processor         
5  *           Copyright 1995 Matthias Ettrich
6  *           Copyright 1995-2000 The LyX Team.
7  *
8  *           This file is Copyright 1998
9  *           Asger Alstrup
10  *
11  * ====================================================== 
12  */
13
14 #include <config.h>
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif
19
20 #include "ImportLaTeX.h"
21 #include "lyxrc.h"
22 #include "support/syscall.h"
23 #include "support/filetools.h"
24 #include "bufferlist.h"
25
26 extern BufferList bufferlist;
27
28 /*
29  * CLASS ImportLaTeX
30  */
31
32 ImportLaTeX::ImportLaTeX(string const & file)
33                 : file(file)
34 {
35 }
36
37
38 Buffer * ImportLaTeX::run()
39 {
40         // run reLyX
41         string tmp = lyxrc.relyx_command + " -f " + file;
42         Systemcalls one;
43         Buffer * buf = 0;
44         int result = one.startscript(Systemcalls::System, tmp);
45         if (result == 0) {
46                 string filename = ChangeExtension(file, ".lyx", false);
47                 // File was generated without problems. Load it.
48                 buf = bufferlist.loadLyXFile(filename);
49         }
50         return buf;
51 }