InsetLayout const & il = getLayout();
InsetLayout::InsetLyXType const type =
translateLyXType(to_utf8(cmd.argument()));
- if (il.lyxtype() == type) {
+ if (il.lyxtype() == type
+ || (il.name() == DocumentClass::plainInsetLayout().name()
+ && type == InsetLayout::CHARSTYLE)) {
FuncRequest temp_cmd(LFUN_INSET_DISSOLVE);
return InsetCollapsible::getStatus(cur, temp_cmd, flag);
} else
InsetLayout::InsetLyXType const type =
translateLyXType(to_utf8(cmd.argument()));
- if (il.lyxtype() == type) {
+ if (il.lyxtype() == type
+ || (il.name() == DocumentClass::plainInsetLayout().name()
+ && type == InsetLayout::CHARSTYLE)) {
FuncRequest temp_cmd(LFUN_INSET_DISSOLVE);
InsetCollapsible::doDispatch(cur, temp_cmd);
} else
}
-void InsetFlex::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetFlex::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
{
BufferParams const & bp = buffer().masterBuffer()->params();
InsetLayout const & il = getLayout();
docstring const & count = il.counter();
bool const have_counter = cnts.hasCounter(count);
if (have_counter) {
- cnts.step(count, utype);
- custom_label += ' ' +
- cnts.theCounter(count, it.paragraph().getParLanguage(bp)->code());
+ Paragraph const & par = it.paragraph();
+ if (!par.isDeleted(it.pos())) {
+ cnts.step(count, utype);
+ custom_label += ' ' +
+ cnts.theCounter(count, it.paragraph().getParLanguage(bp)->code());
+ } else
+ custom_label += ' ' + from_ascii("#");
}
setLabel(custom_label);
// need a layout flag
cnts.saveLastCounter();
}
- InsetCollapsible::updateBuffer(it, utype);
+ InsetCollapsible::updateBuffer(it, utype, deleted);
if (save_counter)
cnts.restoreLastCounter();
}