]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/TocWidget.cpp
Fix dangling inset pointers after buffer reload
[lyx.git] / src / frontends / qt4 / TocWidget.cpp
index 23db10ec73c0219588749e1145f98f4d1b5c8102..8bf753a9734975c967cd638bfce3af7f1f50e7c4 100644 (file)
@@ -156,7 +156,7 @@ bool TocWidget::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_OUTLINE_IN:
        case LFUN_OUTLINE_OUT:
        case LFUN_SECTION_SELECT:
-               status.setEnabled(item.dit() != 0);
+               status.setEnabled((bool)item.dit());
                return true;
 
        case LFUN_LABEL_COPY_AS_REFERENCE: {
@@ -450,10 +450,8 @@ void TocWidget::updateViewNow()
 void TocWidget::finishUpdateView()
 {
        // Profiling shows that this is the expensive stuff in the context of typing
-       // text and moving with arrows (still five times less than updateToolbars in
-       // my tests with a medium-sized document, however this grows linearly in the
-       // size of the document). For bigger operations, this is negligible, and
-       // outweighted by TocModels::reset() anyway.
+       // text and moving with arrows. For bigger operations, this is negligible,
+       // and outweighted by TocModels::reset() anyway.
        if (canNavigate()) {
                if (!persistent_)
                        setTreeDepth(depth_);