]> git.lyx.org Git - features.git/commitdiff
Fix problem with Latex and noweb import (the buffer was created twice)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 31 May 2000 16:48:20 +0000 (16:48 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 31 May 2000 16:48:20 +0000 (16:48 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@784 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/lyxfunc.C

index c65b38cfe4af581d2d92fb8b49f937a0c25278df..c338e3b9610c986f3d4eb9053418dff565c12f0d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index e5c5fa8a6fcf6a119ea8dc0d4a0d5d81034fbe46..ed4d0e16bb09567fe3c0616b0b589ec22df39fd8 100644 (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