Do not create a new file after 'new from template..' and cancel.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28029 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-01-08 00:29:06 +00:00
parent c53082b6c3
commit 658cee5ad4

View File

@ -1613,8 +1613,13 @@ void GuiView::newDocument(string const & filename, bool from_template)
initpath = trypath; initpath = trypath;
} }
string templatefile = from_template ? string templatefile;
selectTemplateFile().absFilename() : string(); if (from_template) {
templatefile = selectTemplateFile().absFilename();
if (templatefile.empty())
return;
}
Buffer * b; Buffer * b;
if (filename.empty()) if (filename.empty())
b = newUnnamedFile(templatefile, initpath); b = newUnnamedFile(templatefile, initpath);