From 658cee5ad420bc08119ca54633e2f2c6fe2dd1db Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 8 Jan 2009 00:29:06 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/GuiView.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 3a3f88bcf8..e507ca3c31 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1613,8 +1613,13 @@ void GuiView::newDocument(string const & filename, bool from_template) initpath = trypath; } - string templatefile = from_template ? - selectTemplateFile().absFilename() : string(); + string templatefile; + if (from_template) { + templatefile = selectTemplateFile().absFilename(); + if (templatefile.empty()) + return; + } + Buffer * b; if (filename.empty()) b = newUnnamedFile(templatefile, initpath);