case LFUN_INSET_APPLY: {
string const name = ev.getArg(0);
- InsetBase * base = owner_->getDialogs().getOpenInset(name);
- if (base) {
+ InsetBase * inset = owner_->getDialogs().getOpenInset(name);
+ if (inset) {
// This works both for 'original' and 'mathed' insets.
// Note that the localDispatch performs updateInset
// also.
FuncRequest fr(bv_, LFUN_INSET_MODIFY, ev.argument);
- base->localDispatch(fr);
+ inset->localDispatch(fr);
} else {
- Inset * inset = createInset(ev);
- if (inset && insertInset(inset)) {
- updateInset(inset);
- } else {
- delete inset;
- }
+ FuncRequest fr(bv_, LFUN_INSET_INSERT, ev.argument);
+ dispatch(fr);
}
+ }
+ break;
- if (name == "bibitem") {
- // We need to do a redraw because the maximum
- // InsetBibitem width could have changed
+ case LFUN_INSET_INSERT: {
+ Inset * inset = createInset(ev);
+ if (inset && insertInset(inset)) {
+ updateInset(inset);
+
+ string const name = ev.getArg(0);
+ if (name == "bibitem") {
+ // We need to do a redraw because the maximum
+ // InsetBibitem width could have changed
#warning please check you mean repaint() not update(),
#warning and whether the repaint() is needed at all
- bv_->repaint();
- bv_->fitCursor();
+ bv_->repaint();
+ bv_->fitCursor();
+ }
+ } else {
+ delete inset;
}
}
break;
-
+
case LFUN_FLOAT_LIST:
if (tclass.floats().typeExist(ev.argument)) {
Inset * inset = new InsetFloatList(ev.argument);
+2003-03-25 Angus Leeming <leeming@lyx.org>
+
+ * lfuns.h:
+ * LyXAction.C (init): new LFUN_INSET_INSERT.
+
+ * BufferView_pimpl.C (dispatch): split out part of the
+ LFUN_INSET_APPLY block LFUN_INSET_INSERT.
+
+ * factory.C (createInset): act on LFUN_INSET_INSERT rather than
+ LFUN_INSET_APPLY.
+
2003-03-25 Angus Leeming <leeming@lyx.org>
* lyxfunc.C (dispatch): changes to the Dialogs interface.
{ LFUN_DIALOG_DISCONNECT_INSET, "dialog-disconnect-inset",
N_("Disconnect the dialog from the current inset"), Noop },
{ LFUN_INSET_APPLY, "inset-apply", "", Noop },
+ { LFUN_INSET_INSERT, "inset-insert", "", Noop },
{ LFUN_INSET_MODIFY, "", "internal only", Noop },
{ LFUN_INSET_DIALOG_UPDATE, "", "internal only", Noop },
{ LFUN_PARAGRAPH_APPLY, "paragraph-params-apply",
return new InsetTheorem;
#endif
- case LFUN_INSET_APPLY: {
+ case LFUN_INSET_INSERT: {
string const name = cmd.getArg(0);
if (name == "bibitem") {
+2003-03-25 Angus Leeming <leeming@lyx.org>
+
+ * insetbibitem.C (localDispatch): repaint the view after modifying
+ a bibitem inset in case the maximum InsetBibitem width has changed.
+
2003-03-25 John Levon <levon@movementarian.org>
* insettext.C:
setParams(p);
cmd.view()->updateInset(this);
+
+ // We need to do a redraw because the maximum
+ // InsetBibitem width could have changed
+#warning please check you mean repaint() not update(),
+#warning and whether the repaint() is needed at all
+ cmd.view()->repaint();
+ cmd.view()->fitCursor();
+
result = DISPATCHED;
}
break;
LFUN_DIALOG_DISCONNECT_INSET,
LFUN_INSET_APPLY,
// 260
+ LFUN_INSET_INSERT,
LFUN_INSET_MODIFY,
LFUN_INSET_DIALOG_UPDATE,
LFUN_PARAGRAPH_APPLY,
LFUN_PARAGRAPH_UPDATE,
-
+ // 265
LFUN_LASTACTION // end of the table
};