]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetGraphics.cpp
InsetTabular.cpp: fix #6585 also for wrapped floats - thanks Vincent
[lyx.git] / src / insets / InsetGraphics.cpp
index b31cbc23363a2bf3c97b3a2b6b1483fd5bc8a092..31b6c181f314ed416e92c72d3c671d406f898444 100644 (file)
@@ -393,7 +393,7 @@ docstring InsetGraphics::toDocbookLength(Length const & len) const
                case Length::PPW: // Percent of PageWidth
                case Length::PLW: // Percent of LineWidth
                case Length::PTH: // Percent of TextHeight
-               case Length::PPH: // Percent of Paper
+               case Length::PPH: // Percent of PaperHeight
                        // Sigh, this will go wrong.
                        result << len.value() << "%";
                        break;
@@ -589,14 +589,26 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
                params().filename.outputFileName(masterBuffer->filePath()) :
                onlyFileName(temp_file.absFileName());
 
-       if (runparams.nice && !isValidLaTeXFileName(output_file)) {
-               frontend::Alert::warning(_("Invalid filename"),
-                                        _("The following filename is likely to cause trouble "
-                                          "when running the exported file through LaTeX: ") +
-                                           from_utf8(output_file));
+       if (runparams.nice) {
+               if (!isValidLaTeXFileName(output_file)) {
+                       frontend::Alert::warning(_("Invalid filename"),
+                               _("The following filename will cause troubles "
+                                 "when running the exported file through LaTeX: ") +
+                               from_utf8(output_file));
+               }
+               // only show DVI-specific warning when export format is plain latex
+               if (!isValidDVIFileName(output_file)
+                       && runparams.flavor == OutputParams::LATEX) {
+                               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(output_file), true);
+               }
        }
 
        FileName source_file = runparams.nice ? FileName(params().filename) : temp_file;
+       // determine the export format
        string const tex_format = (runparams.flavor == OutputParams::LATEX) ?
                        "latex" : "pdflatex";