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

Michael Stahl mstahl at redhat.com
Wed May 11 19:22:14 UTC 2016


 sdext/source/presenter/PresenterAccessibility.cxx   |    7 ++++---
 sdext/source/presenter/PresenterBitmapContainer.cxx |    6 ++++--
 sdext/source/presenter/PresenterButton.cxx          |   10 +++++-----
 sdext/source/presenter/PresenterHelpView.cxx        |    6 ++++--
 sdext/source/presenter/PresenterNotesView.cxx       |    3 +--
 sdext/source/presenter/PresenterPaintManager.cxx    |   14 ++++----------
 sdext/source/presenter/PresenterPaneFactory.cxx     |    6 ++----
 sdext/source/presenter/PresenterScreen.cxx          |   17 +++++++++--------
 8 files changed, 33 insertions(+), 36 deletions(-)

New commits:
commit c7325f39031cb5c968c88c4efc6f58c0df8e01c7
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 11 13:48:42 2016 +0200

    sdext: replace boost::bind with C++11 lambdas
    
    Change-Id: I2a30e764b96530e21d5ff201b18f98d1cd334a6d
    Reviewed-on: https://gerrit.libreoffice.org/24888
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx
index 2ef842a..a340509 100644
--- a/sdext/source/presenter/PresenterAccessibility.cxx
+++ b/sdext/source/presenter/PresenterAccessibility.cxx
@@ -39,7 +39,7 @@
 #include <com/sun/star/drawing/framework/XView.hpp>
 #include <cppuhelper/compbase.hxx>
 #include <cppuhelper/implbase.hxx>
-#include <boost/bind.hpp>
+
 #include <algorithm>
 
 using namespace ::com::sun::star;
@@ -1915,9 +1915,10 @@ void AccessibleNotes::SetTextView (
         // events and handles text changes.  Register the corresponding
         // listeners here.
         mpTextView->GetCaret()->SetCaretMotionBroadcaster(
-            ::boost::bind(&AccessibleNotes::NotifyCaretChange, this, _1, _2, _3, _4));
+            [this](sal_Int32 a, sal_Int32 b, sal_Int32 c, sal_Int32 d)
+                { return this->NotifyCaretChange(a, b, c, d); });
         mpTextView->SetTextChangeBroadcaster(
-            ::boost::bind(&AccessibleNotes::HandleTextChange, this));
+            [this]() { return this->HandleTextChange(); });
     }
 }
 
diff --git a/sdext/source/presenter/PresenterBitmapContainer.cxx b/sdext/source/presenter/PresenterBitmapContainer.cxx
index b062f5e..84ea7d4 100644
--- a/sdext/source/presenter/PresenterBitmapContainer.cxx
+++ b/sdext/source/presenter/PresenterBitmapContainer.cxx
@@ -26,7 +26,6 @@
 #include <com/sun/star/rendering/CompositeOperation.hpp>
 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
 #include <osl/diagnose.h>
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -129,7 +128,10 @@ void PresenterBitmapContainer::LoadBitmaps (
         {
             PresenterConfigurationAccess::ForAll(
                 rxBitmapList,
-                ::boost::bind(&PresenterBitmapContainer::ProcessBitmap, this, _1, _2));
+                [this](OUString const& rKey, Reference<beans::XPropertySet> const& xProps)
+                {
+                    this->ProcessBitmap(rKey, xProps);
+                });
         }
     }
     catch (Exception&)
diff --git a/sdext/source/presenter/PresenterButton.cxx b/sdext/source/presenter/PresenterButton.cxx
index 454083a..f0edc2f 100644
--- a/sdext/source/presenter/PresenterButton.cxx
+++ b/sdext/source/presenter/PresenterButton.cxx
@@ -29,7 +29,6 @@
 #include <com/sun/star/drawing/XPresenterHelper.hpp>
 #include <com/sun/star/rendering/CompositeOperation.hpp>
 #include <com/sun/star/rendering/TextDirection.hpp>
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -495,10 +494,11 @@ Reference<beans::XPropertySet> PresenterButton::GetConfigurationProperties (
             Reference<container::XNameAccess>(
                 aConfiguration.GetConfigurationNode("PresenterScreenSettings/Buttons"),
                 UNO_QUERY),
-            ::boost::bind(&PresenterConfigurationAccess::IsStringPropertyEqual,
-                rsConfgurationName,
-                OUString("Name"),
-                _2)),
+            [&rsConfgurationName](OUString const&, uno::Reference<beans::XPropertySet> const& xProps) -> bool
+            {
+                return PresenterConfigurationAccess::IsStringPropertyEqual(
+                        rsConfgurationName, OUString("Name"), xProps);
+            }),
         UNO_QUERY);
 }
 
diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx
index 9882ce8..12dac08 100644
--- a/sdext/source/presenter/PresenterHelpView.cxx
+++ b/sdext/source/presenter/PresenterHelpView.cxx
@@ -33,7 +33,6 @@
 #include <com/sun/star/util/Color.hpp>
 #include <algorithm>
 #include <vector>
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -366,7 +365,10 @@ void PresenterHelpView::ReadHelpStrings()
         UNO_QUERY);
     PresenterConfigurationAccess::ForAll(
         xStrings,
-        ::boost::bind(&PresenterHelpView::ProcessString, this, _2));
+        [this](OUString const&, uno::Reference<beans::XPropertySet> const& xProps)
+        {
+            return this->ProcessString(xProps);
+        });
 }
 
 void PresenterHelpView::ProcessString (
diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx
index 0c37ee4..11b6d9e 100644
--- a/sdext/source/presenter/PresenterNotesView.cxx
+++ b/sdext/source/presenter/PresenterNotesView.cxx
@@ -40,7 +40,6 @@
 #include <com/sun/star/text/XTextRange.hpp>
 #include <com/sun/star/util/XChangesBatch.hpp>
 #include <com/sun/star/container/XChild.hpp>
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -118,7 +117,7 @@ PresenterNotesView::PresenterNotesView (
             rxComponentContext,
             mxParentWindow,
             mpPresenterController->GetPaintManager(),
-            ::boost::bind(&PresenterNotesView::SetTop, this, _1));
+            [this](double f) { return this->SetTop(f); });
         mpScrollBar->SetBackground(
             mpPresenterController->GetViewBackground(mxViewId->getResourceURL()));
 
diff --git a/sdext/source/presenter/PresenterPaintManager.cxx b/sdext/source/presenter/PresenterPaintManager.cxx
index 5fef211..a5eb4a2 100644
--- a/sdext/source/presenter/PresenterPaintManager.cxx
+++ b/sdext/source/presenter/PresenterPaintManager.cxx
@@ -22,7 +22,6 @@
 #include "PresenterPaneContainer.hxx"
 #include <com/sun/star/awt/InvalidateStyle.hpp>
 #include <com/sun/star/awt/XWindowPeer.hpp>
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -44,15 +43,10 @@ PresenterPaintManager::PresenterPaintManager (
     PresenterPaintManager::GetInvalidator (
         const css::uno::Reference<css::awt::XWindow>& rxWindow)
 {
-    return ::boost::bind(
-        static_cast<void (PresenterPaintManager::*)(
-            const css::uno::Reference<css::awt::XWindow>&,
-            const css::awt::Rectangle&,
-            const bool)>(&PresenterPaintManager::Invalidate),
-        this,
-        rxWindow,
-        _1,
-        false/*bSynchronous*/);
+    return [this, rxWindow] (css::awt::Rectangle const& rRepaintBox)
+            {
+                return this->Invalidate(rxWindow, rRepaintBox, false/*bSynchronous*/);
+            };
 }
 
 void PresenterPaintManager::Invalidate (
diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx
index 551e0ea..9be6b39 100644
--- a/sdext/source/presenter/PresenterPaneFactory.cxx
+++ b/sdext/source/presenter/PresenterPaneFactory.cxx
@@ -30,7 +30,6 @@
 #include <com/sun/star/frame/XController.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -298,9 +297,8 @@ Reference<XResource> PresenterPaneFactory::CreatePane (
     {
         if (bIsSpritePane)
         {
-            pDescriptor->maSpriteProvider = ::boost::bind(
-                &PresenterSpritePane::GetSprite,
-                dynamic_cast<PresenterSpritePane*>(xPane.get()));
+            auto const pPane(dynamic_cast<PresenterSpritePane*>(xPane.get()));
+            pDescriptor->maSpriteProvider = [pPane](){ return pPane->GetSprite(); };
             pDescriptor->mbIsSprite = true;
             pDescriptor->mbNeedsClipping = false;
         }
diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx
index 098bcd5..52c7831 100644
--- a/sdext/source/presenter/PresenterScreen.cxx
+++ b/sdext/source/presenter/PresenterScreen.cxx
@@ -36,7 +36,6 @@
 #include <com/sun/star/presentation/XPresentation2.hpp>
 #include <com/sun/star/presentation/XPresentationSupplier.hpp>
 #include <com/sun/star/document/XEventBroadcaster.hpp>
-#include <boost/bind.hpp>
 #include <cppuhelper/compbase.hxx>
 
 #include <com/sun/star/view/XSelectionSupplier.hpp>
@@ -586,7 +585,7 @@ void PresenterScreen::RequestShutdownPresenterScreen()
         rtl::Reference<PresenterScreen> pSelf (this);
         PresenterFrameworkObserver::RunOnUpdateEnd(
             xCC,
-            ::boost::bind(&PresenterScreen::ShutdownPresenterScreen, pSelf));
+            [pSelf](bool){ return pSelf->ShutdownPresenterScreen(); });
         xCC->update();
     }
 }
@@ -708,11 +707,10 @@ void PresenterScreen::ProcessLayout (
         PresenterConfigurationAccess::ForAll(
             xList,
             aProperties,
-            ::boost::bind(&PresenterScreen::ProcessComponent, this,
-                _1,
-                _2,
-                rxContext,
-                rxAnchorId));
+            [this, rxContext, rxAnchorId](OUString const& rString, std::vector<uno::Any> const& rArgs)
+            {
+                this->ProcessComponent(rString, rArgs, rxContext, rxAnchorId);
+            });
     }
     catch (const RuntimeException&)
     {
@@ -737,7 +735,10 @@ void PresenterScreen::ProcessViewDescriptions (
         PresenterConfigurationAccess::ForAll(
             xViewDescriptionsNode,
             aProperties,
-            ::boost::bind(&PresenterScreen::ProcessViewDescription, this, _1, _2));
+            [this](OUString const& rString, std::vector<uno::Any> const& rArgs)
+            {
+                return this->ProcessViewDescription(rString, rArgs);
+            });
     }
     catch (const RuntimeException&)
     {


More information about the Libreoffice-commits mailing list