[Libreoffice-commits] core.git: 2 commits - dbaccess/inc dbaccess/source sdext/inc sdext/source

Michael Stahl mstahl at redhat.com
Thu May 12 09:12:06 UTC 2016


 dbaccess/inc/pch/precompiled_dba.hxx                 |    1 
 dbaccess/inc/pch/precompiled_dbu.hxx                 |    1 
 dbaccess/source/core/dataaccess/databasedocument.cxx |   17 +++++----
 sdext/inc/pch/precompiled_PresenterScreen.hxx        |    1 
 sdext/source/presenter/PresenterScrollBar.cxx        |    5 +-
 sdext/source/presenter/PresenterSlideSorter.cxx      |    7 ++-
 sdext/source/presenter/PresenterTextView.cxx         |    6 +--
 sdext/source/presenter/PresenterTheme.cxx            |   34 +++++++++++--------
 sdext/source/presenter/PresenterTimer.cxx            |    4 +-
 sdext/source/presenter/PresenterToolBar.cxx          |    6 ++-
 sdext/source/presenter/PresenterViewFactory.cxx      |    8 ++--
 11 files changed, 52 insertions(+), 38 deletions(-)

New commits:
commit c567c0cf4484de490c3439d45310a23e77c38f7d
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 11 22:57:05 2016 +0200

    dbaccess: replace boost::bind with C++11 lambdas
    
    Change-Id: I468f9c7af9c8c8189c51790e0301dd8c60a9f83c

diff --git a/dbaccess/inc/pch/precompiled_dba.hxx b/dbaccess/inc/pch/precompiled_dba.hxx
index 77edfdb..d4e2b5e 100644
--- a/dbaccess/inc/pch/precompiled_dba.hxx
+++ b/dbaccess/inc/pch/precompiled_dba.hxx
@@ -49,7 +49,6 @@
 #include <type_traits>
 #include <utility>
 #include <vector>
-#include <boost/bind.hpp>
 #include <boost/intrusive_ptr.hpp>
 #include <boost/optional.hpp>
 #include <boost/optional/optional.hpp>
diff --git a/dbaccess/inc/pch/precompiled_dbu.hxx b/dbaccess/inc/pch/precompiled_dbu.hxx
index 3f2491e..07392df 100644
--- a/dbaccess/inc/pch/precompiled_dbu.hxx
+++ b/dbaccess/inc/pch/precompiled_dbu.hxx
@@ -31,7 +31,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <vector>
-#include <boost/bind.hpp>
 #include <boost/intrusive_ptr.hpp>
 #include <boost/optional.hpp>
 #include <osl/diagnose.h>
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 3e398a9..9e0ee5e 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -81,8 +81,6 @@
 #include <osl/diagnose.h>
 #include <tools/errcode.hxx>
 
-#include <boost/bind.hpp>
-
 #include <functional>
 #include <list>
 
@@ -1500,7 +1498,8 @@ void ODatabaseDocument::impl_disposeControllerFrames_nothrow()
     }
 }
 
-void SAL_CALL ODatabaseDocument::close( sal_Bool _bDeliverOwnership ) throw (CloseVetoException, RuntimeException, std::exception)
+void SAL_CALL ODatabaseDocument::close(sal_Bool bDeliverOwnership)
+throw (CloseVetoException, RuntimeException, std::exception)
 {
     // nearly everything below can/must be done without our mutex locked, the below is just for
     // the checks for being disposed and the like
@@ -1517,12 +1516,14 @@ void SAL_CALL ODatabaseDocument::close( sal_Bool _bDeliverOwnership ) throw (Clo
         // allow listeners to veto
         lang::EventObject aEvent( *this );
         m_aCloseListener.forEach< XCloseListener >(
-            boost::bind( &XCloseListener::queryClosing, _1, boost::cref( aEvent ), boost::cref( _bDeliverOwnership ) ) );
+            [&aEvent, &bDeliverOwnership] (uno::Reference<XCloseListener> const& xListener) {
+                return xListener->queryClosing(aEvent, bDeliverOwnership);
+            });
 
         // notify that we're going to unload
         m_aEventNotifier.notifyDocumentEvent( "OnPrepareUnload" );
 
-        impl_closeControllerFrames_nolck_throw( _bDeliverOwnership );
+        impl_closeControllerFrames_nolck_throw( bDeliverOwnership );
 
         m_aCloseListener.notifyEach( &XCloseListener::notifyClosing, (const lang::EventObject&)aEvent );
 
@@ -1777,12 +1778,14 @@ Sequence< OUString > SAL_CALL ODatabaseDocument::getDocumentSubStoragesNames(  )
     return xStorageAccess->getDocumentSubStoragesNames();
 }
 
