]> git.lyx.org Git - features.git/commitdiff
* src/Converter.cpp:
authorJürgen Spitzmüller <spitz@lyx.org>
Thu, 12 Jul 2007 16:30:07 +0000 (16:30 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Thu, 12 Jul 2007 16:30:07 +0000 (16:30 +0000)
- check if buffer exists before querying for buffer->temppath()
   (and use package().tempdir() as a fallback) [fixes bug 4011]

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19062 a592a061-630c-0410-9148-cb99ea01b6c8

src/Converter.cpp

index 3c8842be121bfbaa88f51b39c0a8d8c6c36c0b41..e704cf12d41a1a1003b1b34883b1fd03dfdfaacf 100644 (file)
@@ -29,6 +29,7 @@
 #include "support/filetools.h"
 #include "support/lyxlib.h"
 #include "support/os.h"
+#include "support/Package.h"
 #include "support/Path.h"
 #include "support/Systemcall.h"
 
@@ -50,6 +51,7 @@ using support::makeAbsPath;
 using support::makeRelPath;
 using support::onlyFilename;
 using support::onlyPath;
+using support::package;
 using support::prefixIs;
 using support::quoteName;
 using support::removeExtension;
@@ -379,7 +381,12 @@ bool Converters::convert(Buffer const * buffer,
                FileName real_outfile;
                if (outfile == infile) {
                        real_outfile = infile;
-                       outfile = FileName(addName(buffer->temppath(), "tmpfile.out"));
+                       // when importing, a buffer does not necessarily exist
+                       if (buffer)
+                               outfile = FileName(addName(buffer->temppath(), "tmpfile.out"));
+                       else
+                               outfile = FileName(addName(package().temp_dir().absFilename(),
+                                                  "tmpfile.out"));
                }
 
                if (conv.latex) {