]> git.lyx.org Git - lyx.git/commitdiff
Do not create a new file after 'new from template..' and cancel.
authorVincent van Ravesteijn <vfr@lyx.org>
Thu, 8 Jan 2009 00:29:06 +0000 (00:29 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Thu, 8 Jan 2009 00:29:06 +0000 (00:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28029 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index 3a3f88bcf8b9affedcd23bd6726ba995ec6ee485..e507ca3c312f827d70749536d3715e1f808a92dc 100644 (file)
@@ -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);