-void ODatabaseDocument::impl_notifyStorageChange_nolck_nothrow( const Reference< XStorage >& _rxNewRootStorage )
+void ODatabaseDocument::impl_notifyStorageChange_nolck_nothrow( const Reference< XStorage >& xNewRootStorage )
 {
     Reference< XInterface > xMe( *this );
 
     m_aStorageListeners.forEach< XStorageChangeListener >(
-        boost::bind( &XStorageChangeListener::notifyStorageChange, _1, boost::cref( xMe ), boost::cref( _rxNewRootStorage ) ) );
+        [&xMe, &xNewRootStorage] (uno::Reference<XStorageChangeListener> const& xListener) {
+            return xListener->notifyStorageChange(xMe, xNewRootStorage);
+        });
 }
 
 void ODatabaseDocument::disposing()
commit 28159e91ba936e9da13bb4e194b34605065e4362
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 11 22:44:08 2016 +0200

    sdext: replace boost::bind with C++11 lambdas, part 2
    
    Change-Id: Ife5fbf7a7a41182de00dca339cba160e3bb0062f

diff --git a/sdext/inc/pch/precompiled_PresenterScreen.hxx b/sdext/inc/pch/precompiled_PresenterScreen.hxx
index d475499..31a8feb 100644
--- a/sdext/inc/pch/precompiled_PresenterScreen.hxx
+++ b/sdext/inc/pch/precompiled_PresenterScreen.hxx
@@ -40,7 +40,6 @@
 #include <string>
 #include <utility>
 #include <vector>
-#include <boost/bind.hpp>
 #include <osl/diagnose.h>
 #include <osl/doublecheckedlocking.h>
 #include <osl/getglobalmutex.hxx>
diff --git a/sdext/source/presenter/PresenterScrollBar.cxx b/sdext/source/presenter/PresenterScrollBar.cxx
index 3d7de3b..3ea3966 100644
--- a/sdext/source/presenter/PresenterScrollBar.cxx
+++ b/sdext/source/presenter/PresenterScrollBar.cxx
@@ -31,7 +31,7 @@
 #include <com/sun/star/rendering/CompositeOperation.hpp>
 #include <com/sun/star/rendering/TexturingMode.hpp>
 #include <com/sun/star/rendering/XPolyPolygon2D.hpp>
-#include <boost/bind.hpp>
+
 #include <algorithm>
 #include <memory>
 #include <math.h>
@@ -809,8 +809,9 @@ void PresenterScrollBar::MousePressRepeater::Start (const PresenterScrollBar::Ar
         Execute();
 
         // Schedule repeated executions.
+        auto pThis(shared_from_this());
         mnMousePressRepeaterTaskId = PresenterTimer::ScheduleRepeatedTask (
-            ::boost::bind(&PresenterScrollBar::MousePressRepeater::Callback, shared_from_this(), _1),
+            [pThis] (TimeValue const& rTime) { return pThis->Callback(rTime); },
             500000000,
             250000000);
     }
diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx
index 84c442d..8f03f61 100644
--- a/sdext/source/presenter/PresenterSlideSorter.cxx
+++ b/sdext/source/presenter/PresenterSlideSorter.cxx
@@ -44,7 +44,6 @@
 #include <com/sun/star/util/Color.hpp>
 #include <algorithm>
 #include <math.h>
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -303,7 +302,7 @@ PresenterSlideSorter::PresenterSlideSorter (
                 rxContext,
                 mxWindow,
                 mpPresenterController->GetPaintManager(),
-                ::boost::bind(&PresenterSlideSorter::SetVerticalOffset,this,_1)));
+                [this] (double const offset) { return this->SetVerticalOffset(offset); }));
 
         mpCloseButton = PresenterButton::Create(
             rxContext,
@@ -1052,7 +1051,9 @@ void PresenterSlideSorter::Paint (const awt::Rectangle& rUpdateBox)
         PresenterGeometryHelper::ConvertRectangle(mpLayout->maBoundingBox)))
     {
         mpLayout->ForAllVisibleSlides(
-            ::boost::bind(&PresenterSlideSorter::PaintPreview, this, mxCanvas, rUpdateBox, _1));
+            [this, &rUpdateBox] (sal_Int32 const nIndex) {
+                return this->PaintPreview(this->mxCanvas, rUpdateBox, nIndex);
+            });
     }
 
     Reference<rendering::XSpriteCanvas> xSpriteCanvas (mxCanvas, UNO_QUERY);
diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx
index 11661a0..07a1294 100644
--- a/sdext/source/presenter/PresenterTextView.cxx
+++ b/sdext/source/presenter/PresenterTextView.cxx
@@ -36,7 +36,6 @@
 #include <com/sun/star/rendering/CompositeOperation.hpp>
 #include <com/sun/star/rendering/TextDirection.hpp>
 #include <com/sun/star/text/WritingMode2.hpp>
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
@@ -75,7 +74,8 @@ PresenterTextView::PresenterTextView (
       mpFont(),
       maParagraphs(),
       mpCaret(new PresenterTextCaret(
-          ::boost::bind(&PresenterTextView::GetCaretBounds, this, _1, _2),
+          [this] (sal_Int32 const nParagraphIndex, sal_Int32 const nCharacterIndex)
+              { return this->GetCaretBounds(nParagraphIndex, nCharacterIndex); },
           rInvalidator)),
       mnLeftOffset(0),
       mnTopOffset(0),
@@ -1105,7 +1105,7 @@ void PresenterTextCaret::ShowCaret()
     if (mnCaretBlinkTaskId == 0)
     {
         mnCaretBlinkTaskId = PresenterTimer::ScheduleRepeatedTask (
-            ::boost::bind(&PresenterTextCaret::InvertCaret, this),
+            [this] (TimeValue const&) { return this->InvertCaret(); },
             CaretBlinkIntervall,
             CaretBlinkIntervall);
     }
diff --git a/sdext/source/presenter/PresenterTheme.cxx b/sdext/source/presenter/PresenterTheme.cxx
index 5931942..d230347 100644
--- a/sdext/source/presenter/PresenterTheme.cxx
+++ b/sdext/source/presenter/PresenterTheme.cxx
@@ -31,7 +31,6 @@
 #include <com/sun/star/rendering/XBitmap.hpp>
 #include <com/sun/star/util/Color.hpp>
 #include <osl/diagnose.h>
-#include <boost/bind.hpp>
 #include <map>
 
 using namespace ::com::sun::star;
@@ -383,10 +382,11 @@ std::shared_ptr<PresenterConfigurationAccess> PresenterTheme::GetNodeForViewStyl
         "Presenter/Themes/" + mpTheme->msConfigurationNodeName + "/ViewStyles")))
     {
         pConfiguration->GoToChild(
-            ::boost::bind(&PresenterConfigurationAccess::IsStringPropertyEqual,
-                rsStyleName,
-                OUString("StyleName"),
-                _2));
+            [&rsStyleName] (OUString const&, uno::Reference<beans::XPropertySet> const& xProps)
+            {
+                return PresenterConfigurationAccess::IsStringPropertyEqual(
+                        rsStyleName, OUString("StyleName"), xProps);
+            });
     }
     return pConfiguration;
 }
@@ -653,8 +653,10 @@ void PresenterTheme::Theme::Read (
         UNO_QUERY);
     PresenterConfigurationAccess::ForAll(
         xFontNode,
-        ::boost::bind(&PresenterTheme::Theme::ProcessFont,
-            this, ::boost::ref(rReadContext), _1, _2));
+        [this, &rReadContext] (OUString const& rKey, uno::Reference<beans::XPropertySet> const& xProps)
+        {
+            return this->ProcessFont(rReadContext, rKey, xProps);
+        });
 }
 
 SharedPaneStyle PresenterTheme::Theme::GetPaneStyle (const OUString& rsStyleName) const
@@ -863,8 +865,10 @@ void PaneStyleContainer::Read (
         PresenterConfigurationAccess::ForAll(
             xPaneStyleList,
             aProperties,
-            ::boost::bind(&PaneStyleContainer::ProcessPaneStyle,
-                this, ::boost::ref(rReadContext), _1, _2));
+            [this, &rReadContext] (OUString const& rKey, std::vector<uno::Any> const& rValues)
+            {
+                return this->ProcessPaneStyle(rReadContext, rKey, rValues);
+            });
     }
 }
 
