commit 5c704b5dd1703635f8456738c1c77413d543c84b
Author: Juergen Spitzmueller <[email protected]>
Date: Sat Dec 30 16:26:20 2017 +0100
Revert "Fix environment-split when at pos 0 of a frame title."
This reverts commit 1ff34a973d2748c407e4b7a6ea2284dac895b8ee.
---
src/LyXAction.cpp | 3 +--
src/Text3.cpp | 19 ++-----------------
src/insets/InsetText.cpp | 3 +--
3 files changed, 4 insertions(+), 21 deletions(-)
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index 58736ab..6acbdb4 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -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
*/
diff --git a/src/Text3.cpp b/src/Text3.cpp
index 2f94de5..8d37e79 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -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;
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index a733588..b19b384 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -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;