update dev300-m57
[ooovba.git] / applied_patches / 0407-uno-xmenu-getpopupMenu-fix.diff
blob32bd06e5eb6f3570ebcfc087782e3906f4ab601d
1 diff --git toolkit/inc/toolkit/awt/vclxmenu.hxx toolkit/inc/toolkit/awt/vclxmenu.hxx
2 index 2f2d6c6..84ca639 100644
3 --- toolkit/inc/toolkit/awt/vclxmenu.hxx
4 +++ toolkit/inc/toolkit/awt/vclxmenu.hxx
5 @@ -48,6 +48,7 @@
6 class Menu;
7 class MenuBar;
8 class VclSimpleEvent;
9 +class PopupMenu;
11 DECLARE_LIST( PopupMenuRefList, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >* )
13 @@ -184,6 +185,7 @@ class TOOLKIT_DLLPUBLIC VCLXPopupMenu : public VCLXMenu
15 public:
16 VCLXPopupMenu();
17 + VCLXPopupMenu( PopupMenu* pPopMenu );
20 #endif // _TOOLKIT_AWT_VCLXMENU_HXX_
21 diff --git toolkit/source/awt/vclxmenu.cxx toolkit/source/awt/vclxmenu.cxx
22 index 192beab..7bbfa60 100644
23 --- toolkit/source/awt/vclxmenu.cxx
24 +++ toolkit/source/awt/vclxmenu.cxx
25 @@ -529,6 +529,14 @@ void VCLXMenu::setPopupMenu( sal_Int16 nItemId, const ::com::sun::star::uno::Ref
26 break;
29 + // it seems the popup menu is not insert into maPopupMenueRefs
30 + // if the popup men is not created by stardiv.Toolkit.VCLXPopupMenu
31 + if( !aRef.is() )
32 + {
33 + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > * pNewRef = new ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > ;
34 + *pNewRef = new VCLXPopupMenu( (PopupMenu*)pMenu );
35 + aRef = *pNewRef;
36 + }
38 return aRef;
40 @@ -1057,3 +1065,8 @@ VCLXPopupMenu::VCLXPopupMenu()
41 DBG_CTOR( VCLXPopupMenu, 0 );
42 ImplCreateMenu( TRUE );
45 +VCLXPopupMenu::VCLXPopupMenu( PopupMenu* pPopMenu ) : VCLXMenu( (Menu *)pPopMenu )
47 + DBG_CTOR( VCLXPopupMenu, 0 );