]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
Fix layout bug. Pasting text into a cell tried to set Standard layout, because
[lyx.git] / src / BufferView.cpp
index ddbe14789a39fbdfbff8c2da58f9985a34d32fbe..b46be350b850010964b3c6322381b7dd86cda0ba 100644 (file)
@@ -1072,9 +1072,12 @@ bool BufferView::dispatch(FuncRequest const & cmd)
                if (!inset || !cur.result().dispatched())
                        cur.dispatch(cmd);
 
+               // FIXME I'm adding the last break to solve a crash,
+               // but that is obviously not right.
                if (!cur.result().dispatched())
                        // It did not work too; no action needed.
                        break;
+               break;
        }
 
        case LFUN_PARAGRAPH_GOTO: {
@@ -1456,15 +1459,12 @@ bool BufferView::dispatch(FuncRequest const & cmd)
                InsetIterator it  = inset_iterator_begin(inset);
                InsetIterator const end = inset_iterator_end(inset);
                for (; it != end; ++it) {
-                       if (!it->asInsetMath()
+                       if (it->asInsetCollapsable()
                            && (inset_code == NO_CODE
                            || inset_code == it->lyxCode())) {
                                Cursor tmpcur = cur;
                                tmpcur.pushBackward(*it);
-                               FuncStatus flag;
-                               it->getStatus(tmpcur, fr, flag);
-                               if (flag.enabled())
-                                       it->dispatch(tmpcur, fr);
+                               it->dispatch(tmpcur, fr);
                        }
                }
                processUpdateFlags(Update::Force | Update::FitCursor);
@@ -1483,6 +1483,7 @@ docstring const BufferView::requestSelection()
 {
        Cursor & cur = d->cursor_;
 
+       LYXERR(Debug::SELECTION, "requestSelection: cur.selection: " << cur.selection());
        if (!cur.selection()) {
                d->xsel_cache_.set = false;
                return docstring();