#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 {
using support::makeRelPath;
using support::onlyFilename;
using support::onlyPath;
+using support::package;
using support::prefixIs;
using support::quoteName;
using support::removeExtension;
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;
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) {