View | Details | Raw Unified | Return to issue 99010
Collapse All | Expand All

(-)toolkit/source/awt/vclxtopwindow.cxx (+30 lines)
Lines 59-64 Link Here
59
59
60
#include <tools/debug.hxx>
60
#include <tools/debug.hxx>
61
61
62
VCLXTopWindow_Base::VCLXTopWindow_Base()
63
    : m_bHasAWTMenuBar( sal_False )
64
{
65
}
66
62
VCLXTopWindow_Base::~VCLXTopWindow_Base()
67
VCLXTopWindow_Base::~VCLXTopWindow_Base()
63
{
68
{
64
}
69
}
Lines 153-168 Link Here
153
		{
158
		{
154
			VCLXMenu* pMenu = VCLXMenu::GetImplementation( rxMenu );
159
			VCLXMenu* pMenu = VCLXMenu::GetImplementation( rxMenu );
155
			if ( pMenu && !pMenu->IsPopupMenu() )
160
			if ( pMenu && !pMenu->IsPopupMenu() )
161
            {
156
				pWindow->SetMenuBar( (MenuBar*) pMenu->GetMenu() );
162
				pWindow->SetMenuBar( (MenuBar*) pMenu->GetMenu() );
163
                m_bHasAWTMenuBar = sal_True;
157
		}
164
		}
165
158
	}
166
	}
167
	}
159
	mxMenuBar = rxMenu;
168
	mxMenuBar = rxMenu;
160
}
169
}
161
170
171
void VCLXTopWindow_Base::cleanUpMenuBar()
172
{
173
    ::vos::OGuard aGuard( GetMutexImpl() );
174
175
    if ( m_bHasAWTMenuBar )
176
    {
177
        SystemWindow* pWindow = (SystemWindow*) GetWindowImpl();
178
        if ( pWindow )
179
        {
180
            pWindow->SetMenuBar( NULL );
181
            m_bHasAWTMenuBar = sal_False;
182
        }
183
    }
184
}
185
162
//	----------------------------------------------------
186
//	----------------------------------------------------
163
//	class VCLXTopWindow
187
//	class VCLXTopWindow
164
//	----------------------------------------------------
188
//	----------------------------------------------------
165
189
190
void VCLXTopWindow::dispose() throw(::com::sun::star::uno::RuntimeException)
191
{
192
    VCLXTopWindow_Base::cleanUpMenuBar();
193
    VCLXContainer::dispose();
194
}
195
166
void VCLXTopWindow::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
196
void VCLXTopWindow::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
167
{
197
{
168
    VCLXContainer::ImplGetPropertyIds( rIds );
198
    VCLXContainer::ImplGetPropertyIds( rIds );
(-)toolkit/inc/toolkit/awt/vclxtopwindow.hxx (-1 / +8 lines)
Lines 45-60 Link Here
45
                              ::com::sun::star::awt::XSystemDependentWindowPeer
45
                              ::com::sun::star::awt::XSystemDependentWindowPeer
46
                              > VCLXTopWindow_XBase;
46
                              > VCLXTopWindow_XBase;
47
47
48
class TOOLKIT_DLLPUBLIC VCLXTopWindow_Base: public VCLXTopWindow_XBase
48
class SAL_DLLPRIVATE VCLXTopWindow_Base: public VCLXTopWindow_XBase
49
{
49
{
50
private:
51
    ::sal_Bool m_bHasAWTMenuBar;
50
protected:
52
protected:
51
  	::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar> mxMenuBar;
53
  	::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar> mxMenuBar;
52
54
53
	virtual ::vos::IMutex& GetMutexImpl() = 0;
55
	virtual ::vos::IMutex& GetMutexImpl() = 0;
54
    virtual Window* GetWindowImpl() = 0;
56
    virtual Window* GetWindowImpl() = 0;
55
	virtual ::cppu::OInterfaceContainerHelper& GetTopWindowListenersImpl() = 0;
57
	virtual ::cppu::OInterfaceContainerHelper& GetTopWindowListenersImpl() = 0;
58
    void cleanUpMenuBar();
56
59
57
public:
60
public:
61
    VCLXTopWindow_Base();
58
    virtual ~VCLXTopWindow_Base();
62
    virtual ~VCLXTopWindow_Base();
59
63
60
    // ::com::sun::star::awt::XSystemDependentWindowPeer
64
    // ::com::sun::star::awt::XSystemDependentWindowPeer
Lines 96-101 Link Here
96
	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >	SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
100
	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >	SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
97
	::com::sun::star::uno::Sequence< sal_Int8 >						SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
101
	::com::sun::star::uno::Sequence< sal_Int8 >						SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
98
102
103
    // ::com::sun::star::lang::XComponent
104
    virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
105
99
    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
106
    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
100
    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
107
    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
101
};
108
};

Return to issue 99010