]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiToc.cpp
Fix dangling inset pointers after buffer reload
[lyx.git] / src / frontends / qt4 / GuiToc.cpp
index af9f6f957f403eaf85f29bad73f0a8dd5d0c789c..29ec85c27ff9db904df6e0a4104ae91c75702584 100644 (file)
@@ -50,7 +50,6 @@ GuiToc::~GuiToc()
 void GuiToc::updateView()
 {
        widget_->updateView();
-       return;
 }
 
 
@@ -70,14 +69,14 @@ void GuiToc::enableView(bool enable)
 {
        if (!enable)
                // In the opposite case, updateView() will be called anyway.
-               widget_->updateView();
+               widget_->updateViewNow();
 }
 
 
 void GuiToc::closeEvent(QCloseEvent * /*event*/)
 {
        is_closing_ = true;
-       ((GuiView *)parent())->updateToolbars();
+       static_cast<GuiView *>(parent())->updateToolbars();
        is_closing_ = false;
 }
 
@@ -97,15 +96,7 @@ bool GuiToc::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 Dialog * createGuiToc(GuiView & lv)
 {
-       GuiToc * toc;
-#ifdef Q_OS_MAC
-       // On Mac show at the right and floating
-       toc = new GuiToc(lv, Qt::RightDockWidgetArea);
-       toc->setFloating(true);
-#else
-       toc = new GuiToc(lv);
-#endif
-       return toc;
+       return new GuiToc(lv);
 }