]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.C
Fix crash when running lyx -dbg insets -e ...
[lyx.git] / src / BufferView_pimpl.C
index 45ec862af5433f26073b680f2fd869630097f006..f0c6fc86c0ae4636fd558733850dbed11e9ed5af 100644 (file)
@@ -1266,8 +1266,11 @@ void BufferView::Pimpl::hideCursor()
 
 void BufferView::Pimpl::toggleSelection(bool b)
 {
-       if (screen_.get())
+       if (screen_.get()) {
+               if (bv_->theLockingInset())
+                       bv_->theLockingInset()->toggleSelection(bv_, b);
                screen_->toggleSelection(bv_->text, bv_, b);
+       }
 }
 
 
@@ -2634,13 +2637,13 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
        }
        break;
        
-       case LFUN_OPENSTUFF:
+       case LFUN_INSET_TOGGLE:
        {
                LyXText * lt = bv_->getLyXText();
                hideCursor();
                beforeChange(lt);
                update(lt, BufferView::SELECT|BufferView::FITCUR);
-               lt->openStuff(bv_);
+               lt->toggleInset(bv_);
                update(lt, BufferView::SELECT|BufferView::FITCUR);
                setState();
        }       
@@ -3340,7 +3343,7 @@ bool BufferView::Pimpl::insertInset(Inset * inset, string const & lout)
        // if we are in a locking inset we should try to insert the
        // inset there otherwise this is a illegal function now
        if (bv_->theLockingInset()) {
-               if (bv_->theLockingInset()->insertInsetAllowed(inset))
+               if (bv_->theLockingInset()->insetAllowed(inset))
                    return bv_->theLockingInset()->insertInset(bv_, inset);
                return false;
        }