This patch fixes a bug where the extra "More..." submenu produces for
menus that are too long can contain only one entry (which looks of
course stupid).

The problem can be seen in the file menu with lastfiles=9, for
example.

OK to apply?

JMarc

Index: src/frontends/xforms/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/ChangeLog,v
retrieving revision 1.564
diff -u -p -r1.564 ChangeLog
--- src/frontends/xforms/ChangeLog	15 Oct 2002 17:24:08 -0000	1.564
+++ src/frontends/xforms/ChangeLog	16 Oct 2002 14:30:27 -0000
@@ -1,3 +1,8 @@
+2002-10-16  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* Menubar_pimpl.C (create_submenu): do not create a "More..."
+	submenu just for one entry
+
 2002-10-15  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* XWorkArea.C (work_area_handler): Pass the mouse button correctly to
Index: src/frontends/xforms/Menubar_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Menubar_pimpl.C,v
retrieving revision 1.76
diff -u -p -r1.76 Menubar_pimpl.C
--- src/frontends/xforms/Menubar_pimpl.C	26 Sep 2002 08:57:43 -0000	1.76
+++ src/frontends/xforms/Menubar_pimpl.C	16 Oct 2002 14:30:27 -0000
@@ -250,7 +250,9 @@ int Menubar::Pimpl::create_submenu(Windo
 		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;

Reply via email to