From: Jean-Marc Lasgouttes Date: Wed, 31 May 2000 16:48:20 +0000 (+0000) Subject: Fix problem with Latex and noweb import (the buffer was created twice) X-Git-Tag: 1.6.10~22200 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f16cee2cffbc6f71ffcf0764c42c323013581a2d;p=features.git Fix problem with Latex and noweb import (the buffer was created twice) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@784 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index c65b38cfe4..c338e3b961 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2000-05-31 Jean-Marc Lasgouttes + * src/lyxfunc.C (doImportHelper): do not create the file before + doing the actual import. + (doImportASCIIasLines): create a new file before doing the insert. + (doImportASCIIasParagraphs): ditto. + * lib/lyxrc.example: remove mention of non-existing commands * lyx.man: remove mention of color-related switches. diff --git a/src/lyxfunc.C b/src/lyxfunc.C index e5c5fa8a6f..ed4d0e16bb 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -2926,7 +2926,6 @@ void LyXFunc::doImportHelper( // notify user of import ahead string displaypath = MakeDisplayPath(filename); - owner->view()->buffer(bufferlist.newFile(lyxfile, string())); owner->getMiniBuffer()->Set(_("Importing"), displaypath, "..."); // call real importer @@ -2942,6 +2941,7 @@ void LyXFunc::doImportHelper( static bool doImportASCIIasLines(BufferView * view, string const & filename) { + view->buffer(bufferlist.newFile(filename, string())); InsertAsciiFile(view, filename, false); return true; } @@ -2949,24 +2949,35 @@ bool doImportASCIIasLines(BufferView * view, string const & filename) static bool doImportASCIIasParagraphs(BufferView * view, string const & filename) { + view->buffer(bufferlist.newFile(filename, string())); InsertAsciiFile(view, filename, true); return true; } static -bool doImportLaTeX(BufferView *, string const & filename) +bool doImportLaTeX(BufferView * view, string const & filename) { ImportLaTeX myImport(filename); Buffer * openbuf = myImport.run(); - return openbuf != NULL; + if (openbuf) { + view->buffer(openbuf); + return true; + } + else + return false; } static -bool doImportNoweb(BufferView *, string const & filename) +bool doImportNoweb(BufferView * view, string const & filename) { ImportNoweb myImport(filename); Buffer * openbuf = myImport.run(); - return openbuf != NULL; + if (openbuf) { + view->buffer(openbuf); + return true; + } + else + return false; } static