]> git.lyx.org Git - features.git/commitdiff
Fix a crash when applying the preferences.
authorVincent van Ravesteijn <vfr@lyx.org>
Sat, 15 Aug 2009 14:34:00 +0000 (14:34 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sat, 15 Aug 2009 14:34:00 +0000 (14:34 +0000)
The problem is that all toolbars are deleted and thus also the LayoutBox, which I made a member of GuiView.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31051 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index 74136915f6d84fe3bcbdc6b60ccbd235741f0cd7..b89950339d177ba7eba0f87cdc810ce2d8dde204 100644 (file)
@@ -296,8 +296,6 @@ GuiView::GuiView(int id)
        // GuiToolbars *must* be initialised before the menu bar.
        normalSizedIcons(); // at least on Mac the default is 32 otherwise, which is huge
        constructToolbars();
-       d.layout_ = new LayoutBox(*this);
-       d.stack_widget_->addWidget(d.layout_);  
 
        // set ourself as the current view. This is needed for the menu bar
        // filling, at least for the static special menu item on Mac. Otherwise
@@ -436,6 +434,12 @@ void GuiView::constructToolbars()
                delete it->second;
        d.toolbars_.clear();
 
+       // I don't like doing this here, but the standard toolbar
+       // destroys this object when it's destroyed itself (vfr)
+       d.layout_ = new LayoutBox(*this);
+       d.stack_widget_->addWidget(d.layout_);
+       d.layout_->move(0,0);
+
        // extracts the toolbars from the backend
        Toolbars::Infos::iterator cit = guiApp->toolbars().begin();
        Toolbars::Infos::iterator end = guiApp->toolbars().end();