]> 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 aeb15caf99890336fec57c46c54ae25a67998c44..042ba49280c332033240ca881afe274ea9b772a6 100644 (file)
@@ -1,6 +1,7 @@
 /**
- * \file Menubar_pimpl.C
- * 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
  *
@@ -249,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;