diff --git a/src/Text3.cpp b/src/Text3.cpp index 673296894a..42dbf837ec 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -859,9 +859,29 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) break; } - case LFUN_INSET_DISSOLVE: - needsUpdate |= dissolveInset(cur); + case LFUN_INSET_DISSOLVE: { + // first, try if there's an inset at cursor + // FIXME: this first part should be moved to + // a LFUN_NEXT_INSET_DISSOLVE, or be called via + // some generic "next-inset inset-dissolve" + Inset * inset = cur.nextInset(); + if (inset && inset->isActive()) { + Cursor tmpcur = cur; + tmpcur.pushBackward(*inset); + inset->dispatch(tmpcur, cmd); + if (tmpcur.result().dispatched()) { + cur.dispatched(); + break; + } + } + // if it did not work, try the underlying inset + if (dissolveInset(cur)) { + needsUpdate = true; + break; + } + // if it did not work, do nothing. break; + } case LFUN_INSET_SETTINGS: { Inset & inset = cur.inset(); @@ -2158,8 +2178,10 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, enable = cur.inset().lyxCode() == FLEX_CODE && il.lyxtype() == type; } else { - enable = !isMainText(cur.bv().buffer()) - && cur.inset().nargs() == 1; + enable = ((!isMainText(cur.bv().buffer()) + && cur.inset().nargs() == 1) + || (cur.nextInset() + && cur.nextInset()->nargs() == 1)); } break; diff --git a/status.16x b/status.16x index ae6e6586d2..248e751806 100644 --- a/status.16x +++ b/status.16x @@ -80,6 +80,9 @@ What's new - Reflect external material template using Instant Preview in the dialog for scaling property (bug 5628). + +- Enable "dissolve" item in context menus of collapsable insets (bug 4985). + * DOCUMENTATION AND LOCALIZATION