mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-12 22:14:35 +00:00
fix #194
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3772 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
55bb299483
commit
dcebc194f4
@ -1,3 +1,16 @@
|
|||||||
|
2002-03-19 Allan Rae <rae@lyx.org>
|
||||||
|
|
||||||
|
* exporter.C (Export): removeAutoInsets before doing anything else.
|
||||||
|
While I've just introduced a dependency on BufferView this really is
|
||||||
|
the best place to clean the buffer otherwise you need to cleanup in
|
||||||
|
a dozen places before calling export or cleanup in a dozen functions
|
||||||
|
that export calls.
|
||||||
|
|
||||||
|
* converter.C (runLaTeX):
|
||||||
|
(scanLog): Better handling of removeAutoInsets and screen updates.
|
||||||
|
|
||||||
|
* lyxfunc.C (dispatch): small whitespace changes
|
||||||
|
|
||||||
2002-03-18 Lars Gullik Bjřnnes <larsbj@birdstep.com>
|
2002-03-18 Lars Gullik Bjřnnes <larsbj@birdstep.com>
|
||||||
|
|
||||||
* WorkArea.C (C_WorkAreaEvent): return a value.
|
* WorkArea.C (C_WorkAreaEvent): return a value.
|
||||||
|
@ -783,11 +783,9 @@ bool Converters::scanLog(Buffer const * buffer, string const & command,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
BufferView * bv = buffer->getUser();
|
BufferView * bv = buffer->getUser();
|
||||||
bool need_redraw = false;
|
|
||||||
if (bv) {
|
if (bv) {
|
||||||
bv->owner()->prohibitInput();
|
bv->owner()->prohibitInput();
|
||||||
// Remove all error insets
|
// all error insets should have been removed by now
|
||||||
need_redraw = bv->removeAutoInsets();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LaTeX latex("", filename, "");
|
LaTeX latex("", filename, "");
|
||||||
@ -797,9 +795,6 @@ bool Converters::scanLog(Buffer const * buffer, string const & command,
|
|||||||
if ((result & LaTeX::ERRORS)) {
|
if ((result & LaTeX::ERRORS)) {
|
||||||
// Insert all errors as errors boxes
|
// Insert all errors as errors boxes
|
||||||
bv->insertErrors(terr);
|
bv->insertErrors(terr);
|
||||||
need_redraw = true;
|
|
||||||
}
|
|
||||||
if (need_redraw) {
|
|
||||||
bv->redraw();
|
bv->redraw();
|
||||||
bv->fitCursor();
|
bv->fitCursor();
|
||||||
}
|
}
|
||||||
@ -839,34 +834,24 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
BufferView * bv = buffer->getUser();
|
BufferView * bv = buffer->getUser();
|
||||||
string name = buffer->getLatexName();
|
|
||||||
bool need_redraw = false;
|
|
||||||
|
|
||||||
if (bv) {
|
if (bv) {
|
||||||
bv->owner()->prohibitInput();
|
bv->owner()->prohibitInput();
|
||||||
bv->owner()->message(_("Running LaTeX..."));
|
bv->owner()->message(_("Running LaTeX..."));
|
||||||
// Remove all error insets
|
// all the autoinsets have already been removed
|
||||||
need_redraw = bv->removeAutoInsets();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// do the LaTeX run(s)
|
||||||
// do the LaTex run(s)
|
string name = buffer->getLatexName();
|
||||||
|
LaTeX latex(command, name, buffer->filePath());
|
||||||
TeXErrors terr;
|
TeXErrors terr;
|
||||||
LaTeX latex(command, name, buffer->filePath());
|
|
||||||
int result = latex.run(terr,
|
int result = latex.run(terr,
|
||||||
bv ? bv->owner()->getLyXFunc() : 0);
|
bv ? bv->owner()->getLyXFunc() : 0);
|
||||||
|
|
||||||
|
|
||||||
if (bv) {
|
if (bv) {
|
||||||
if ((result & LaTeX::ERRORS)) {
|
if ((result & LaTeX::ERRORS)) {
|
||||||
// Insert all errors as errors boxes
|
// Insert all errors as errors boxes
|
||||||
bv->insertErrors(terr);
|
bv->insertErrors(terr);
|
||||||
need_redraw = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if we removed error insets before we ran LaTeX or if we inserted
|
|
||||||
// error insets after we ran LaTeX this must be run:
|
|
||||||
if (need_redraw) {
|
|
||||||
bv->redraw();
|
bv->redraw();
|
||||||
bv->fitCursor();
|
bv->fitCursor();
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "converter.h"
|
#include "converter.h"
|
||||||
#include "frontends/Alert.h"
|
#include "frontends/Alert.h"
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
|
#include "BufferView.h"
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using std::find;
|
using std::find;
|
||||||
@ -31,6 +32,18 @@ using std::find;
|
|||||||
bool Exporter::Export(Buffer * buffer, string const & format,
|
bool Exporter::Export(Buffer * buffer, string const & format,
|
||||||
bool put_in_tempdir, string & result_file)
|
bool put_in_tempdir, string & result_file)
|
||||||
{
|
{
|
||||||
|
// There are so many different places that this function can be called
|
||||||
|
// from that the removal of auto insets is best done here. This ensures
|
||||||
|
// we always have a clean buffer for inserting errors found during export.
|
||||||
|
BufferView * bv = buffer->getUser();
|
||||||
|
if (bv) {
|
||||||
|
// Remove all error insets
|
||||||
|
if (bv->removeAutoInsets()) {
|
||||||
|
bv->redraw();
|
||||||
|
bv->fitCursor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
string backend_format;
|
string backend_format;
|
||||||
vector<string> backends = Backends(buffer);
|
vector<string> backends = Backends(buffer);
|
||||||
if (find(backends.begin(), backends.end(), format) == backends.end()) {
|
if (find(backends.begin(), backends.end(), format) == backends.end()) {
|
||||||
|
@ -1098,15 +1098,15 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
|||||||
case LFUN_UPDATE:
|
case LFUN_UPDATE:
|
||||||
Exporter::Export(owner->buffer(), argument, true);
|
Exporter::Export(owner->buffer(), argument, true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_PREVIEW:
|
case LFUN_PREVIEW:
|
||||||
Exporter::Preview(owner->buffer(), argument);
|
Exporter::Preview(owner->buffer(), argument);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_BUILDPROG:
|
case LFUN_BUILDPROG:
|
||||||
Exporter::Export(owner->buffer(), "program", true);
|
Exporter::Export(owner->buffer(), "program", true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_RUNCHKTEX:
|
case LFUN_RUNCHKTEX:
|
||||||
MenuRunChktex(owner->buffer());
|
MenuRunChktex(owner->buffer());
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user