Tag: mws_ooo300
User: rt      
Date: 2008-08-27 15:51:21+0000
Modified:
   dba/dbaccess/source/ui/control/dbtreelistbox.cxx

Log:
 INTEGRATION: CWS reportbuilderext (1.20.30); FILE MERGED
 2008/08/06 14:09:24 fs 1.20.30.1: #i92508# 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.20.1
Delta lines:  +15 -2
--------------------
--- dbtreelistbox.cxx   2008-06-25 12:43:33+0000        1.20
+++ dbtreelistbox.cxx   2008-08-27 15:51:19+0000        1.20.20.1
@@ -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]

Reply via email to