switch (cmd.action) {
case LFUN_UNKNOWN_ACTION:
-#ifndef HAVE_LIBAIKSAURUS
+#if !defined(HAVE_LIBMYTHES) && !defined(HAVE_LIBAIKSAURUS)
case LFUN_THESAURUS_ENTRY:
#endif
flag.unknown(true);
theApp()->dispatch(FuncRequest(LFUN_WINDOW_NEW));
string const arg = argument;
if (arg.empty()) {
- setErrorMessage(from_ascii(N_("Missing argument")));
+ setErrorMessage(from_utf8(N_("Missing argument")));
break;
}
FileName const fname = i18nLibFileSearch("doc", arg, "lyx");
makeDisplayPath(fname.absFilename())));
Buffer * buf = lyx_view_->loadDocument(fname, false);
if (buf) {
- updateLabels(*buf);
+ buf->updateLabels();
lyx_view_->setBuffer(buf);
buf->errors("Parse");
}
break;
}
- updateLabels(*buf);
+ buf->updateLabels();
lyx_view_->setBuffer(buf);
view()->setCursorFromRow(row);
if (loaded)
// This makes insertion of citations and references in the child work,
// when the target is in the parent or another child document.
child->setParent(buffer);
- updateLabels(*child->masterBuffer());
+ child->masterBuffer()->updateLabels();
lyx_view_->setBuffer(child);
if (parsed)
child->errors("Parse");
case LFUN_COMMAND_SEQUENCE: {
// argument contains ';'-terminated commands
string arg = argument;
+ if (theBufferList().isLoaded(buffer))
+ buffer->undo().beginUndoGroup();
while (!arg.empty()) {
string first;
arg = split(arg, first, ';');
func.origin = cmd.origin;
dispatch(func);
}
+ if (theBufferList().isLoaded(buffer))
+ buffer->undo().endUndoGroup();
break;
}
// The user has already confirmed that the changes, if any, should
// be discarded. So we just release the Buffer and don't call closeBuffer();
theBufferList().release(lyx_view_->buffer());
+ // if the lyx_view_ has been destroyed, create a new one
+ if (!lyx_view_)
+ theApp()->dispatch(FuncRequest(LFUN_WINDOW_NEW));
Buffer * buf = lyx_view_->loadDocument(filename);
docstring const disp_fn = makeDisplayPath(filename.absFilename());
docstring str;
if (buf) {
- updateLabels(*buf);
+ buf->updateLabels();
lyx_view_->setBuffer(buf);
buf->errors("Parse");
str = bformat(_("Document %1$s reloaded."), disp_fn);
}
-void LyXFunc::updateLayout(DocumentClass const * const oldlayout, Buffer * buffer)
+void LyXFunc::updateLayout(DocumentClass const * const oldlayout, Buffer * buf)
{
lyx_view_->message(_("Converting document to new document class..."));
StableDocIterator backcur(view()->cursor());
- ErrorList & el = buffer->errorList("Class Switch");
+ ErrorList & el = buf->errorList("Class Switch");
cap::switchBetweenClasses(
- oldlayout, buffer->params().documentClassPtr(),
- static_cast<InsetText &>(buffer->inset()), el);
+ oldlayout, buf->params().documentClassPtr(),
+ static_cast<InsetText &>(buf->inset()), el);
- view()->setCursor(backcur.asDocIterator(&(buffer->inset())));
+ view()->setCursor(backcur.asDocIterator(buf));
- buffer->errors("Class Switch");
- updateLabels(*buffer);
+ buf->errors("Class Switch");
+ buf->updateLabels();
}
case LyXRC::RC_ACCEPT_COMPOUND:
case LyXRC::RC_ALT_LANG:
case LyXRC::RC_PLAINTEXT_LINELEN:
+ case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
case LyXRC::RC_AUTOREGIONDELETE:
case LyXRC::RC_AUTORESET_OPTIONS:
case LyXRC::RC_AUTOSAVE:
if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
}
+ case LyXRC::RC_THESAURUSDIRPATH:
case LyXRC::RC_UIFILE:
case LyXRC::RC_USER_EMAIL:
case LyXRC::RC_USER_NAME:
}
} // namespace anon
-
-
} // namespace lyx