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
This commit is contained in:
Jean-Marc Lasgouttes 2000-05-31 16:48:20 +00:00
parent 2ac113b991
commit f16cee2cff
2 changed files with 21 additions and 5 deletions

View File

@ -1,5 +1,10 @@
2000-05-31 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* 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.

View File

@ -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