diff --git a/src/ChangeLog b/src/ChangeLog index a87d768169..e1a9379bdc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-11-18 Jean-Marc Lasgouttes + + * converter.C (convert): if from and to files are the same, use a + temporary files as intermediary + 2002-11-22 Jean-Marc Lasgouttes * commandtags.h: diff --git a/src/converter.C b/src/converter.C index 17e07d7d8a..c37a002885 100644 --- a/src/converter.C +++ b/src/converter.C @@ -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); diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index bfab9e118e..76576ab36a 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2002-11-29 Jean-Marc Lasgouttes + + * lyx_gui.C (start): make "unhandled X11 event" debug message + optional (on GUI) + 2002-11-29 Angus Leeming * Tooltips.C (init): allow tooltips to be reset. diff --git a/src/frontends/xforms/lyx_gui.C b/src/frontends/xforms/lyx_gui.C index 944e78dba3..b668a283b5 100644 --- a/src/frontends/xforms/lyx_gui.C +++ b/src/frontends/xforms/lyx_gui.C @@ -312,10 +312,11 @@ void lyx_gui::start(string const & batch, vector 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; } }