- ParagraphList::const_iterator beg = paragraphs().begin();
- ParagraphList::const_iterator par = paragraphs().begin();
- ParagraphList::const_iterator end = paragraphs().end();
-
- if (!undefined())
- sgml::openTag(os, layout_->latexname,
- par->getID(buf, runparams) + layout_->latexparam);
-
- for (; par != end; ++par) {
- par->simpleDocBookOnePar(buf, os, runparams,
- outerFont(std::distance(beg, par),
- paragraphs()));
+ switch (cmd.action()) {
+ case LFUN_INSET_DISSOLVE:
+ if (!cmd.argument().empty()) {
+ InsetLayout const & il = getLayout();
+ InsetLayout::InsetLyXType const type =
+ translateLyXType(to_utf8(cmd.argument()));
+
+ if (il.lyxtype() == type) {
+ FuncRequest temp_cmd(LFUN_INSET_DISSOLVE);
+ InsetCollapsable::doDispatch(cur, temp_cmd);
+ } else
+ cur.undispatched();
+ break;
+ }
+ // fall-through
+ default:
+ InsetCollapsable::doDispatch(cur, cmd);
+ break;