]> git.lyx.org Git - features.git/commitdiff
Revert "Fix environment-split when at pos 0 of a frame title."
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 30 Dec 2017 15:26:20 +0000 (16:26 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 30 Dec 2017 15:26:20 +0000 (16:26 +0100)
This reverts commit 1ff34a973d2748c407e4b7a6ea2284dac895b8ee.

src/LyXAction.cpp
src/Text3.cpp
src/insets/InsetText.cpp

index 58736abb8f0e849d905c64b53484cdb89f88c8e5..6acbdb47c24ef4e418ce4d2f79eab70bc2e084e9 100644 (file)
@@ -302,9 +302,8 @@ void LyXAction::init()
 /*!
  * \var lyx::FuncCode lyx::LFUN_ARGUMENT_INSERT
  * \li Action: Inserts an argument (short title) inset.
- * \li Syntax: argument-insert <argument nr> [force]
+ * \li Syntax: argument-insert <argument nr>
  * \li Params: <argument nr>: see layout declarations
- *             force: Insert argument even if already there.
  * \li Origin: vermeer, 12 Aug 2002
  * \endvar
  */
index 2f94de5f2ea434d5b2026ac55f156d8d4fa04eae..8d37e790b3ff6c8594675957e2e7757f255a1a9a 100644 (file)
@@ -1505,7 +1505,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                bool const outer = cmd.argument() == "outer";
                bool const previous = cmd.argument() == "previous";
                bool const before = cmd.argument() == "before";
-               bool const normal = cmd.argument().empty();
                Paragraph const & para = cur.paragraph();
                docstring layout;
                if (para.layout().isEnvironment())
@@ -1536,20 +1535,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                }
                if (before)
                        cur.top().setPitPos(cur.pit(), 0);
-               DocumentClass const & tc = bv->buffer().params().documentClass();
-               if (normal && cur.pos() == 0 && isFirstInSequence(cur.pit())) {
-                       Layout::LaTeXArgMap args = tc[layout].args();
-                       Layout::LaTeXArgMap::const_iterator lait = args.begin();
-                       Layout::LaTeXArgMap::const_iterator const laend = args.end();
-                       for (; lait != laend; ++lait) {
-                               Layout::latexarg arg = (*lait).second;
-                               if (arg.autoinsert) {
-                                       FuncRequest cmd(LFUN_ARGUMENT_INSERT, (*lait).first + " force");
-                                       lyx::dispatch(cmd);
-                               }
-                       }
-                       cur.forwardPos();
-               }
                if (before || cur.pos() > 0)
                        lyx::dispatch(FuncRequest(LFUN_PARAGRAPH_BREAK));
                else if (previous && cur.nextInset() && cur.nextInset()->lyxCode() == SEPARATOR_CODE)
@@ -1558,6 +1543,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                        while (cur.paragraph().params().depth() > split_depth)
                                lyx::dispatch(FuncRequest(LFUN_DEPTH_DECREMENT));
                }
+               DocumentClass const & tc = bv->buffer().params().documentClass();
                lyx::dispatch(FuncRequest(LFUN_LAYOUT, from_ascii("\"") + tc.plainLayout().name()
                                          + from_ascii("\" ignoreautonests")));
                lyx::dispatch(FuncRequest(LFUN_SEPARATOR_INSERT, "plain"));
@@ -2874,7 +2860,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
                code = ARG_CODE;
                allow_in_passthru = true;
                string const arg = cmd.getArg(0);
-               bool const force = cmd.getArg(1) == "force";
                if (arg.empty()) {
                        enable = false;
                        break;
@@ -2908,7 +2893,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
                                        break;
                                for (auto const & table : pars_[pit].insetList())
                                        if (InsetArgument const * ins = table.inset->asInsetArgument())
-                                               if (ins->name() == arg && !force) {
+                                               if (ins->name() == arg) {
                                                        // we have this already
                                                        enable = false;
                                                        break;
index a733588ef25f4097bcd5a9268b56967977e9db74..b19b3841ae6689ea0776c2dffd66ab172aec976e 100644 (file)
@@ -360,7 +360,6 @@ bool InsetText::getStatus(Cursor & cur, FuncRequest const & cmd,
 
        case LFUN_ARGUMENT_INSERT: {
                string const arg = cmd.getArg(0);
-               bool const force = cmd.getArg(1) == "force";
                if (arg.empty()) {
                        status.setEnabled(false);
                        return true;
@@ -375,7 +374,7 @@ bool InsetText::getStatus(Cursor & cur, FuncRequest const & cmd,
                        for (Paragraph const & par : paragraphs())
                                for (auto const & table : par.insetList())
                                        if (InsetArgument const * ins = table.inset->asInsetArgument())
-                                               if (ins->name() == arg && !force) {
+                                               if (ins->name() == arg) {
                                                        // we have this already
                                                        status.setEnabled(false);
                                                        return true;