Kaydet (Commit) 5088ee99 authored tarafından Michael Stahl's avatar Michael Stahl

sd: replace boost::function with std::function

Change-Id: If70426d6d93a8c3b7c585b1c69e9b1c58643d140
üst 902d61bc
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
#include <basic/sbx.hxx> #include <basic/sbx.hxx>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
#include <boost/function.hpp>
#include <boost/limits.hpp> #include <boost/limits.hpp>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
#include <boost/function.hpp>
#include <functional>
#include <map> #include <map>
namespace sd { namespace sd {
...@@ -146,11 +147,11 @@ public: ...@@ -146,11 +147,11 @@ public:
static ::boost::shared_ptr<ViewShell> GetViewShell ( static ::boost::shared_ptr<ViewShell> GetViewShell (
const css::uno::Reference<css::drawing::framework::XView>& rxView); const css::uno::Reference<css::drawing::framework::XView>& rxView);
typedef ::boost::function<bool(const css::drawing::framework::ConfigurationChangeEvent&)> typedef ::std::function<bool (const css::drawing::framework::ConfigurationChangeEvent&)>
ConfigurationChangeEventFilter; ConfigurationChangeEventFilter;
typedef ::boost::function<void(bool bEventSeen)> Callback; typedef ::std::function<void (bool bEventSeen)> Callback;
typedef ::boost::function< typedef ::std::function<
void( void (
const css::uno::Reference< const css::uno::Reference<
css::drawing::framework::XResourceId>&) css::drawing::framework::XResourceId>&)
> ResourceFunctor; > ResourceFunctor;
......
...@@ -81,7 +81,7 @@ class SdNavigatorWin ...@@ -81,7 +81,7 @@ class SdNavigatorWin
: public vcl::Window : public vcl::Window
{ {
public: public:
typedef ::boost::function<void()> UpdateRequestFunctor; typedef ::std::function<void ()> UpdateRequestFunctor;
/** Create a new instance of the navigator. /** Create a new instance of the navigator.
@param bUseActiveUpdate @param bUseActiveUpdate
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "sdxfer.hxx" #include "sdxfer.hxx"
#include <vector> #include <vector>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <boost/function.hpp>
class SdDrawDocument; class SdDrawDocument;
class SfxMedium; class SfxMedium;
......
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
#define INCLUDED_SD_SOURCE_UI_INC_TOOLS_ASYNCHRONOUSCALL_HXX #define INCLUDED_SD_SOURCE_UI_INC_TOOLS_ASYNCHRONOUSCALL_HXX
#include <vcl/timer.hxx> #include <vcl/timer.hxx>
#include <memory> #include <memory>
#include <boost/function.hpp> #include <functional>
namespace sd { namespace tools { namespace sd { namespace tools {
...@@ -63,7 +64,7 @@ public: ...@@ -63,7 +64,7 @@ public:
The timeout in milliseconds until the function object is The timeout in milliseconds until the function object is
executed. executed.
*/ */
typedef ::boost::function0<void> AsynchronousFunction; typedef ::std::function<void ()> AsynchronousFunction;
void Post ( void Post (
const AsynchronousFunction& rFunction, const AsynchronousFunction& rFunction,
sal_uInt32 nTimeoutInMilliseconds=10); sal_uInt32 nTimeoutInMilliseconds=10);
......
...@@ -25,8 +25,9 @@ ...@@ -25,8 +25,9 @@
#include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <vector> #include <vector>
#include <boost/function.hpp> #include <functional>
namespace sd { namespace tools { namespace sd { namespace tools {
...@@ -91,7 +92,7 @@ public: ...@@ -91,7 +92,7 @@ public:
parameters are the name of key item (often of no further interest) parameters are the name of key item (often of no further interest)
and the value of the item. and the value of the item.
*/ */
typedef ::boost::function<void( typedef ::std::function<void (
const OUString&, const OUString&,
const std::vector<css::uno::Any>&) > Functor; const std::vector<css::uno::Any>&) > Functor;
......
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
#include <svx/svdpagv.hxx> #include <svx/svdpagv.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/timer.hxx> #include <vcl/timer.hxx>
#include <boost/function.hpp>
#include <functional>
namespace sd { namespace slidesorter { namespace view { namespace sd { namespace slidesorter { namespace view {
class SlideSorterView; class SlideSorterView;
...@@ -51,7 +52,7 @@ class RequestQueue; ...@@ -51,7 +52,7 @@ class RequestQueue;
class QueueProcessor class QueueProcessor
{ {
public: public:
typedef ::boost::function<bool()> IdleDetectionCallback; typedef ::std::function<bool ()> IdleDetectionCallback;
QueueProcessor ( QueueProcessor (
RequestQueue& rQueue, RequestQueue& rQueue,
const ::boost::shared_ptr<BitmapCache>& rpCache, const ::boost::shared_ptr<BitmapCache>& rpCache,
......
...@@ -501,7 +501,7 @@ void ScrollBarManager::CalcAutoScrollOffset (const Point& rMouseWindowPosition) ...@@ -501,7 +501,7 @@ void ScrollBarManager::CalcAutoScrollOffset (const Point& rMouseWindowPosition)
bool ScrollBarManager::AutoScroll ( bool ScrollBarManager::AutoScroll (
const Point& rMouseWindowPosition, const Point& rMouseWindowPosition,
const ::boost::function<void()>& rAutoScrollFunctor) const ::std::function<void ()>& rAutoScrollFunctor)
{ {
maAutoScrollFunctor = rAutoScrollFunctor; maAutoScrollFunctor = rAutoScrollFunctor;
CalcAutoScrollOffset(rMouseWindowPosition); CalcAutoScrollOffset(rMouseWindowPosition);
...@@ -546,7 +546,7 @@ bool ScrollBarManager::RepeatAutoScroll() ...@@ -546,7 +546,7 @@ bool ScrollBarManager::RepeatAutoScroll()
void ScrollBarManager::clearAutoScrollFunctor() void ScrollBarManager::clearAutoScrollFunctor()
{ {
maAutoScrollFunctor = ::boost::function<void()>(); maAutoScrollFunctor = ::std::function<void ()>();
} }
IMPL_LINK_NOARG_TYPED(ScrollBarManager, AutoScrollTimeoutHandler, Timer *, void) IMPL_LINK_NOARG_TYPED(ScrollBarManager, AutoScrollTimeoutHandler, Timer *, void)
......
...@@ -43,7 +43,7 @@ namespace { ...@@ -43,7 +43,7 @@ namespace {
SlideSorter& mrSlideSorter; SlideSorter& mrSlideSorter;
Point maStart; Point maStart;
const Point maEnd; const Point maEnd;
const ::boost::function<double(double)> maAccelerationFunction; const ::std::function<double (double)> maAccelerationFunction;
}; };
} // end of anonymous namespace } // end of anonymous namespace
......
...@@ -22,8 +22,10 @@ ...@@ -22,8 +22,10 @@
#include "model/SlsSharedPageDescriptor.hxx" #include "model/SlsSharedPageDescriptor.hxx"
#include <basegfx/point/b2dpoint.hxx> #include <basegfx/point/b2dpoint.hxx>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <boost/function.hpp>
#include <functional>
#include <vector> #include <vector>
namespace sd { namespace slidesorter { namespace view { namespace sd { namespace slidesorter { namespace view {
...@@ -65,7 +67,7 @@ private: ...@@ -65,7 +67,7 @@ private:
class AnimationParametricFunction class AnimationParametricFunction
{ {
public: public:
typedef ::boost::function<basegfx::B2DPoint(double)> ParametricFunction; typedef ::std::function<basegfx::B2DPoint (double)> ParametricFunction;
AnimationParametricFunction (const ParametricFunction& rFunction); AnimationParametricFunction (const ParametricFunction& rFunction);
double operator() (const double nX); double operator() (const double nX);
......
...@@ -26,12 +26,14 @@ ...@@ -26,12 +26,14 @@
#include <vcl/timer.hxx> #include <vcl/timer.hxx>
#include <vcl/idle.hxx> #include <vcl/idle.hxx>
#include <sal/types.h> #include <sal/types.h>
#include <vector>
#include <boost/function.hpp>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <functional>
#include <vector>
namespace sd { namespace slidesorter { namespace controller { namespace sd { namespace slidesorter { namespace controller {
/** Experimental class for simple eye candy animations. /** Experimental class for simple eye candy animations.
...@@ -57,8 +59,8 @@ public: ...@@ -57,8 +59,8 @@ public:
/** An animation object is called with values between 0 and 1 as single /** An animation object is called with values between 0 and 1 as single
argument to its operator() method. argument to its operator() method.
*/ */
typedef ::boost::function1<void, double> AnimationFunctor; typedef ::std::function<void (double)> AnimationFunctor;
typedef ::boost::function0<void> FinishFunctor; typedef ::std::function<void ()> FinishFunctor;
typedef sal_Int32 AnimationId; typedef sal_Int32 AnimationId;
static const AnimationId NotAnAnimationId = -1; static const AnimationId NotAnAnimationId = -1;
......
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
#include <tools/link.hxx> #include <tools/link.hxx>
#include <tools/gen.hxx> #include <tools/gen.hxx>
#include <vcl/timer.hxx> #include <vcl/timer.hxx>
#include <boost/function.hpp>
#include <functional>
class ScrollBar; class ScrollBar;
class ScrollBarBox; class ScrollBarBox;
...@@ -144,7 +145,7 @@ public: ...@@ -144,7 +145,7 @@ public:
*/ */
bool AutoScroll ( bool AutoScroll (
const Point& rMouseWindowPosition, const Point& rMouseWindowPosition,
const ::boost::function<void()>& rAutoScrollFunctor); const ::std::function<void ()>& rAutoScrollFunctor);
void StopAutoScroll(); void StopAutoScroll();
...@@ -207,7 +208,7 @@ private: ...@@ -207,7 +208,7 @@ private:
*/ */
VclPtr<sd::Window> mpContentWindow; VclPtr<sd::Window> mpContentWindow;
::boost::function<void()> maAutoScrollFunctor; ::std::function<void ()> maAutoScrollFunctor;
void SetWindowOrigin ( void SetWindowOrigin (
double nHorizontalPosition, double nHorizontalPosition,
......
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
#define INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_CONTROLLER_SLSTRANSFERABLEDATA_HXX #define INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_CONTROLLER_SLSTRANSFERABLEDATA_HXX
#include "sdxfer.hxx" #include "sdxfer.hxx"
#include <boost/function.hpp>
#include <vector> #include <vector>
#include <functional>
class SdDrawDocument; class SdDrawDocument;
namespace sd { namespace slidesorter { namespace sd { namespace slidesorter {
...@@ -78,7 +79,7 @@ public: ...@@ -78,7 +79,7 @@ public:
private: private:
SlideSorterViewShell* mpViewShell; SlideSorterViewShell* mpViewShell;
const ::std::vector<Representative> maRepresentatives; const ::std::vector<Representative> maRepresentatives;
typedef ::std::vector<boost::function<void(sal_uInt8)> > CallbackContainer; typedef ::std::vector<std::function<void (sal_uInt8)> > CallbackContainer;
virtual void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) SAL_OVERRIDE; virtual void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) SAL_OVERRIDE;
}; };
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "model/SlsEnumeration.hxx" #include "model/SlsEnumeration.hxx"
#include "model/SlsSharedPageDescriptor.hxx" #include "model/SlsSharedPageDescriptor.hxx"
#include <boost/function.hpp> #include <functional>
#include <memory> #include <memory>
namespace sd { namespace slidesorter { namespace model { namespace sd { namespace slidesorter { namespace model {
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
enumeration. Pages for which rPredicate returns <FALSE/> are enumeration. Pages for which rPredicate returns <FALSE/> are
exclude. exclude.
*/ */
typedef ::boost::function<bool(const SharedPageDescriptor&)> PagePredicate; typedef ::std::function<bool (const SharedPageDescriptor&)> PagePredicate;
static PageEnumeration Create ( static PageEnumeration Create (
const SlideSorterModel& rModel, const SlideSorterModel& rModel,
const PagePredicate& rPredicate); const PagePredicate& rPredicate);
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "model/SlsPageEnumerationProvider.hxx" #include "model/SlsPageEnumerationProvider.hxx"
#include "model/SlsPageEnumeration.hxx" #include "model/SlsPageEnumeration.hxx"
#include "model/SlsPageDescriptor.hxx" #include "model/SlsPageDescriptor.hxx"
#include <boost/function.hpp>
namespace sd { namespace slidesorter { namespace model { namespace sd { namespace slidesorter { namespace model {
......
...@@ -97,7 +97,7 @@ public: ...@@ -97,7 +97,7 @@ public:
private: private:
controller::Animator::AnimationId mnAnimationId; controller::Animator::AnimationId mnAnimationId;
AnimatorAccess& mrAnimatorAccess; AnimatorAccess& mrAnimatorAccess;
::boost::function<double(double)> maAccelerationFunction; ::std::function<double (double)> maAccelerationFunction;
void RestartAnimation(); void RestartAnimation();
}; };
...@@ -395,14 +395,13 @@ void PageObjectRun::RestartAnimation() ...@@ -395,14 +395,13 @@ void PageObjectRun::RestartAnimation()
// Restart the animation. // Restart the animation.
mrAnimatorAccess.AddRun(shared_from_this()); mrAnimatorAccess.AddRun(shared_from_this());
auto sharedThis(shared_from_this());
mnAnimationId = mrAnimatorAccess.GetAnimator()->AddAnimation( mnAnimationId = mrAnimatorAccess.GetAnimator()->AddAnimation(
::boost::ref(*this), [this] (double const val) { (*this)(val); },
0, 0,
300, 300,
::boost::bind( [sharedThis] () { sharedThis->mrAnimatorAccess.RemoveRun(sharedThis); }
&AnimatorAccess::RemoveRun, );
::boost::ref(mrAnimatorAccess),
shared_from_this()));
} }
void PageObjectRun::operator () (const double nGlobalTime) void PageObjectRun::operator () (const double nGlobalTime)
......
...@@ -22,12 +22,13 @@ ...@@ -22,12 +22,13 @@
#include <vcl/window.hxx> #include <vcl/window.hxx>
#include <vcl/virdev.hxx> #include <vcl/virdev.hxx>
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <tools/gen.hxx> #include <tools/gen.hxx>
#include <tools/fract.hxx> #include <tools/fract.hxx>
#include <boost/bind.hpp>
#include <functional>
namespace sd { namespace slidesorter { namespace view { namespace sd { namespace slidesorter { namespace view {
namespace { namespace {
...@@ -75,7 +76,7 @@ void DeviceCopy ( ...@@ -75,7 +76,7 @@ void DeviceCopy (
rSourceDevice); rSourceDevice);
} }
void ForAllRectangles (const vcl::Region& rRegion, ::boost::function<void(const Rectangle&)> aFunction) void ForAllRectangles (const vcl::Region& rRegion, ::std::function<void (const Rectangle&)> aFunction)
{ {
OSL_ASSERT(aFunction); OSL_ASSERT(aFunction);
RectangleVector aRectangles; RectangleVector aRectangles;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment