mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-13 06:20:28 +00:00
a040c0bc6f
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@314 a592a061-630c-0410-9148-cb99ea01b6c8
53 lines
1.1 KiB
C
53 lines
1.1 KiB
C
/* This file is part of
|
|
* ======================================================
|
|
*
|
|
* LyX, The Document Processor
|
|
* Copyright 1995 Matthias Ettrich
|
|
* Copyright 1995-1999 The LyX Team.
|
|
*
|
|
* This file is Copyright 1998
|
|
* Asger Alstrup
|
|
*
|
|
* ======================================================
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#ifdef __GNUG__
|
|
#pragma implementation
|
|
#endif
|
|
|
|
#include "ImportLaTeX.h"
|
|
#include "lyxrc.h"
|
|
#include "support/syscall.h"
|
|
#include "support/filetools.h"
|
|
#include "bufferlist.h"
|
|
|
|
extern LyXRC * lyxrc;
|
|
extern BufferList bufferlist;
|
|
|
|
/*
|
|
* CLASS ImportLaTeX
|
|
*/
|
|
|
|
ImportLaTeX::ImportLaTeX(string const & file)
|
|
: file(file)
|
|
{
|
|
}
|
|
|
|
|
|
Buffer * ImportLaTeX::run()
|
|
{
|
|
// run reLyX
|
|
string tmp = lyxrc->relyx_command + " -f " + file;
|
|
Systemcalls one;
|
|
Buffer * buf = 0;
|
|
int result = one.startscript(Systemcalls::System, tmp);
|
|
if (result == 0) {
|
|
string filename = ChangeExtension(file, ".lyx", false);
|
|
// File was generated without problems. Load it.
|
|
buf = bufferlist.loadLyXFile(filename);
|
|
}
|
|
return buf;
|
|
}
|