]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiMenubar.cpp
Introducing GuiMenubar::init() to avoid destructing the object in order to re-initial...
[lyx.git] / src / frontends / qt4 / GuiMenubar.cpp
index 194095ddffe0662b277a2014bb54900fbf0bdf0f..a06be19ae9be4f7c6049be88fcaebe271e138b38 100644 (file)
@@ -39,6 +39,12 @@ namespace frontend {
 
 GuiMenubar::GuiMenubar(LyXView * view, MenuBackend & mbe)
        : owner_(static_cast<GuiView*>(view)), menubackend_(mbe)
+{
+       init();
+}
+
+
+void GuiMenubar::init()
 {
        macxMenuBarInit();
 
@@ -55,6 +61,9 @@ GuiMenubar::GuiMenubar(LyXView * view, MenuBackend & mbe)
                        << menubackend_.getMenubar().size());
        }
 
+       // Clear all menubar contents before filling it.
+       owner_->menuBar()->clear();
+
        Menu menu;
        menubackend_.expand(menubackend_.getMenubar(), menu, owner_->buffer());