From c7325f39031cb5c968c88c4efc6f58c0df8e01c7 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 11 May 2016 13:48:42 +0200 Subject: sdext: replace boost::bind with C++11 lambdas Change-Id: I2a30e764b96530e21d5ff201b18f98d1cd334a6d Reviewed-on: https://gerrit.libreoffice.org/24888 Tested-by: Jenkins Reviewed-by: Michael Stahl --- 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(-) (limited to 'sdext') diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx index 2ef842a8f3e0..a340509ce5fc 100644 --- a/sdext/source/presenter/PresenterAccessibility.cxx +++ b/sdext/source/presenter/PresenterAccessibility.cxx @@ -39,7 +39,7 @@ #include #include #include -#include + #include 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 b062f5e11a10..84ea7d47a0f4 100644 --- a/sdext/source/presenter/PresenterBitmapContainer.cxx +++ b/sdext/source/presenter/PresenterBitmapContainer.cxx @@ -26,7 +26,6 @@ #include #include #include -#include 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 const& xProps) + { + this->ProcessBitmap(rKey, xProps); + }); } } catch (Exception&) diff --git a/sdext/source/presenter/PresenterButton.cxx b/sdext/source/presenter/PresenterButton.cxx index 454083ac57aa..f0edc2f52d59 100644 --- a/sdext/source/presenter/PresenterButton.cxx +++ b/sdext/source/presenter/PresenterButton.cxx @@ -29,7 +29,6 @@ #include #include #include -#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -495,10 +494,11 @@ Reference PresenterButton::GetConfigurationProperties ( Reference( aConfiguration.GetConfigurationNode("PresenterScreenSettings/Buttons"), UNO_QUERY), - ::boost::bind(&PresenterConfigurationAccess::IsStringPropertyEqual, - rsConfgurationName, - OUString("Name"), - _2)), + [&rsConfgurationName](OUString const&, uno::Reference 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 9882ce89becc..12dac0864fa1 100644 --- a/sdext/source/presenter/PresenterHelpView.cxx +++ b/sdext/source/presenter/PresenterHelpView.cxx @@ -33,7 +33,6 @@ #include #include #include -#include 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 const& xProps) + { + return this->ProcessString(xProps); + }); } void PresenterHelpView::ProcessString ( diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx index 0c37ee4dd4f0..11b6d9ef8347 100644 --- a/sdext/source/presenter/PresenterNotesView.cxx +++ b/sdext/source/presenter/PresenterNotesView.cxx @@ -40,7 +40,6 @@ #include #include #include -#include 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 5fef2118f60e..a5eb4a21df00 100644 --- a/sdext/source/presenter/PresenterPaintManager.cxx +++ b/sdext/source/presenter/PresenterPaintManager.cxx @@ -22,7 +22,6 @@ #include "PresenterPaneContainer.hxx" #include #include -#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -44,15 +43,10 @@ PresenterPaintManager::PresenterPaintManager ( PresenterPaintManager::GetInvalidator ( const css::uno::Reference& rxWindow) { - return ::boost::bind( - static_cast&, - 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 551e0eada5ad..9be6b39bc4ae 100644 --- a/sdext/source/presenter/PresenterPaneFactory.cxx +++ b/sdext/source/presenter/PresenterPaneFactory.cxx @@ -30,7 +30,6 @@ #include #include #include -#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -298,9 +297,8 @@ Reference PresenterPaneFactory::CreatePane ( { if (bIsSpritePane) { - pDescriptor->maSpriteProvider = ::boost::bind( - &PresenterSpritePane::GetSprite, - dynamic_cast(xPane.get())); + auto const pPane(dynamic_cast(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 098bcd58d14f..52c78316df86 100644 --- a/sdext/source/presenter/PresenterScreen.cxx +++ b/sdext/source/presenter/PresenterScreen.cxx @@ -36,7 +36,6 @@ #include #include #include -#include #include #include @@ -586,7 +585,7 @@ void PresenterScreen::RequestShutdownPresenterScreen() rtl::Reference 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 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 const& rArgs) + { + return this->ProcessViewDescription(rString, rArgs); + }); } catch (const RuntimeException&) { -- cgit