]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/TocWidget.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / TocWidget.cpp
index 4bb5345f2786cb0e1a6ca3408da1bd6707c3970c..83ac1bf12c2e3202860a463c951372dd4a3da701 100644 (file)
@@ -152,12 +152,12 @@ bool TocWidget::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_OUTLINE_IN:
        case LFUN_OUTLINE_OUT:
        case LFUN_SECTION_SELECT:
-               status.setEnabled(true);
+               status.setEnabled(item.dit() != 0);
                return true;
 
-       case LFUN_LABEL_COPY_AS_REF: {
+       case LFUN_LABEL_COPY_AS_REFERENCE: {
                // For labels in math, we need to supply the label as a string
-               FuncRequest label_copy(LFUN_LABEL_COPY_AS_REF, item.asString());
+               FuncRequest label_copy(LFUN_LABEL_COPY_AS_REFERENCE, item.asString());
                if (inset)
                        return inset->getStatus(cur, label_copy, status);
        }
@@ -187,19 +187,26 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd)
        {
        case LFUN_CHANGE_ACCEPT:
        case LFUN_CHANGE_REJECT:
+               dispatch(item.action());
+               cur.dispatch(tmpcmd);
+               break;
+
        case LFUN_SECTION_SELECT:
                dispatch(item.action());
                cur.dispatch(tmpcmd);
+               // necessary to get the selection drawn.
+               cur.buffer()->changed(true);
+               gui_view_.setFocus();
                break;
 
-       case LFUN_LABEL_COPY_AS_REF: {
+       case LFUN_LABEL_COPY_AS_REFERENCE: {
                // For labels in math, we need to supply the label as a string
-               FuncRequest label_copy(LFUN_LABEL_COPY_AS_REF, item.asString());
+               FuncRequest label_copy(LFUN_LABEL_COPY_AS_REFERENCE, item.asString());
                if (inset)
                        inset->dispatch(cur, label_copy);
                break;
        }
-       
+
        case LFUN_OUTLINE_UP:
        case LFUN_OUTLINE_DOWN:
        case LFUN_OUTLINE_IN: