mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-10 18:58:10 +00:00
* Buffer::doExport(): return early.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22550 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
59c8ede0a3
commit
c15b2f6e1a
@ -2467,40 +2467,40 @@ bool Buffer::doExport(string const & format, bool put_in_tempdir,
|
|||||||
if (!success)
|
if (!success)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (put_in_tempdir)
|
if (put_in_tempdir) {
|
||||||
result_file = tmp_result_file.absFilename();
|
result_file = tmp_result_file.absFilename();
|
||||||
else {
|
return true;
|
||||||
result_file = changeExtension(absFileName(), ext);
|
}
|
||||||
// We need to copy referenced files (e. g. included graphics
|
|
||||||
// if format == "dvi") to the result dir.
|
result_file = changeExtension(absFileName(), ext);
|
||||||
vector<ExportedFile> const files =
|
// We need to copy referenced files (e. g. included graphics
|
||||||
runparams.exportdata->externalFiles(format);
|
// if format == "dvi") to the result dir.
|
||||||
string const dest = onlyPath(result_file);
|
vector<ExportedFile> const files =
|
||||||
CopyStatus status = SUCCESS;
|
runparams.exportdata->externalFiles(format);
|
||||||
for (vector<ExportedFile>::const_iterator it = files.begin();
|
string const dest = onlyPath(result_file);
|
||||||
it != files.end() && status != CANCEL; ++it) {
|
CopyStatus status = SUCCESS;
|
||||||
string const fmt =
|
for (vector<ExportedFile>::const_iterator it = files.begin();
|
||||||
formats.getFormatFromFile(it->sourceName);
|
it != files.end() && status != CANCEL; ++it) {
|
||||||
status = copyFile(fmt, it->sourceName,
|
string const fmt = formats.getFormatFromFile(it->sourceName);
|
||||||
makeAbsPath(it->exportName, dest),
|
status = copyFile(fmt, it->sourceName,
|
||||||
it->exportName, status == FORCE);
|
makeAbsPath(it->exportName, dest),
|
||||||
}
|
it->exportName, status == FORCE);
|
||||||
if (status == CANCEL) {
|
}
|
||||||
message(_("Document export cancelled."));
|
if (status == CANCEL) {
|
||||||
} else if (tmp_result_file.exists()) {
|
message(_("Document export cancelled."));
|
||||||
// Finally copy the main file
|
} else if (tmp_result_file.exists()) {
|
||||||
status = copyFile(format, tmp_result_file,
|
// Finally copy the main file
|
||||||
FileName(result_file), result_file,
|
status = copyFile(format, tmp_result_file,
|
||||||
status == FORCE);
|
FileName(result_file), result_file,
|
||||||
message(bformat(_("Document exported as %1$s "
|
status == FORCE);
|
||||||
"to file `%2$s'"),
|
message(bformat(_("Document exported as %1$s "
|
||||||
formats.prettyName(format),
|
"to file `%2$s'"),
|
||||||
makeDisplayPath(result_file)));
|
formats.prettyName(format),
|
||||||
} else {
|
makeDisplayPath(result_file)));
|
||||||
// This must be a dummy converter like fax (bug 1888)
|
} else {
|
||||||
message(bformat(_("Document exported as %1$s"),
|
// This must be a dummy converter like fax (bug 1888)
|
||||||
formats.prettyName(format)));
|
message(bformat(_("Document exported as %1$s"),
|
||||||
}
|
formats.prettyName(format)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user