@@ -993,8 +997,10 @@ void ViewStyleContainer::Read (
     {
         PresenterConfigurationAccess::ForAll(
             xViewStyleList,
-            ::boost::bind(&ViewStyleContainer::ProcessViewStyle,
-                this, ::boost::ref(rReadContext), _2));
+            [this, &rReadContext] (OUString const&, uno::Reference<beans::XPropertySet> const& xProps)
+            {
+                return this->ProcessViewStyle(rReadContext, xProps);
+            });
     }
 }
 
@@ -1106,8 +1112,10 @@ void StyleAssociationContainer::Read (
         PresenterConfigurationAccess::ForAll(
             xStyleAssociationList,
             aProperties,
-            ::boost::bind(&StyleAssociationContainer::ProcessStyleAssociation,
-                this, ::boost::ref(rReadContext), _1, _2));
+            [this, &rReadContext] (OUString const& rKey, std::vector<uno::Any> const& rValues)
+            {
+                return this->ProcessStyleAssociation(rReadContext, rKey, rValues);
+            });
     }
 }
 
diff --git a/sdext/source/presenter/PresenterTimer.cxx b/sdext/source/presenter/PresenterTimer.cxx
index acb42e2..6f46efd 100644
--- a/sdext/source/presenter/PresenterTimer.cxx
+++ b/sdext/source/presenter/PresenterTimer.cxx
@@ -22,7 +22,7 @@
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <osl/doublecheckedlocking.h>
 #include <osl/thread.hxx>
-#include <boost/bind.hpp>
+
 #include <algorithm>
 #include <iterator>
 #include <memory>
@@ -416,7 +416,7 @@ void PresenterClockTimer::AddListener (const SharedListener& rListener)
     if (mnTimerTaskId==PresenterTimer::NotAValidTaskId)
     {
         mnTimerTaskId = PresenterTimer::ScheduleRepeatedTask(
-            ::boost::bind(&PresenterClockTimer::CheckCurrentTime, this, _1),
+            [this] (TimeValue const& rTime) { return this->CheckCurrentTime(rTime); },
             0,
             250000000 /*ns*/);
     }
diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx
index 99a6642..e8a8512 100644
--- a/sdext/source/presenter/PresenterToolBar.cxx
+++ b/sdext/source/presenter/PresenterToolBar.cxx
@@ -49,7 +49,6 @@
 #include <com/sun/star/util/Color.hpp>
 #include <com/sun/star/util/XURLTransformer.hpp>
 #include <rtl/ustrbuf.hxx>
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -658,7 +657,10 @@ void PresenterToolBar::CreateControls (
         {
             PresenterConfigurationAccess::ForAll(
                 xEntries,
-                ::boost::bind(&PresenterToolBar::ProcessEntry, this, _2, ::boost::ref(aContext)));
+                [this, &aContext] (OUString const&, uno::Reference<beans::XPropertySet> const& xProps)
+                {
+                    return this->ProcessEntry(xProps, aContext);
+                });
         }
     }
 }
diff --git a/sdext/source/presenter/PresenterViewFactory.cxx b/sdext/source/presenter/PresenterViewFactory.cxx
index 75a86f7..544055f 100644
--- a/sdext/source/presenter/PresenterViewFactory.cxx
+++ b/sdext/source/presenter/PresenterViewFactory.cxx
@@ -35,7 +35,6 @@
 #include <com/sun/star/drawing/XSlideSorterBase.hpp>
 #include <com/sun/star/presentation/XSlideShow.hpp>
 #include <com/sun/star/presentation/XSlideShowView.hpp>
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -490,8 +489,11 @@ Reference<XView> PresenterViewFactory::CreateSlideSorterView(
         PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
             mpPresenterController->GetPaneContainer()->FindPaneId(rxViewId->getAnchor()));
         if (pDescriptor.get() != nullptr)
-            pDescriptor->maActivator = ::boost::bind(
-                &PresenterSlideSorter::SetActiveState, _1);
+        {
+            pDescriptor->maActivator = [] (bool const isActive) {
+                    return PresenterSlideSorter::SetActiveState(isActive);
+                };
+        }
         xView = pView.get();
     }
     catch (RuntimeException&)


More information about the Libreoffice-commits mailing list