sdext: replace boost::bind with C++11 lambdas, part 2

Change-Id: Ife5fbf7a7a41182de00dca339cba160e3bb0062f
This commit is contained in:
Michael Stahl
2016-05-11 22:44:08 +02:00
parent 0b8a989ace
commit 28159e91ba
8 changed files with 42 additions and 29 deletions

View File

@@ -40,7 +40,6 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include <boost/bind.hpp>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <osl/doublecheckedlocking.h> #include <osl/doublecheckedlocking.h>
#include <osl/getglobalmutex.hxx> #include <osl/getglobalmutex.hxx>

View File

@@ -31,7 +31,7 @@
#include <com/sun/star/rendering/CompositeOperation.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp>
#include <com/sun/star/rendering/TexturingMode.hpp> #include <com/sun/star/rendering/TexturingMode.hpp>
#include <com/sun/star/rendering/XPolyPolygon2D.hpp> #include <com/sun/star/rendering/XPolyPolygon2D.hpp>
#include <boost/bind.hpp>
#include <algorithm> #include <algorithm>
#include <memory> #include <memory>
#include <math.h> #include <math.h>
@@ -809,8 +809,9 @@ void PresenterScrollBar::MousePressRepeater::Start (const PresenterScrollBar::Ar
Execute(); Execute();
// Schedule repeated executions. // Schedule repeated executions.
auto pThis(shared_from_this());
mnMousePressRepeaterTaskId = PresenterTimer::ScheduleRepeatedTask ( mnMousePressRepeaterTaskId = PresenterTimer::ScheduleRepeatedTask (
::boost::bind(&PresenterScrollBar::MousePressRepeater::Callback, shared_from_this(), _1), [pThis] (TimeValue const& rTime) { return pThis->Callback(rTime); },
500000000, 500000000,
250000000); 250000000);
} }

View File

@@ -44,7 +44,6 @@
#include <com/sun/star/util/Color.hpp> #include <com/sun/star/util/Color.hpp>
#include <algorithm> #include <algorithm>
#include <math.h> #include <math.h>
#include <boost/bind.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
@@ -303,7 +302,7 @@ PresenterSlideSorter::PresenterSlideSorter (
rxContext, rxContext,
mxWindow, mxWindow,
mpPresenterController->GetPaintManager(), mpPresenterController->GetPaintManager(),
::boost::bind(&PresenterSlideSorter::SetVerticalOffset,this,_1))); [this] (double const offset) { return this->SetVerticalOffset(offset); }));
mpCloseButton = PresenterButton::Create( mpCloseButton = PresenterButton::Create(
rxContext, rxContext,
@@ -1052,7 +1051,9 @@ void PresenterSlideSorter::Paint (const awt::Rectangle& rUpdateBox)
PresenterGeometryHelper::ConvertRectangle(mpLayout->maBoundingBox))) PresenterGeometryHelper::ConvertRectangle(mpLayout->maBoundingBox)))
{ {
mpLayout->ForAllVisibleSlides( 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); Reference<rendering::XSpriteCanvas> xSpriteCanvas (mxCanvas, UNO_QUERY);

View File

@@ -36,7 +36,6 @@
#include <com/sun/star/rendering/CompositeOperation.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp>
#include <com/sun/star/rendering/TextDirection.hpp> #include <com/sun/star/rendering/TextDirection.hpp>
#include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/text/WritingMode2.hpp>
#include <boost/bind.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility; using namespace ::com::sun::star::accessibility;
@@ -75,7 +74,8 @@ PresenterTextView::PresenterTextView (
mpFont(), mpFont(),
maParagraphs(), maParagraphs(),
mpCaret(new PresenterTextCaret( 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)), rInvalidator)),
mnLeftOffset(0), mnLeftOffset(0),
mnTopOffset(0), mnTopOffset(0),
@@ -1105,7 +1105,7 @@ void PresenterTextCaret::ShowCaret()
if (mnCaretBlinkTaskId == 0) if (mnCaretBlinkTaskId == 0)
{ {
mnCaretBlinkTaskId = PresenterTimer::ScheduleRepeatedTask ( mnCaretBlinkTaskId = PresenterTimer::ScheduleRepeatedTask (
::boost::bind(&PresenterTextCaret::InvertCaret, this), [this] (TimeValue const&) { return this->InvertCaret(); },
CaretBlinkIntervall, CaretBlinkIntervall,
CaretBlinkIntervall); CaretBlinkIntervall);
} }

View File

@@ -31,7 +31,6 @@
#include <com/sun/star/rendering/XBitmap.hpp> #include <com/sun/star/rendering/XBitmap.hpp>
#include <com/sun/star/util/Color.hpp> #include <com/sun/star/util/Color.hpp>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <boost/bind.hpp>
#include <map> #include <map>
using namespace ::com::sun::star; using namespace ::com::sun::star;
@@ -383,10 +382,11 @@ std::shared_ptr<PresenterConfigurationAccess> PresenterTheme::GetNodeForViewStyl
"Presenter/Themes/" + mpTheme->msConfigurationNodeName + "/ViewStyles"))) "Presenter/Themes/" + mpTheme->msConfigurationNodeName + "/ViewStyles")))
{ {
pConfiguration->GoToChild( pConfiguration->GoToChild(
::boost::bind(&PresenterConfigurationAccess::IsStringPropertyEqual, [&rsStyleName] (OUString const&, uno::Reference<beans::XPropertySet> const& xProps)
rsStyleName, {
OUString("StyleName"), return PresenterConfigurationAccess::IsStringPropertyEqual(
_2)); rsStyleName, OUString("StyleName"), xProps);
});
} }
return pConfiguration; return pConfiguration;
} }
@@ -653,8 +653,10 @@ void PresenterTheme::Theme::Read (
UNO_QUERY); UNO_QUERY);
PresenterConfigurationAccess::ForAll( PresenterConfigurationAccess::ForAll(
xFontNode, xFontNode,
::boost::bind(&PresenterTheme::Theme::ProcessFont, [this, &rReadContext] (OUString const& rKey, uno::Reference<beans::XPropertySet> const& xProps)
this, ::boost::ref(rReadContext), _1, _2)); {
return this->ProcessFont(rReadContext, rKey, xProps);
});
} }
SharedPaneStyle PresenterTheme::Theme::GetPaneStyle (const OUString& rsStyleName) const SharedPaneStyle PresenterTheme::Theme::GetPaneStyle (const OUString& rsStyleName) const
@@ -863,8 +865,10 @@ void PaneStyleContainer::Read (
PresenterConfigurationAccess::ForAll( PresenterConfigurationAccess::ForAll(
xPaneStyleList, xPaneStyleList,
aProperties, aProperties,
::boost::bind(&PaneStyleContainer::ProcessPaneStyle, [this, &rReadContext] (OUString const& rKey, std::vector<uno::Any> const& rValues)
this, ::boost::ref(rReadContext), _1, _2)); {
return this->ProcessPaneStyle(rReadContext, rKey, rValues);
});
} }
} }
@@ -993,8 +997,10 @@ void ViewStyleContainer::Read (
{ {
PresenterConfigurationAccess::ForAll( PresenterConfigurationAccess::ForAll(
xViewStyleList, xViewStyleList,
::boost::bind(&ViewStyleContainer::ProcessViewStyle, [this, &rReadContext] (OUString const&, uno::Reference<beans::XPropertySet> const& xProps)
this, ::boost::ref(rReadContext), _2)); {
return this->ProcessViewStyle(rReadContext, xProps);
});
} }
} }
@@ -1106,8 +1112,10 @@ void StyleAssociationContainer::Read (
PresenterConfigurationAccess::ForAll( PresenterConfigurationAccess::ForAll(
xStyleAssociationList, xStyleAssociationList,
aProperties, aProperties,
::boost::bind(&StyleAssociationContainer::ProcessStyleAssociation, [this, &rReadContext] (OUString const& rKey, std::vector<uno::Any> const& rValues)
this, ::boost::ref(rReadContext), _1, _2)); {
return this->ProcessStyleAssociation(rReadContext, rKey, rValues);
});
} }
} }

