- switch (cmd.action) {
-
- case LFUN_INSET_MODIFY:
- InsetNoteMailer::string2params(to_utf8(cmd.argument()), params_);
- // get a bp from cur:
- setLayout(cur.buffer().params());
+ switch (cmd.action()) {
+
+ case LFUN_INSET_MODIFY: {
+ // Do not do anything if converting to the same type of Note.
+ // A quick break here is done instead of disabling the LFUN
+ // because disabling the LFUN would lead to a greyed out
+ // entry, which might confuse users.
+ // In the future, we might want to have a radio button for
+ // switching between notes.
+ InsetNoteParams params;
+ string2params(to_utf8(cmd.argument()), params);
+ if (params_.type == params.type)
+ break;
+
+ cur.recordUndoInset(this);
+ string2params(to_utf8(cmd.argument()), params_);
+ setButtonLabel();
+ // what we really want here is a TOC update, but that means
+ // a full buffer update
+ cur.forceBufferUpdate();