diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-11-02 12:27:24 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-11-02 12:33:11 +0100 |
commit | 021a5e7123d7e338a21c7bac964e4318894a53e0 (patch) | |
tree | 425c043565326b1b3a3846720e29c9450449d027 /toolkit | |
parent | 63f90a97b6a7679572eb150bafe3a5e51e52d875 (diff) |
toolkit: pMouseEvt must not be captured
Its lifetime is bounded by the currently processed event.
(regression from 76e75d2dd6dafe55fd1740693529640652ed6455)
Change-Id: I4896b161295eeab3bbf08e59c5a82afac4338f08
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 10 | ||||
-rw-r--r-- | toolkit/source/controls/controlmodelcontainerbase.cxx | 8 |
2 files changed, 10 insertions, 8 deletions
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 9920a57c3e68..7c6a32884bcc 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -692,10 +692,12 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) if ( mpImpl->getMouseListeners().getLength() && ( pMouseEvt->IsEnterWindow() || pMouseEvt->IsLeaveWindow() ) ) { awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *pMouseEvt, *this ) ); - - Callback aCallback = [ this, pMouseEvt, aEvent ]() - { MouseListenerMultiplexer& maMouseListeners = this->mpImpl->getMouseListeners(); - pMouseEvt->IsEnterWindow() ? maMouseListeners.mouseEntered( aEvent ) : maMouseListeners.mouseExited( aEvent ); }; + bool const isEnter(pMouseEvt->IsEnterWindow()); + Callback aCallback = [ this, isEnter, aEvent ]() + { MouseListenerMultiplexer& rMouseListeners = this->mpImpl->getMouseListeners(); + (isEnter) + ? rMouseListeners.mouseEntered(aEvent) + : rMouseListeners.mouseExited(aEvent); }; ImplExecuteAsyncWithoutSolarLock( aCallback ); } diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index db2a42ee3751..f94c42e6f950 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -285,8 +285,8 @@ void SAL_CALL ControlModelContainerBase::dispose( ) throw(RuntimeException, std ::std::transform( maModels.begin(), maModels.end(), // source range aChildModels.begin(), // target location - []( const UnoControlModelHolder& aUnoControlModelHolder ) - { return aUnoControlModelHolder.first; } // operation to apply -> select the XControlModel part + []( const UnoControlModelHolder& rUnoControlModelHolder ) + { return rUnoControlModelHolder.first; } // operation to apply -> select the XControlModel part ); // now dispose @@ -540,8 +540,8 @@ Sequence< OUString > ControlModelContainerBase::getElementNames() throw(RuntimeE ::std::transform( maModels.begin(), maModels.end(), // source range aNames.getArray(), // target range - []( const UnoControlModelHolder& aUnoControlModelHolder ) - { return aUnoControlModelHolder.second; } // operator to apply: select the second element (the name) + []( const UnoControlModelHolder& rUnoControlModelHolder ) + { return rUnoControlModelHolder.second; } // operator to apply: select the second element (the name) ); return aNames; |