]> git.lyx.org Git - features.git/commitdiff
Disallow any inset inside ERT
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 10 Jul 2018 05:11:59 +0000 (07:11 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 10 Jul 2018 05:11:59 +0000 (07:11 +0200)
Attempting to do this crashes in master, and is not supported anyway.

src/insets/InsetERT.cpp
src/insets/InsetERT.h

index 25665471038b733c7c063e838b72a380136902f4..388abe45ae0ed648f97c25a957cc5e7e0f65524f 100644 (file)
@@ -188,6 +188,9 @@ bool InsetERT::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_INSET_END_EDIT:
                status.setEnabled(tempfile_ != 0);
                return true;
+       case LFUN_INSET_INSERT:
+               status.setEnabled(false);
+               return true;
        case LFUN_INSET_MODIFY:
                if (cmd.getArg(0) == "ert") {
                        status.setEnabled(true);
index bfe15126dab662a39683748392f52a8176f3805e..ba62977d09301ab0889ae4c60eda9533435cf856 100644 (file)
@@ -80,6 +80,8 @@ private:
        ///
        bool allowSpellCheck() const { return false; }
        ///
+       bool insetAllowed(InsetCode /* code */) const { return false; }
+       ///
        unique_ptr<support::TempFile> tempfile_;
 };