diff -ur abi/src/af/ev/unix/ev_UnixMenu.cpp abi-dev/src/af/ev/unix/ev_UnixMenu.cpp --- abi/src/af/ev/unix/ev_UnixMenu.cpp Tue Sep 11 14:47:07 2001 +++ abi-dev/src/af/ev/unix/ev_UnixMenu.cpp Wed Sep 12 11:24:35 2001 @@ -1051,29 +1051,24 @@ } /*! - * That will add the menu item with the specified id - * to the menu. In the LayoutSet there is (should be) a - * LayoutItem with the same id as the menu id. + * That will add a new menu entry for the menu item at layout_pos. * - * This LayoutItem contains useful information about the - * menu item (as if it's a Normal menu item, or a Separator, - * or a BeginSubMenu, etc.) - * - * By now we don't care about where to insert the menu - * item. I've just picked the position 30 randomly. - * - * @todo Calcule the real position of the menu item in function - * of (for instance) the menu label ("Format/Blah" will indicate - * that you will find it in the menu "Format", and that the item - * label is "Blah"). + * @param layout_pos UT_uint32 with the relative position of the item in the + * menu. + * @return true if there were no problems. False elsewere. */ bool EV_UnixMenu::_doAddMenuItem(UT_uint32 layout_pos) { UT_DEBUGMSG(("JCA: layout_pos = [%d]\n", layout_pos)); if (layout_pos > 0) { + UT_DEBUGMSG(("Trying to insert at [%d] in a vector of size [%d].\n", layout_pos, m_vecMenuWidgets.size())); UT_sint32 err = m_vecMenuWidgets.insertItemAt(NULL, layout_pos); - return !err; + + if (err != 0) + UT_DEBUGMSG(("Error [%d] inserting NULL item in a ut_vector.\n", err)); + + return (err == 0); } return false; diff -ur abi/src/af/ev/unix/gnome/ev_UnixGnomeMenu.cpp abi-dev/src/af/ev/unix/gnome/ev_UnixGnomeMenu.cpp --- abi/src/af/ev/unix/gnome/ev_UnixGnomeMenu.cpp Tue Sep 11 14:47:07 2001 +++ abi-dev/src/af/ev/unix/gnome/ev_UnixGnomeMenu.cpp Wed Sep 12 11:42:10 2001 @@ -1074,6 +1074,11 @@ aux->me->invokeMenuMethod(aux->me->m_pUnixFrame->getCurrentView(), pEM, 0, 0); } +bool EV_UnixGnomeMenu::_doAddMenuItem(UT_uint32 layout_pos) +{ + return true; +} + /***********************************************************************/ EV_UnixGnomeMenuBar::EV_UnixGnomeMenuBar(XAP_UnixApp * pUnixApp, diff -ur abi/src/af/ev/unix/gnome/ev_UnixGnomeMenu.h abi-dev/src/af/ev/unix/gnome/ev_UnixGnomeMenu.h --- abi/src/af/ev/unix/gnome/ev_UnixGnomeMenu.h Tue Sep 11 14:47:07 2001 +++ abi-dev/src/af/ev/unix/gnome/ev_UnixGnomeMenu.h Wed Sep 12 11:41:20 2001 @@ -52,11 +52,12 @@ void _attachWidgetsAndSignals(GtkWidget * wMenuRoot, GnomeUIInfo * uiinfo); GnomeUIInfo * _generateMenuItem(UT_uint32 nLabelItemInLayout); void _addNewItemEntry(GtkWidget * wMenuRoot, - GtkWidget * wParent, - UT_uint32 nLabelItemInLayout, - gint nPositionInThisMenu); - bool _refreshMenu(AV_View * pView, GtkWidget * wMenuRoot); + GtkWidget * wParent, + UT_uint32 nLabelItemInLayout, + gint nPositionInThisMenu); + bool _refreshMenu(AV_View * pView, GtkWidget * wMenuRoot); void _convertString2Accel(const char *s, guint &accel_key, GdkModifierType &ac_mods); + virtual bool _doAddMenuItem(UT_uint32 layout_pos); // static functions static void s_getStockPixmapFromName (int id, const char *name, char *pixmap_name, int n);