- case LFUN_INSET_CAPTION:
- if (bv->innerInset()) {
- auto_ptr<InsetCaption> inset(new InsetCaption(params));
- inset->setOwner(bv->innerInset());
- inset->setAutoBreakRows(true);
- inset->setDrawFrame(InsetText::LOCKED);
- inset->setFrameColor(LColor::captionframe);
- return inset.release();
+ case LFUN_INSET_CAPTION: {
+ UpdatableInset * up = bv->cursor().inset().asUpdatableInset();
+ if (!up) {
+ auto_ptr<InsetCaption> inset(new InsetCaption(params));
+ inset->setAutoBreakRows(true);
+ inset->setDrawFrame(true);
+ inset->setFrameColor(LColor::captionframe);
+ return inset.release();
+ }
+ return 0;