summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Buso <dev.siroibaf@gmail.com>2015-11-01 00:24:14 +0100
committerNoel Grandin <noelgrandin@gmail.com>2015-11-01 11:21:08 +0000
commit76e75d2dd6dafe55fd1740693529640652ed6455 (patch)
tree1aab3a3f5305c8c36224338483a258ffcd27620f
parentc771d2174f8f140c534c0ed3eef8320f441a131b (diff)
tdf#93243 replace boost::bind with c++11 lambdas in toolkit/
Change-Id: I33ba22fc5b3fa4d9b2b79f33b9abb7a2a0bbf9a2 Reviewed-on: https://gerrit.libreoffice.org/19716 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--toolkit/source/awt/vclxwindow.cxx40
-rw-r--r--toolkit/source/awt/vclxwindows.cxx10
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx11
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.cxx4
4 files changed, 27 insertions, 38 deletions
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 8fda3a68cd42..4a4f1adc272f 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -58,9 +58,6 @@
#include "stylesettings.hxx"
#include <tools/urlobj.hxx>
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
-
#include "helper/accessibilityclient.hxx"
#include "helper/unopropertyarrayhelper.hxx"
@@ -86,7 +83,7 @@ namespace WritingMode2 = ::com::sun::star::text::WritingMode2;
//= VCLXWindowImpl
-class VCLXWindowImpl: private boost::noncopyable
+class VCLXWindowImpl
{
private:
typedef ::std::vector< VCLXWindow::Callback > CallbackArray;
@@ -147,6 +144,9 @@ public:
*/
VCLXWindowImpl( VCLXWindow& _rAntiImpl, bool _bWithDefaultProps );
+ VCLXWindowImpl( const VCLXWindowImpl& ) = delete;
+ const VCLXWindowImpl& operator=(const VCLXWindowImpl&) = delete;
+
/** synchronously mbEnableVisible
*/
void setEnableVisible( bool bEnableVisible ) { mbEnableVisible = bEnableVisible; }
@@ -679,11 +679,9 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( aMEvt, *this ) );
aEvent.PopupTrigger = sal_True;
- Callback aCallback = ::boost::bind(
- &MouseListenerMultiplexer::mousePressed,
- &mpImpl->getMouseListeners(),
- aEvent
- );
+ Callback aCallback = [ this, &aEvent ]()
+ { this->mpImpl->getMouseListeners().mousePressed( aEvent ); };
+
ImplExecuteAsyncWithoutSolarLock( aCallback );
}
}
@@ -695,11 +693,10 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *pMouseEvt, *this ) );
- Callback aCallback = ::boost::bind(
- pMouseEvt->IsEnterWindow() ? &MouseListenerMultiplexer::mouseEntered : &MouseListenerMultiplexer::mouseExited,
- &mpImpl->getMouseListeners(),
- aEvent
- );
+ Callback aCallback = [ this, &pMouseEvt, &aEvent ]()
+ { MouseListenerMultiplexer& maMouseListeners = this->mpImpl->getMouseListeners();
+ pMouseEvt->IsEnterWindow() ? maMouseListeners.mouseEntered( aEvent ) : maMouseListeners.mouseExited( aEvent ); };
+
ImplExecuteAsyncWithoutSolarLock( aCallback );
}
@@ -719,11 +716,8 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
if ( mpImpl->getMouseListeners().getLength() )
{
awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *static_cast<MouseEvent*>(rVclWindowEvent.GetData()), *this ) );
- Callback aCallback = ::boost::bind(
- &MouseListenerMultiplexer::mousePressed,
- &mpImpl->getMouseListeners(),
- aEvent
- );
+ Callback aCallback = [ this, &aEvent ]()
+ { this->mpImpl->getMouseListeners().mousePressed( aEvent ); };
ImplExecuteAsyncWithoutSolarLock( aCallback );
}
}
@@ -733,11 +727,9 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
if ( mpImpl->getMouseListeners().getLength() )
{
awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *static_cast<MouseEvent*>(rVclWindowEvent.GetData()), *this ) );
- Callback aCallback = ::boost::bind(
- &MouseListenerMultiplexer::mouseReleased,
- &mpImpl->getMouseListeners(),
- aEvent
- );
+
+ Callback aCallback = [ this, &aEvent ]()
+ { this->mpImpl->getMouseListeners().mouseReleased( aEvent ); };
ImplExecuteAsyncWithoutSolarLock( aCallback );
}
}
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index ac9308283e7e..ff5c204de038 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -54,8 +54,6 @@
#include <vcl/settings.hxx>
#include <tools/diagnose_ex.h>
-#include <boost/bind.hpp>
-
#include <vcl/group.hxx>
#include "helper/accessibilityclient.hxx"
@@ -587,11 +585,9 @@ void VCLXButton::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
aEvent.Source = static_cast<cppu::OWeakObject*>(this);
aEvent.ActionCommand = maActionCommand;
- Callback aCallback = ::boost::bind(
- &ActionListenerMultiplexer::actionPerformed,
- &maActionListeners,
- aEvent
- );
+ Callback aCallback = [ this, &aEvent ]()
+ { this->maActionListeners.actionPerformed( aEvent ); };
+
ImplExecuteAsyncWithoutSolarLock( aCallback );
}
}
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index 6e26eb990ca6..db2a42ee3751 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -53,8 +53,6 @@
#include "grid/gridcontrol.hxx"
#include <toolkit/controls/tabpagecontainer.hxx>
-#include <boost/bind.hpp>
-
#include <map>
#include <algorithm>
#include <functional>
@@ -287,7 +285,8 @@ void SAL_CALL ControlModelContainerBase::dispose( ) throw(RuntimeException, std
::std::transform(
maModels.begin(), maModels.end(), // source range
aChildModels.begin(), // target location
- ::boost::bind( &UnoControlModelHolder::first, _1 ) // operation to apply -> select the XControlModel part
+ []( const UnoControlModelHolder& aUnoControlModelHolder )
+ { return aUnoControlModelHolder.first; } // operation to apply -> select the XControlModel part
);
// now dispose
@@ -541,7 +540,8 @@ Sequence< OUString > ControlModelContainerBase::getElementNames() throw(RuntimeE
::std::transform(
maModels.begin(), maModels.end(), // source range
aNames.getArray(), // target range
- ::boost::bind( &UnoControlModelHolder::second, _1 ) // operator to apply: select the second element (the name)
+ []( const UnoControlModelHolder& aUnoControlModelHolder )
+ { return aUnoControlModelHolder.second; } // operator to apply: select the second element (the name)
);
return aNames;
@@ -751,7 +751,8 @@ Sequence< Reference< XControlModel > > SAL_CALL ControlModelContainerBase::getCo
::std::transform(
aSortedModels.begin(), aSortedModels.end(),
::std::copy( aUnindexedModels.begin(), aUnindexedModels.end(), aReturn.getArray() ),
- ::boost::bind( &MapIndexToModel::value_type::second, _1 )
+ [] ( const MapIndexToModel::value_type& entryIndexToModel )
+ { return entryIndexToModel.second; }
);
return aReturn;
diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
index d71628f2cc03..06e08152c752 100644
--- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
@@ -32,7 +32,6 @@
#include <algorithm>
#include <functional>
#include <vector>
-#include <boost/bind.hpp>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -235,7 +234,8 @@ private:
RowData& rRowData = impl_getRowDataAccess_throw( i_rowIndex, m_nColumnCount );
::std::transform( rRowData.begin(), rRowData.end(), resultData.getArray(),
- boost::bind(&CellData::first,_1));
+ [] ( const CellData& rCellData )
+ { return rCellData.first; });
return resultData;
}