]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/Menubar_pimpl.C
fix crash with "save as"
[lyx.git] / src / frontends / xforms / Menubar_pimpl.C
index f430ecd050d75436e1c40018c99d4404a9ae75d2..042ba49280c332033240ca881afe274ea9b772a6 100644 (file)
@@ -1,9 +1,11 @@
 /**
- * \file Menubar_pimpl.C
- * Copyright 1999-2001 The LyX Team.
- * See the file COPYING.
+ * \file xforms/Menubar_pimpl.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author  Lars Gullik Bjønnes, larsbj@lyx.org
+ * \author  Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
@@ -90,6 +92,10 @@ Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mb)
 }
 
 
+Menubar::Pimpl::~Pimpl()
+{}
+
+
 void Menubar::Pimpl::makeMenubar(Menu const & menu)
 {
        FL_FORM * form = owner_->getForm();
@@ -244,7 +250,9 @@ int Menubar::Pimpl::create_submenu(Window win, XFormsView * view,
                string & extra_label = *it;
 
                ++count;
-               if (count > max_number_of_items) {
+               // add a More... submenu if the menu is too long (but
+               // not just for one extra entry!)
+               if (count > max_number_of_items && (i+1) != end) {
                        int tmpmenuid = get_new_submenu(smn, win);
                        lyxerr[Debug::GUI] << "Too many items, creating "
                                           << "new menu " << tmpmenuid << endl;
@@ -417,3 +425,15 @@ void Menubar::Pimpl::MenuCallback(FL_OBJECT * ob, long button)
        fl_set_tabstop(default_tabstop);
 
 }
+
+
+Menubar::Pimpl::ItemInfo::ItemInfo
+       (Menubar::Pimpl * p, MenuItem const * i, FL_OBJECT * o)
+       : pimpl_(p), obj_(o)
+{
+       item_.reset(i);
+}
+
+
+Menubar::Pimpl::ItemInfo::~ItemInfo()
+{}