mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 19:25:39 +00:00
Return early from the short path.
This commit is contained in:
parent
f1d5926a5d
commit
aa794a8806
@ -766,11 +766,30 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
|
||||
// in a comment or doing a dryrun
|
||||
return;
|
||||
|
||||
if (isInputOrInclude(params()) &&
|
||||
isLyXFileName(included_file.absFileName())) {
|
||||
// if it's a LyX file and we're inputting or including,
|
||||
// try to load it so we can write the associated latex
|
||||
if (!isInputOrInclude(params()) ||
|
||||
!isLyXFileName(included_file.absFileName())) {
|
||||
// In this case, it's not a LyX file, so we copy the file
|
||||
// to the temp dir, so that .aux files etc. are not created
|
||||
// in the original dir. Files included by this file will be
|
||||
// found via either the environment variable TEXINPUTS, or
|
||||
// input@path, see ../Buffer.cpp.
|
||||
unsigned long const checksum_in = included_file.checksum();
|
||||
unsigned long const checksum_out = writefile.checksum();
|
||||
if (checksum_in != checksum_out) {
|
||||
if (!included_file.copyTo(writefile)) {
|
||||
// FIXME UNICODE
|
||||
LYXERR(Debug::LATEX,
|
||||
to_utf8(bformat(_("Could not copy the file\n%1$s\n"
|
||||
"into the temporary directory."),
|
||||
from_utf8(included_file.absFileName()))));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// it's a LyX file and we're inputting or including, so
|
||||
// try to load it so we can write the associated latex
|
||||
Buffer * tmp = loadIfNeeded();
|
||||
if (!tmp) {
|
||||
if (!runparams.silent) {
|
||||
@ -911,26 +930,6 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
|
||||
throw ExceptionMessage(ErrorException, _("Error: "), msg);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// In this case, it's not a LyX file, so we copy the file
|
||||
// to the temp dir, so that .aux files etc. are not created
|
||||
// in the original dir. Files included by this file will be
|
||||
// found via either the environment variable TEXINPUTS, or
|
||||
// input@path, see ../Buffer.cpp.
|
||||
unsigned long const checksum_in = included_file.checksum();
|
||||
unsigned long const checksum_out = writefile.checksum();
|
||||
|
||||
if (checksum_in != checksum_out) {
|
||||
if (!included_file.copyTo(writefile)) {
|
||||
// FIXME UNICODE
|
||||
LYXERR(Debug::LATEX,
|
||||
to_utf8(bformat(_("Could not copy the file\n%1$s\n"
|
||||
"into the temporary directory."),
|
||||
from_utf8(included_file.absFileName()))));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user