using support::bformat;
using support::FileName;
using support::libFileSearch;
+using support::makeAbsPath;
using support::makeDisplayPath;
using support::onlyFilename;
using support::onlyPath;
case 0:
// the file is not saved if we load the emergency file.
b->markDirty();
- return b->readFile(e.absFilename());
+ return b->readFile(e);
case 1:
break;
default:
case 0:
// the file is not saved if we load the autosave file.
b->markDirty();
- return b->readFile(a.absFilename());
+ return b->readFile(a);
case 1:
// Here we delete the autosave
unlink(a);
return false;
}
}
- return b->readFile(s.absFilename());
+ return b->readFile(s);
}
Buffer * b = theBufferList().newBuffer(filename);
BOOST_ASSERT(b);
- string tname;
+ FileName tname;
// use defaults.lyx as a default template if it exists.
if (templatename.empty())
- tname = libFileSearch("templates", "defaults.lyx").absFilename();
+ tname = libFileSearch("templates", "defaults.lyx");
else
- tname = templatename;
+ tname = makeAbsPath(templatename);
if (!tname.empty()) {
if (!b->readFile(tname)) {
- docstring const file = makeDisplayPath(tname, 50);
+ docstring const file = makeDisplayPath(tname.absFilename(), 50);
docstring const text = bformat(
_("The specified document template\n%1$s\ncould not be read."),
file);