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)
{
InsetInclude::~InsetInclude()
{
if (isBufferLoaded())
- buffer_->invalidateBibfileCache();
+ buffer().invalidateBibfileCache();
delete label_;
}
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"]));
// 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);
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);