View File

@@ -22,7 +22,7 @@
#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/XComponentContext.hpp>
#include <osl/doublecheckedlocking.h> #include <osl/doublecheckedlocking.h>
#include <osl/thread.hxx> #include <osl/thread.hxx>
#include <boost/bind.hpp>
#include <algorithm> #include <algorithm>
#include <iterator> #include <iterator>
#include <memory> #include <memory>
@@ -416,7 +416,7 @@ void PresenterClockTimer::AddListener (const SharedListener& rListener)
if (mnTimerTaskId==PresenterTimer::NotAValidTaskId) if (mnTimerTaskId==PresenterTimer::NotAValidTaskId)
{ {
mnTimerTaskId = PresenterTimer::ScheduleRepeatedTask( mnTimerTaskId = PresenterTimer::ScheduleRepeatedTask(
::boost::bind(&PresenterClockTimer::CheckCurrentTime, this, _1), [this] (TimeValue const& rTime) { return this->CheckCurrentTime(rTime); },
0, 0,
250000000 /*ns*/); 250000000 /*ns*/);
} }

View File

@@ -49,7 +49,6 @@
#include <com/sun/star/util/Color.hpp> #include <com/sun/star/util/Color.hpp>
#include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp>
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
#include <boost/bind.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
@@ -658,7 +657,10 @@ void PresenterToolBar::CreateControls (
{ {
PresenterConfigurationAccess::ForAll( PresenterConfigurationAccess::ForAll(
xEntries, 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);
});
} }
} }
} }

View File

@@ -35,7 +35,6 @@
#include <com/sun/star/drawing/XSlideSorterBase.hpp> #include <com/sun/star/drawing/XSlideSorterBase.hpp>
#include <com/sun/star/presentation/XSlideShow.hpp> #include <com/sun/star/presentation/XSlideShow.hpp>
#include <com/sun/star/presentation/XSlideShowView.hpp> #include <com/sun/star/presentation/XSlideShowView.hpp>
#include <boost/bind.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
@@ -490,8 +489,11 @@ Reference<XView> PresenterViewFactory::CreateSlideSorterView(
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPresenterController->GetPaneContainer()->FindPaneId(rxViewId->getAnchor())); mpPresenterController->GetPaneContainer()->FindPaneId(rxViewId->getAnchor()));
if (pDescriptor.get() != nullptr) if (pDescriptor.get() != nullptr)
pDescriptor->maActivator = ::boost::bind( {
&PresenterSlideSorter::SetActiveState, _1); pDescriptor->maActivator = [] (bool const isActive) {
return PresenterSlideSorter::SetActiveState(isActive);
};
}
xView = pView.get(); xView = pView.get();
} }
catch (RuntimeException&) catch (RuntimeException&)