Tag: cws_dev300_dba31b User: fs Date: 2008-08-04 07:25:33+0000 Modified: dba/dbaccess/source/ui/control/dbtreelistbox.cxx
Log: preserve menu items and menu help URLs for externally-provided menu items, and preserve separators (thanks to Ariel Constenla-Haile for pointing that out, and providing the patch) File Changes: Directory: /dba/dbaccess/source/ui/control/ =========================================== File [changed]: dbtreelistbox.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/control/dbtreelistbox.cxx?r1=1.20&r2=1.20.26.1 Delta lines: +17 -4 -------------------- --- dbtreelistbox.cxx 2008-06-25 12:43:33+0000 1.20 +++ dbtreelistbox.cxx 2008-08-04 07:25:30+0000 1.20.26.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dbtreelistbox.cxx,v $ - * $Revision: 1.20 $ + * $Revision: 1.20.26.1 $ * * This file is part of OpenOffice.org. * @@ -562,6 +562,10 @@ USHORT nCount = _rMenu.GetItemCount(); for ( USHORT pos = 0; pos < nCount; ++pos ) { + // do not adjust separators + if ( _rMenu.GetItemType( pos ) == MENUITEM_SEPARATOR ) + continue; + USHORT nId = _rMenu.GetItemId(pos); String aCommand = _rMenu.GetItemCommand( nId ); PopupMenu* pPopup = _rMenu.GetPopupMenu( nId ); @@ -572,7 +576,16 @@ } USHORT nCommandId = _rCommandController.registerCommandURL( aCommand ); - _rMenu.InsertItem( nCommandId, _rMenu.GetItemText( nId ), _rMenu.GetItemBits( nId ), pos ); + _rMenu.InsertItem( nCommandId, _rMenu.GetItemText( nId ), _rMenu.GetItemImage( nId ), + _rMenu.GetItemBits( nId ), pos ); + + // more things to preserve: + // - the help command + ::rtl::OUString sHelpURL = _rMenu.GetHelpCommand( nId ); + if ( sHelpURL.getLength() ) + _rMenu.SetHelpCommand( nCommandId, sHelpURL ); + + // remove the "old" item _rMenu.RemoveItem( pos+1 ); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
