summaryrefslogtreecommitdiff
path: root/sdext/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-05-11 22:44:08 +0200
committerMichael Stahl <mstahl@redhat.com>2016-05-12 11:08:24 +0200
commit28159e91ba936e9da13bb4e194b34605065e4362 (patch)
treece904353f1ae3bce47804ef2f23c8a6b1c05262c /sdext/source
parent0b8a989aceed4f719924410907ab69d2a0cab989 (diff)
sdext: replace boost::bind with C++11 lambdas, part 2
Change-Id: Ife5fbf7a7a41182de00dca339cba160e3bb0062f
Diffstat (limited to 'sdext/source')
-rw-r--r--sdext/source/presenter/PresenterScrollBar.cxx5
-rw-r--r--sdext/source/presenter/PresenterSlideSorter.cxx7
-rw-r--r--sdext/source/presenter/PresenterTextView.cxx6
-rw-r--r--sdext/source/presenter/PresenterTheme.cxx34
-rw-r--r--sdext/source/presenter/PresenterTimer.cxx4
-rw-r--r--sdext/source/presenter/PresenterToolBar.cxx6
-rw-r--r--sdext/source/presenter/PresenterViewFactory.cxx8
7 files changed, 42 insertions, 28 deletions
diff --git a/sdext/source/presenter/PresenterScrollBar.cxx b/sdext/source/presenter/PresenterScrollBar.cxx
index 3d7de3b9ca82..3ea396653426 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 84c442d2d6f6..8f03f6187ad0 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 11661a07c92a..07a1294cde1d 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 59319421f2b1..d230347dae2b 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 acb42e2c9d26..6f46efd16914 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 99a6642c9a13..e8a8512e1030 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 75a86f7ab8cc..544055f49442 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&)