Remove some logic that would reset depth when editing non-environment
stuff (e.g. Standard layout) at non-zero depth. The current way of
decreasing depth is to use paragraph-break in an empty paragraph.
See discussion in ticket #2445 for why this code happened.
Fixes bug #12750.
/**
* This breaks a paragraph at the specified position.
* The new paragraph will:
/**
* This breaks a paragraph at the specified position.
* The new paragraph will:
- * - Decrease depth by one (or change layout to default layout) when
- * keep_layout == false
- * - keep current depth and layout when keep_layout == true
+ * - change layout to default layout when keep_layout == false
+ * - keep layout when keep_layout == true
*/
static void breakParagraph(Text & text, pit_type par_offset, pos_type pos,
bool keep_layout)
*/
static void breakParagraph(Text & text, pit_type par_offset, pos_type pos,
bool keep_layout)
// remember to set the inset_owner
tmp->setInsetOwner(&par.inInset());
// remember to set the inset_owner
tmp->setInsetOwner(&par.inInset());
- // without doing that we get a crash when typing <Return> at the
- // end of a paragraph
- tmp->setPlainOrDefaultLayout(bparams.documentClass());
+ tmp->params().depth(par.params().depth());
if (keep_layout) {
tmp->setLayout(par.layout());
tmp->setLabelWidthString(par.params().labelWidthString());
if (keep_layout) {
tmp->setLayout(par.layout());
tmp->setLabelWidthString(par.params().labelWidthString());
- tmp->params().depth(par.params().depth());
- } else if (par.params().depth() > 0) {
- Paragraph const & hook = pars[text.outerHook(par_offset)];
- tmp->setLayout(hook.layout());
- // not sure the line below is useful
- tmp->setLabelWidthString(par.params().labelWidthString());
- tmp->params().depth(hook.params().depth());
- }
+ } else
+ tmp->setPlainOrDefaultLayout(bparams.documentClass());
bool const isempty = (par.allowEmpty() && par.empty());
bool const isempty = (par.allowEmpty() && par.empty());