]> git.lyx.org Git - lyx.git/blobdiff - src/Text3.cpp
typo
[lyx.git] / src / Text3.cpp
index 75ad2c0733c0117d10acef817711773d9580cb77..08049f005382689ec374c9291df51a022b5a7560 100644 (file)
@@ -1548,22 +1548,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                break;
        }
 
-       case LFUN_LINE_INSERT: {
-               InsetCommandParams p(LINE_CODE);
-               p["offset"] = from_ascii(".5ex");
-               p["width"] = from_ascii("100col%");
-               p["height"] = from_ascii("1pt");
-               string const data = InsetCommand::params2string("line", p);
-
-               if (cmd.argument().empty()) {
-                       bv->showDialog("line", data);
-               } else {
-                       FuncRequest fr(LFUN_INSET_INSERT, data);
-                       dispatch(cur, fr);
-               }
-               break;
-       }
-
        case LFUN_INFO_INSERT: {
                Inset * inset;
                if (cmd.argument().empty() && cur.selection()) {
@@ -1687,7 +1671,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
        }
        
        case LFUN_NOMENCL_PRINT:
-       case LFUN_TOC_INSERT:
        case LFUN_NEWPAGE_INSERT:
                // do nothing fancy
                doInsertInset(cur, this, cmd, false, false);
@@ -2377,9 +2360,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_LABEL_INSERT:
                code = LABEL_CODE;
                break;
-       case LFUN_LINE_INSERT:
-               code = LINE_CODE;
-               break;
        case LFUN_INFO_INSERT:
                code = INFO_CODE;
                break;
@@ -2410,11 +2390,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
                // not allowed in description items
                enable = !inDescriptionItem(cur);
                break;
-       case LFUN_TOC_INSERT:
-               code = TOC_CODE;
-               // not allowed in description items
-               enable = !inDescriptionItem(cur);
-               break;
        case LFUN_HYPERLINK_INSERT:
                if (cur.selIsMultiCell() || cur.selIsMultiLine()) {
                        enable = false;
@@ -2716,7 +2691,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_LINE_END:
        case LFUN_CHAR_DELETE_FORWARD:
        case LFUN_CHAR_DELETE_BACKWARD:
-       case LFUN_INSET_INSERT:
        case LFUN_WORD_UPCASE:
        case LFUN_WORD_LOWCASE:
        case LFUN_WORD_CAPITALIZE:
@@ -2732,6 +2706,19 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
                enable = true;
                break;
 
+       case LFUN_INSET_INSERT: {
+               string const type = cmd.getArg(0);
+               if (type == "toc") {
+                       code = TOC_CODE;
+                       // not allowed in description items
+                       //FIXME: couldn't this be merged in Inset::insetAllowed()?
+                       enable = !inDescriptionItem(cur);
+               } else {
+                       enable = true;
+               }
+               break;
+       }
+
        default:
                return false;
        }