make error messages about unhandled X11 events GUI debug messages; use temp file when converting from a file to a file with same name

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5751 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2002-11-29 15:51:17 +00:00
parent 61fa03aeae
commit 866c57213a
4 changed files with 33 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2002-11-18 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* converter.C (convert): if from and to files are the same, use a
temporary files as intermediary
2002-11-22 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* commandtags.h:

View File

@ -623,6 +623,14 @@ bool Converters::convert(Buffer const * buffer,
subst(conv.result_file,
token_base, OnlyFilename(from_base)));
// if input and output files are equal, we use a
// temporary file as intermediary (JMarc)
string real_outfile;
if (outfile == infile) {
real_outfile = infile;
outfile = AddName(buffer->tmppath, "tmpfile.out");
}
if (conv.latex) {
run_latex = true;
string command = subst(conv.command, token_from, "");
@ -673,6 +681,16 @@ bool Converters::convert(Buffer const * buffer,
} else
res = one.startscript(type, command);
if (!real_outfile.empty()) {
if (!lyx::rename(outfile, real_outfile))
res = -1;
else
lyxerr[Debug::FILES]
<< "renaming file " << outfile
<< " to " << real_outfile
<< endl;
}
if (!conv.parselog.empty()) {
string const logfile = infile2 + ".log";
string const script = LibScriptSearch(conv.parselog);

View File

@ -1,3 +1,8 @@
2002-11-29 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lyx_gui.C (start): make "unhandled X11 event" debug message
optional (on GUI)
2002-11-29 Angus Leeming <leeming@lyx.org>
* Tooltips.C (init): allow tooltips to be reset.

View File

@ -312,10 +312,11 @@ void lyx_gui::start(string const & batch, vector<string> const & files)
if (fl_check_forms() == FL_EVENT) {
XEvent ev;
fl_XNextEvent(&ev);
lyxerr << "Received unhandled X11 event" << endl;
lyxerr << "Type: " << ev.xany.type
<< " Target: 0x" << hex << ev.xany.window
<< dec << endl;
lyxerr[Debug::GUI]
<< "Received unhandled X11 event" << endl
<< "Type: " << ev.xany.type
<< " Target: 0x" << hex << ev.xany.window
<< dec << endl;
}
}