mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
Put the dummy tex2lyx support where it is supposed to be.
This commit is contained in:
parent
320edd1c24
commit
2335d196b4
@ -419,9 +419,16 @@ bool Converters::convert(Buffer const * buffer,
|
|||||||
Systemcall::Starttype starttype =
|
Systemcall::Starttype starttype =
|
||||||
(buffer && buffer->isClone()) ?
|
(buffer && buffer->isClone()) ?
|
||||||
Systemcall::WaitLoop : Systemcall::Wait;
|
Systemcall::WaitLoop : Systemcall::Wait;
|
||||||
one.startscript(starttype, command,
|
int const exitval = one.startscript(starttype, command,
|
||||||
buffer ? buffer->filePath() : string(),
|
buffer ? buffer->filePath() : string(),
|
||||||
buffer ? buffer->layoutPos() : string());
|
buffer ? buffer->layoutPos() : string());
|
||||||
|
if (exitval == Systemcall::KILLED) {
|
||||||
|
frontend::Alert::warning(
|
||||||
|
_("Converter killed"),
|
||||||
|
bformat(_("The running converter\n %1$s\nwas killed by the user."),
|
||||||
|
from_utf8(command)));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (to_file.isReadableFile()) {
|
if (to_file.isReadableFile()) {
|
||||||
if (conversionflags & try_cache)
|
if (conversionflags & try_cache)
|
||||||
ConverterCache::get().add(orig_from,
|
ConverterCache::get().add(orig_from,
|
||||||
@ -567,6 +574,8 @@ bool Converters::convert(Buffer const * buffer,
|
|||||||
&& !contains(command, "-shell-escape"))
|
&& !contains(command, "-shell-escape"))
|
||||||
command += " -shell-escape ";
|
command += " -shell-escape ";
|
||||||
LYXERR(Debug::FILES, "Running " << command);
|
LYXERR(Debug::FILES, "Running " << command);
|
||||||
|
// FIXME KILLED
|
||||||
|
// Check changed return value here.
|
||||||
if (!runLaTeX(*buffer, command, runparams, errorList))
|
if (!runLaTeX(*buffer, command, runparams, errorList))
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -595,6 +604,8 @@ bool Converters::convert(Buffer const * buffer,
|
|||||||
LYXERR(Debug::FILES, "Running "
|
LYXERR(Debug::FILES, "Running "
|
||||||
<< command
|
<< command
|
||||||
<< " to update aux file");
|
<< " to update aux file");
|
||||||
|
// FIXME KILLED
|
||||||
|
// Check changed return value here.
|
||||||
if (!runLaTeX(*buffer, command,
|
if (!runLaTeX(*buffer, command,
|
||||||
runparams, errorList))
|
runparams, errorList))
|
||||||
return false;
|
return false;
|
||||||
@ -652,6 +663,14 @@ bool Converters::convert(Buffer const * buffer,
|
|||||||
: string(),
|
: string(),
|
||||||
buffer ? buffer->layoutPos()
|
buffer ? buffer->layoutPos()
|
||||||
: string());
|
: string());
|
||||||
|
if (res == Systemcall::KILLED) {
|
||||||
|
frontend::Alert::warning(
|
||||||
|
_("Converter killed"),
|
||||||
|
bformat(_("The running converter\n %1$s\nwas killed by the user."),
|
||||||
|
from_utf8(command)));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!real_outfile.empty()) {
|
if (!real_outfile.empty()) {
|
||||||
Mover const & mover = getMover(conv.to());
|
Mover const & mover = getMover(conv.to());
|
||||||
if (!mover.rename(outfile, real_outfile))
|
if (!mover.rename(outfile, real_outfile))
|
||||||
@ -669,10 +688,17 @@ bool Converters::convert(Buffer const * buffer,
|
|||||||
string const command2 = conv.parselog() +
|
string const command2 = conv.parselog() +
|
||||||
" < " + quoteName(infile2 + ".out") +
|
" < " + quoteName(infile2 + ".out") +
|
||||||
" > " + quoteName(logfile);
|
" > " + quoteName(logfile);
|
||||||
one.startscript(starttype,
|
res = one.startscript(starttype,
|
||||||
to_filesystem8bit(from_utf8(command2)),
|
to_filesystem8bit(from_utf8(command2)),
|
||||||
buffer->filePath(),
|
buffer->filePath(),
|
||||||
buffer->layoutPos());
|
buffer->layoutPos());
|
||||||
|
if (res == Systemcall::KILLED) {
|
||||||
|
frontend::Alert::warning(
|
||||||
|
_("Converter killed"),
|
||||||
|
bformat(_("The running converter\n %1$s\nwas killed by the user."),
|
||||||
|
from_utf8(command)));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!scanLog(*buffer, command, makeAbsPath(logfile, path), errorList))
|
if (!scanLog(*buffer, command, makeAbsPath(logfile, path), errorList))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -800,6 +826,8 @@ bool Converters::scanLog(Buffer const & buffer, string const & /*command*/,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FIXME KILL
|
||||||
|
// Probably need to return an INT here
|
||||||
bool Converters::runLaTeX(Buffer const & buffer, string const & command,
|
bool Converters::runLaTeX(Buffer const & buffer, string const & command,
|
||||||
OutputParams const & runparams, ErrorList & errorList)
|
OutputParams const & runparams, ErrorList & errorList)
|
||||||
{
|
{
|
||||||
|
@ -129,6 +129,16 @@ frontend::FontMetrics const & theFontMetrics(FontInfo const &) {
|
|||||||
return dummy;
|
return dummy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Dummy theApp() support (needed by support/Systemcall.cpp)
|
||||||
|
//
|
||||||
|
struct App {
|
||||||
|
bool cancel_export;
|
||||||
|
};
|
||||||
|
|
||||||
|
App app;
|
||||||
|
App * theApp() { return &app; }
|
||||||
|
|
||||||
//
|
//
|
||||||
// Keep the linker happy on Windows
|
// Keep the linker happy on Windows
|
||||||
//
|
//
|
||||||
|
@ -49,15 +49,6 @@ using namespace lyx::support::os;
|
|||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
|
|
||||||
|
|
||||||
struct App {
|
|
||||||
bool cancel_export;
|
|
||||||
};
|
|
||||||
|
|
||||||
App app;
|
|
||||||
App * theApp() { return &app; }
|
|
||||||
|
|
||||||
|
|
||||||
string const trimSpaceAndEol(string const & a)
|
string const trimSpaceAndEol(string const & a)
|
||||||
{
|
{
|
||||||
return trim(a, " \t\n\r");
|
return trim(a, " \t\n\r");
|
||||||
|
Loading…
Reference in New Issue
Block a user