X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fbuffer_funcs.C;h=8ed3e855a58923d276a9e7257736b3144b92e10c;hb=2b378ca3fdbd701b0d5e350e1c6b22155c07a2dc;hp=29f3cd49595f84f4403394ff10f5a828bacfab01;hpb=ed99f752f9b4ce52cf55cac2a94658fb087c7383;p=lyx.git diff --git a/src/buffer_funcs.C b/src/buffer_funcs.C index 29f3cd4959..8ed3e855a5 100644 --- a/src/buffer_funcs.C +++ b/src/buffer_funcs.C @@ -55,6 +55,7 @@ using namespace std; using support::bformat; using support::FileName; using support::libFileSearch; +using support::makeAbsPath; using support::makeDisplayPath; using support::onlyFilename; using support::onlyPath; @@ -100,7 +101,7 @@ bool readFile(Buffer * const b, FileName const & s) 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: @@ -127,7 +128,7 @@ bool readFile(Buffer * const b, FileName const & s) 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); @@ -136,7 +137,7 @@ bool readFile(Buffer * const b, FileName const & s) return false; } } - return b->readFile(s.absFilename()); + return b->readFile(s); } @@ -185,16 +186,16 @@ Buffer * newFile(string const & filename, string const & templatename, 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);