diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-05-06 09:39:46 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-05-06 10:52:46 +0100 |
commit | 222a9ef69c1a60526de5546433a9fce62d44823a (patch) | |
tree | 94e5b5900b5fd17813d239133d0e7c32ed9592ff /desktop | |
parent | 80b3c85269a593b0b10355e770dc91ab3d419696 (diff) |
tdf#91090 - avoid de-referencing DIALOG_NO_PARENT (-1)
Change-Id: I1032054765013a43744a7be548e892fc973a40ce
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_theextmgr.cxx | 17 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_theextmgr.hxx | 13 |
2 files changed, 16 insertions, 14 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx index 3cad80342981..fa42dc29ff94 100644 --- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx +++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx @@ -49,10 +49,10 @@ namespace dp_gui { // TheExtensionManager -TheExtensionManager::TheExtensionManager( vcl::Window *pParent, +TheExtensionManager::TheExtensionManager( const uno::Reference< awt::XWindow > &xParent, const uno::Reference< uno::XComponentContext > &xContext ) : m_xContext( xContext ), - m_pParent( pParent ), + m_xParent( xParent ), m_pExtMgrDialog( NULL ), m_pUpdReqDialog( NULL ), m_pExecuteCmdQueue( NULL ) @@ -120,7 +120,12 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg ) } else if ( !m_pExtMgrDialog ) { - m_pExtMgrDialog = VclPtr<ExtMgrDialog>::Create( m_pParent, this ); + // FIXME: horrible ... + vcl::Window* pParent = DIALOG_NO_PARENT; + if (m_xParent.is()) + pParent = VCLUnoHelper::GetWindow(m_xParent); + + m_pExtMgrDialog = VclPtr<ExtMgrDialog>::Create( pParent, this ); delete m_pExecuteCmdQueue; m_pExecuteCmdQueue = new ExtensionCmdQueue( m_pExtMgrDialog.get(), this, m_xContext ); m_pExtMgrDialog->setGetExtensionsURL( m_sGetExtensionsURL ); @@ -483,11 +488,7 @@ void TheExtensionManager::modified( ::lang::EventObject const & /*rEvt*/ ) return s_ExtMgr; } - vcl::Window* pParent = DIALOG_NO_PARENT; - if (xParent.is()) - pParent = VCLUnoHelper::GetWindow(xParent); - - ::rtl::Reference<TheExtensionManager> that( new TheExtensionManager( pParent, xContext ) ); + ::rtl::Reference<TheExtensionManager> that( new TheExtensionManager( xParent, xContext ) ); const SolarMutexGuard guard; if ( ! s_ExtMgr.is() ) diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx index 39d41b2b8aa0..2341a5ad9a3c 100644 --- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx +++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx @@ -53,18 +53,19 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > m_xExtensionManager; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xNameAccessNodes; - VclPtr<vcl::Window> m_pParent; - VclPtr<ExtMgrDialog> m_pExtMgrDialog; - VclPtr<UpdateRequiredDialog> m_pUpdReqDialog; - ExtensionCmdQueue *m_pExecuteCmdQueue; + css::uno::Reference< + css::awt::XWindow > m_xParent; + VclPtr<ExtMgrDialog> m_pExtMgrDialog; + VclPtr<UpdateRequiredDialog> m_pUpdReqDialog; + ExtensionCmdQueue *m_pExecuteCmdQueue; OUString m_sGetExtensionsURL; public: static ::rtl::Reference<TheExtensionManager> s_ExtMgr; - TheExtensionManager( vcl::Window * pParent, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &xContext ); + TheExtensionManager( const css::uno::Reference< css::awt::XWindow > &xParent, + const css::uno::Reference< css::uno::XComponentContext > &xContext ); virtual ~TheExtensionManager(); void createDialog( const bool bCreateUpdDlg ); |