]> git.lyx.org Git - lyx.git/blobdiff - src/Converter.cpp
Streamlining CollapseStatus stuff
[lyx.git] / src / Converter.cpp
index 3c8842be121bfbaa88f51b39c0a8d8c6c36c0b41..f2a463868e381d2badae7bd5aa23ee1304a32261 100644 (file)
 #include "support/filetools.h"
 #include "support/lyxlib.h"
 #include "support/os.h"
+#include "support/Package.h"
 #include "support/Path.h"
 #include "support/Systemcall.h"
 
+using std::endl;
+using std::find_if;
+using std::string;
+using std::vector;
+using std::distance;
+
 
 namespace lyx {
 
@@ -50,6 +57,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;
@@ -57,12 +65,6 @@ using support::split;
 using support::subst;
 using support::Systemcall;
 
-using std::endl;
-using std::find_if;
-using std::string;
-using std::vector;
-using std::distance;
-
 namespace Alert = lyx::frontend::Alert;
 
 
@@ -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) {