diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-02-19 14:34:44 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-02-19 14:55:50 +0100 |
commit | 26912eea7521dd2b84bfac56b322cf0f8b142450 (patch) | |
tree | 0d0268375b3ac3c85ae4dd7f1ee1e847cc707ef3 | |
parent | db98187505c4eb95c0f815ee2646334b08445e21 (diff) |
sd: replace boost::bind with C++11 lambdas and for loops
Change-Id: I4de92df1848a1c00e71d4cdb5638b73c3b76f282
4 files changed, 14 insertions, 28 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsAnimator.cxx b/sd/source/ui/slidesorter/controller/SlsAnimator.cxx index a4c6734fc5f4..2dd7db85bf08 100644 --- a/sd/source/ui/slidesorter/controller/SlsAnimator.cxx +++ b/sd/source/ui/slidesorter/controller/SlsAnimator.cxx @@ -20,7 +20,6 @@ #include "controller/SlsAnimator.hxx" #include "view/SlideSorterView.hxx" #include "View.hxx" -#include <boost/bind.hpp> namespace sd { namespace slidesorter { namespace controller { @@ -132,10 +131,8 @@ void Animator::RemoveAnimation (const Animator::AnimationId nId) const AnimationList::iterator iAnimation (::std::find_if( maAnimations.begin(), maAnimations.end(), - ::boost::bind( - ::std::equal_to<Animator::AnimationId>(), - nId, - ::boost::bind(&Animation::mnAnimationId, _1)))); + [nId] (std::shared_ptr<Animation> const& pAnim) + { return nId == pAnim->mnAnimationId; })); if (iAnimation != maAnimations.end()) { OSL_ASSERT((*iAnimation)->mnAnimationId == nId); @@ -156,12 +153,10 @@ void Animator::RemoveAnimation (const Animator::AnimationId nId) void Animator::RemoveAllAnimations() { - ::std::for_each( - maAnimations.begin(), - maAnimations.end(), - ::boost::bind( - &Animation::Expire, - _1)); + for (auto const& it : maAnimations) + { + it->Expire(); + } maAnimations.clear(); mnNextAnimationId = 0; diff --git a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx index e6068f5ad218..49127da5787f 100644 --- a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx +++ b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx @@ -36,7 +36,6 @@ #include "app.hrc" #include "sdtreelb.hxx" #include <sfx2/bindings.hxx> -#include <boost/bind.hpp> namespace sd { namespace slidesorter { namespace controller { @@ -95,8 +94,9 @@ void DragAndDropContext::UpdatePosition ( bool bDoAutoScroll = bAllowAutoScroll && mpTargetSlideSorter->GetController().GetScrollBarManager().AutoScroll( rMousePosition, - ::boost::bind( - &DragAndDropContext::UpdatePosition, this, rMousePosition, eMode, false)); + [this, eMode, &rMousePosition] () { + return this->UpdatePosition(rMousePosition, eMode, false); + }); if (!bDoAutoScroll) { diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index 97582146ed61..6c2396e93a5e 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -62,7 +62,6 @@ #include <svx/svdpagv.hxx> #include <vcl/msgbox.hxx> #include <svx/svxids.hrc> -#include <boost/bind.hpp> #include <boost/optional.hpp> namespace { @@ -1386,11 +1385,7 @@ void MultiSelectionModeHandler::UpdatePosition ( bool bDoAutoScroll = bAllowAutoScroll && mrSlideSorter.GetController().GetScrollBarManager().AutoScroll( rMousePosition, - ::boost::bind( - &MultiSelectionModeHandler::UpdatePosition, - this, - rMousePosition, - false)); + [this, &rMousePosition] () { return this->UpdatePosition(rMousePosition, false); }); if (!bDoAutoScroll) UpdateModelPosition(aMouseModelPosition); diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 0a2a382e8276..a839bdca04c3 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -87,7 +87,6 @@ #include <com/sun/star/drawing/XDrawPages.hpp> #include <vcl/svapp.hxx> -#include <boost/bind.hpp> #include <memory> using namespace ::com::sun::star; @@ -1137,13 +1136,10 @@ void SlotManager::DuplicateSelectedSlides (SfxRequest& rRequest) // Set the selection to the pages in aPagesToSelect. PageSelector& rSelector (mrSlideSorter.GetController().GetPageSelector()); rSelector.DeselectAllPages(); - ::std::for_each ( - aPagesToSelect.begin(), - aPagesToSelect.end(), - ::boost::bind( - static_cast<void (PageSelector::*)(const SdPage*)>(&PageSelector::SelectPage), - ::boost::ref(rSelector), - _1)); + for (auto const& it: aPagesToSelect) + { + rSelector.SelectPage(it); + } } void SlotManager::ChangeSlideExclusionState ( |