[Libreoffice-commits] core.git: toolkit/source

Fabio Buso dev.siroibaf at gmail.com
Sun Nov 1 03:21:30 PST 2015


 toolkit/source/awt/vclxwindow.cxx                     |   40 +++++++-----------
 toolkit/source/awt/vclxwindows.cxx                    |   10 +---
 toolkit/source/controls/controlmodelcontainerbase.cxx |   11 ++--
 toolkit/source/controls/grid/defaultgriddatamodel.cxx |    4 -
 4 files changed, 27 insertions(+), 38 deletions(-)

New commits:
commit 76e75d2dd6dafe55fd1740693529640652ed6455
Author: Fabio Buso <dev.siroibaf at gmail.com>
Date:   Sun Nov 1 00:24:14 2015 +0100

    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 at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 8fda3a6..4a4f1ad 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 ac93082..ff5c204 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 6e26eb9..db2a42e 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 d71628f..06e0815 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;
     }
 


More information about the Libreoffice-commits mailing list