]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNote.cpp
Added inset-select-all to emacs bindings
[lyx.git] / src / insets / InsetNote.cpp
index 751170897ab5f60d707e06040d8d07d1ea8ebc1c..37055027862167ce14776f1b327c751b17d2dcce 100644 (file)
@@ -149,7 +149,18 @@ void InsetNote::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action()) {
 
-       case LFUN_INSET_MODIFY:
+       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(ATOMIC_UNDO, this);
                string2params(to_utf8(cmd.argument()), params_);
                setButtonLabel();
@@ -157,6 +168,7 @@ void InsetNote::doDispatch(Cursor & cur, FuncRequest & cmd)
                // a full buffer update
                cur.forceBufferUpdate();
                break;
+       }
 
        case LFUN_INSET_DIALOG_UPDATE:
                cur.bv().updateDialog("note", params2string(params()));
@@ -203,7 +215,7 @@ void InsetNote::addToToc(DocIterator const & cpit, bool output_active) const
        Toc & toc = buffer().tocBackend().toc("note");
        InsetLayout const & il = getLayout();
        docstring str = translateIfPossible(il.labelstring()) + from_ascii(": ");
-       text().forToc(str, TOC_ENTRY_LENGTH);
+       text().forOutliner(str, TOC_ENTRY_LENGTH);
        toc.push_back(TocItem(pit, 0, str, output_active, toolTipText(docstring(), 3, 60)));
 
        // Proceed with the rest of the inset.