]> git.lyx.org Git - features.git/commitdiff
Fix stupid mistake that led to bug #8574.
authorRichard Heck <rgheck@lyx.org>
Mon, 4 Mar 2013 23:07:48 +0000 (18:07 -0500)
committerRichard Heck <rgheck@lyx.org>
Mon, 4 Mar 2013 23:07:48 +0000 (18:07 -0500)
src/insets/InsetInclude.cpp

index 9a378b596640e3fadece10ab8eac626e9b651739..e4a54357c7f545a0269e973bf2d80a88b32ec149 100644 (file)
@@ -533,8 +533,28 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
                        mangledFileName();
        }
 
+       if (!runparams.nice)
+                       incfile = mangled;
+       else if (!isValidLaTeXFileName(incfile)) {
+               frontend::Alert::warning(_("Invalid filename"),
+                       _("The following filename will cause troubles "
+                               "when running the exported file through LaTeX: ") +
+                       from_utf8(incfile));
+       }
+       else if (!isValidDVIFileName(incfile)) {
+               frontend::Alert::warning(_("Problematic filename for DVI"),
+                       _("The following filename can cause troubles "
+                               "when running the exported file through LaTeX "
+                               "and opening the resulting DVI: ") +
+                       from_utf8(incfile), true);
+       }
+
        FileName const writefile(makeAbsPath(mangled, masterBuffer->temppath()));
 
+       LYXERR(Debug::LATEX, "incfile:" << incfile);
+       LYXERR(Debug::LATEX, "exportfile:" << exportfile);
+       LYXERR(Debug::LATEX, "writefile:" << writefile);
+
        string const tex_format = flavor2format(runparams.flavor);
 
        switch (type(params())) {
@@ -599,25 +619,6 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
                // in a comment or doing a dryrun
                return;
 
-       if (!runparams.nice)
-                       incfile = mangled;
-       else if (!isValidLaTeXFileName(incfile)) {
-               frontend::Alert::warning(_("Invalid filename"),
-                       _("The following filename will cause troubles "
-                               "when running the exported file through LaTeX: ") +
-                       from_utf8(incfile));
-       }
-       else if (!isValidDVIFileName(incfile)) {
-               frontend::Alert::warning(_("Problematic filename for DVI"),
-                       _("The following filename can cause troubles "
-                               "when running the exported file through LaTeX "
-                               "and opening the resulting DVI: ") +
-                       from_utf8(incfile), true);
-       }
-       LYXERR(Debug::LATEX, "incfile:" << incfile);
-       LYXERR(Debug::LATEX, "exportfile:" << exportfile);
-       LYXERR(Debug::LATEX, "writefile:" << writefile);
-
        if (isInputOrInclude(params()) &&
                 isLyXFileName(included_file.absFileName())) {
                // if it's a LyX file and we're inputting or including,