]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetInclude.cpp
InsetTabular.cpp: fix #6585 also for wrapped floats - thanks Vincent
[lyx.git] / src / insets / InsetInclude.cpp
index a2164475c3308e4745543bc9e2b04917374edd11..fd92af13baf4090619060c125e5021091254b781 100644 (file)
@@ -160,7 +160,7 @@ InsetLabel * createLabel(Buffer * buf, docstring const & label_str)
 
 
 InsetInclude::InsetInclude(Buffer * buf, InsetCommandParams const & p)
-       : InsetCommand(buf, p, "include"), include_label(uniqueID()),
+       : InsetCommand(buf, p), include_label(uniqueID()),
          preview_(new RenderMonitoredPreview(this)), failedtoload_(false),
          set_label_(false), label_(0), child_buffer_(0)
 {
@@ -245,7 +245,7 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
                        InsetCommand::doDispatch(cur, cmd);
                        p = params();
                } else
-                       InsetCommand::string2params("include", to_utf8(cmd.argument()), p);
+                       InsetCommand::string2params(to_utf8(cmd.argument()), p);
                if (!p.getCmdName().empty()) {
                        if (isListings(p)){
                                InsetListingsParams new_params(to_utf8(p["lstparams"]));
@@ -440,7 +440,7 @@ Buffer * InsetInclude::loadIfNeeded() const
                        // Buffer creation is not possible.
                        return 0;
 
-               if (!child->loadLyXFile(included_file)) {
+               if (child->loadLyXFile(included_file) != Buffer::ReadSuccess) {
                        failedtoload_ = true;
                        //close the buffer we just opened
                        theBufferList().release(child);
@@ -510,9 +510,16 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const
                incfile = mangled;
        else if (!isValidLaTeXFileName(incfile)) {
                frontend::Alert::warning(_("Invalid filename"),
-                                        _("The following filename is likely to cause trouble "
-                                          "when running the exported file through LaTeX: ") +
-                                           from_utf8(incfile));
+                       _("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);