diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-08-03 13:12:34 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-08-03 14:47:45 +0200 |
commit | 5088ee99ce8a78b1f87052601cf8d6c7d2ff84db (patch) | |
tree | 41fb00177a445893ed5c07ef24c940c9b5c9d704 /sd | |
parent | sdext: replace boost::function with std::function (diff) | |
download | core-5088ee99ce8a78b1f87052601cf8d6c7d2ff84db.tar.gz core-5088ee99ce8a78b1f87052601cf8d6c7d2ff84db.zip |
sd: replace boost::function with std::function
Change-Id: If70426d6d93a8c3b7c585b1c69e9b1c58643d140
Diffstat (limited to 'sd')
17 files changed, 48 insertions, 41 deletions
diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index 0bf4d9627068..62ab27d403cc 100644 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -69,7 +69,6 @@ #include <basic/sbx.hxx> #include <boost/bind.hpp> #include <boost/enable_shared_from_this.hpp> -#include <boost/function.hpp> #include <boost/limits.hpp> #include <boost/make_shared.hpp> #include <boost/noncopyable.hpp> diff --git a/sd/source/ui/inc/framework/FrameworkHelper.hxx b/sd/source/ui/inc/framework/FrameworkHelper.hxx index 2dd9aa0cbf00..8407203e7644 100644 --- a/sd/source/ui/inc/framework/FrameworkHelper.hxx +++ b/sd/source/ui/inc/framework/FrameworkHelper.hxx @@ -31,7 +31,8 @@ #include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #include <boost/enable_shared_from_this.hpp> -#include <boost/function.hpp> + +#include <functional> #include <map> namespace sd { @@ -146,11 +147,11 @@ public: static ::boost::shared_ptr<ViewShell> GetViewShell ( 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; - typedef ::boost::function<void(bool bEventSeen)> Callback; - typedef ::boost::function< - void( + typedef ::std::function<void (bool bEventSeen)> Callback; + typedef ::std::function< + void ( const css::uno::Reference< css::drawing::framework::XResourceId>&) > ResourceFunctor; diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx index eac512646a32..33fd9593b59c 100644 --- a/sd/source/ui/inc/navigatr.hxx +++ b/sd/source/ui/inc/navigatr.hxx @@ -81,7 +81,7 @@ class SdNavigatorWin : public vcl::Window { public: - typedef ::boost::function<void()> UpdateRequestFunctor; + typedef ::std::function<void ()> UpdateRequestFunctor; /** Create a new instance of the navigator. @param bUseActiveUpdate diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx index 7e918976d2b6..6b8c84b837bf 100644 --- a/sd/source/ui/inc/sdtreelb.hxx +++ b/sd/source/ui/inc/sdtreelb.hxx @@ -31,7 +31,6 @@ #include "sdxfer.hxx" #include <vector> #include <boost/scoped_ptr.hpp> -#include <boost/function.hpp> class SdDrawDocument; class SfxMedium; diff --git a/sd/source/ui/inc/tools/AsynchronousCall.hxx b/sd/source/ui/inc/tools/AsynchronousCall.hxx index a95ad7f58ffd..d20a76f3ee09 100644 --- a/sd/source/ui/inc/tools/AsynchronousCall.hxx +++ b/sd/source/ui/inc/tools/AsynchronousCall.hxx @@ -21,8 +21,9 @@ #define INCLUDED_SD_SOURCE_UI_INC_TOOLS_ASYNCHRONOUSCALL_HXX #include <vcl/timer.hxx> + #include <memory> -#include <boost/function.hpp> +#include <functional> namespace sd { namespace tools { @@ -63,7 +64,7 @@ public: The timeout in milliseconds until the function object is executed. */ - typedef ::boost::function0<void> AsynchronousFunction; + typedef ::std::function<void ()> AsynchronousFunction; void Post ( const AsynchronousFunction& rFunction, sal_uInt32 nTimeoutInMilliseconds=10); diff --git a/sd/source/ui/inc/tools/ConfigurationAccess.hxx b/sd/source/ui/inc/tools/ConfigurationAccess.hxx index fa17a6a6caf6..c7bf620609c9 100644 --- a/sd/source/ui/inc/tools/ConfigurationAccess.hxx +++ b/sd/source/ui/inc/tools/ConfigurationAccess.hxx @@ -25,8 +25,9 @@ #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> + #include <vector> -#include <boost/function.hpp> +#include <functional> namespace sd { namespace tools { @@ -91,7 +92,7 @@ public: parameters are the name of key item (often of no further interest) and the value of the item. */ - typedef ::boost::function<void( + typedef ::std::function<void ( const OUString&, const std::vector<css::uno::Any>&) > Functor; diff --git a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.hxx b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.hxx index 253bc11b2005..40fd28b59ce9 100644 --- a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.hxx +++ b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.hxx @@ -32,7 +32,8 @@ #include <svx/svdpagv.hxx> #include <vcl/svapp.hxx> #include <vcl/timer.hxx> -#include <boost/function.hpp> + +#include <functional> namespace sd { namespace slidesorter { namespace view { class SlideSorterView; @@ -51,7 +52,7 @@ class RequestQueue; class QueueProcessor { public: - typedef ::boost::function<bool()> IdleDetectionCallback; + typedef ::std::function<bool ()> IdleDetectionCallback; QueueProcessor ( RequestQueue& rQueue, const ::boost::shared_ptr<BitmapCache>& rpCache, diff --git a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx index 6f2ac79b5bad..1efe989526be 100644 --- a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx @@ -501,7 +501,7 @@ void ScrollBarManager::CalcAutoScrollOffset (const Point& rMouseWindowPosition) bool ScrollBarManager::AutoScroll ( const Point& rMouseWindowPosition, - const ::boost::function<void()>& rAutoScrollFunctor) + const ::std::function<void ()>& rAutoScrollFunctor) { maAutoScrollFunctor = rAutoScrollFunctor; CalcAutoScrollOffset(rMouseWindowPosition); @@ -546,7 +546,7 @@ bool ScrollBarManager::RepeatAutoScroll() void ScrollBarManager::clearAutoScrollFunctor() { - maAutoScrollFunctor = ::boost::function<void()>(); + maAutoScrollFunctor = ::std::function<void ()>(); } IMPL_LINK_NOARG_TYPED(ScrollBarManager, AutoScrollTimeoutHandler, Timer *, void) diff --git a/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx b/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx index 6ccc8afe539a..3de85b3ccb58 100644 --- a/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx @@ -43,7 +43,7 @@ namespace { SlideSorter& mrSlideSorter; Point maStart; const Point maEnd; - const ::boost::function<double(double)> maAccelerationFunction; + const ::std::function<double (double)> maAccelerationFunction; }; } // end of anonymous namespace diff --git a/sd/source/ui/slidesorter/inc/controller/SlsAnimationFunction.hxx b/sd/source/ui/slidesorter/inc/controller/SlsAnimationFunction.hxx index 2ac9ec9568b5..8de015ffac4c 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsAnimationFunction.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsAnimationFunction.hxx @@ -22,8 +22,10 @@ #include "model/SlsSharedPageDescriptor.hxx" #include <basegfx/point/b2dpoint.hxx> + #include <boost/noncopyable.hpp> -#include <boost/function.hpp> + +#include <functional> #include <vector> namespace sd { namespace slidesorter { namespace view { @@ -65,7 +67,7 @@ private: class AnimationParametricFunction { public: - typedef ::boost::function<basegfx::B2DPoint(double)> ParametricFunction; + typedef ::std::function<basegfx::B2DPoint (double)> ParametricFunction; AnimationParametricFunction (const ParametricFunction& rFunction); double operator() (const double nX); diff --git a/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx b/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx index d58511fec397..09135d9738b0 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx @@ -26,12 +26,14 @@ #include <vcl/timer.hxx> #include <vcl/idle.hxx> #include <sal/types.h> -#include <vector> -#include <boost/function.hpp> + #include <boost/noncopyable.hpp> #include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> +#include <functional> +#include <vector> + namespace sd { namespace slidesorter { namespace controller { /** Experimental class for simple eye candy animations. @@ -57,8 +59,8 @@ public: /** An animation object is called with values between 0 and 1 as single argument to its operator() method. */ - typedef ::boost::function1<void, double> AnimationFunctor; - typedef ::boost::function0<void> FinishFunctor; + typedef ::std::function<void (double)> AnimationFunctor; + typedef ::std::function<void ()> FinishFunctor; typedef sal_Int32 AnimationId; static const AnimationId NotAnAnimationId = -1; diff --git a/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx index 3c0761d33f96..c6398a20c4f5 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx @@ -25,7 +25,8 @@ #include <tools/link.hxx> #include <tools/gen.hxx> #include <vcl/timer.hxx> -#include <boost/function.hpp> + +#include <functional> class ScrollBar; class ScrollBarBox; @@ -144,7 +145,7 @@ public: */ bool AutoScroll ( const Point& rMouseWindowPosition, - const ::boost::function<void()>& rAutoScrollFunctor); + const ::std::function<void ()>& rAutoScrollFunctor); void StopAutoScroll(); @@ -207,7 +208,7 @@ private: */ VclPtr<sd::Window> mpContentWindow; - ::boost::function<void()> maAutoScrollFunctor; + ::std::function<void ()> maAutoScrollFunctor; void SetWindowOrigin ( double nHorizontalPosition, diff --git a/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx b/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx index 1e60ac843b4a..bc189e0a466e 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx @@ -21,8 +21,9 @@ #define INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_CONTROLLER_SLSTRANSFERABLEDATA_HXX #include "sdxfer.hxx" -#include <boost/function.hpp> + #include <vector> +#include <functional> class SdDrawDocument; namespace sd { namespace slidesorter { @@ -78,7 +79,7 @@ public: private: SlideSorterViewShell* mpViewShell; 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; }; diff --git a/sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx b/sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx index 247bfe25a515..2e3048610471 100644 --- a/sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx +++ b/sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx @@ -27,7 +27,7 @@ #include "model/SlsEnumeration.hxx" #include "model/SlsSharedPageDescriptor.hxx" -#include <boost/function.hpp> +#include <functional> #include <memory> namespace sd { namespace slidesorter { namespace model { @@ -54,7 +54,7 @@ public: enumeration. Pages for which rPredicate returns <FALSE/> are exclude. */ - typedef ::boost::function<bool(const SharedPageDescriptor&)> PagePredicate; + typedef ::std::function<bool (const SharedPageDescriptor&)> PagePredicate; static PageEnumeration Create ( const SlideSorterModel& rModel, const PagePredicate& rPredicate); diff --git a/sd/source/ui/slidesorter/model/SlsPageEnumerationProvider.cxx b/sd/source/ui/slidesorter/model/SlsPageEnumerationProvider.cxx index fafeb9c21d21..28bfeae33151 100644 --- a/sd/source/ui/slidesorter/model/SlsPageEnumerationProvider.cxx +++ b/sd/source/ui/slidesorter/model/SlsPageEnumerationProvider.cxx @@ -20,7 +20,6 @@ #include "model/SlsPageEnumerationProvider.hxx" #include "model/SlsPageEnumeration.hxx" #include "model/SlsPageDescriptor.hxx" -#include <boost/function.hpp> namespace sd { namespace slidesorter { namespace model { diff --git a/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx b/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx index ad3a4a9ae83d..5e5ef8580416 100644 --- a/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx +++ b/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx @@ -97,7 +97,7 @@ public: private: controller::Animator::AnimationId mnAnimationId; AnimatorAccess& mrAnimatorAccess; - ::boost::function<double(double)> maAccelerationFunction; + ::std::function<double (double)> maAccelerationFunction; void RestartAnimation(); }; @@ -395,14 +395,13 @@ void PageObjectRun::RestartAnimation() // Restart the animation. mrAnimatorAccess.AddRun(shared_from_this()); + auto sharedThis(shared_from_this()); mnAnimationId = mrAnimatorAccess.GetAnimator()->AddAnimation( - ::boost::ref(*this), + [this] (double const val) { (*this)(val); }, 0, 300, - ::boost::bind( - &AnimatorAccess::RemoveRun, - ::boost::ref(mrAnimatorAccess), - shared_from_this())); + [sharedThis] () { sharedThis->mrAnimatorAccess.RemoveRun(sharedThis); } + ); } void PageObjectRun::operator () (const double nGlobalTime) diff --git a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx index 72cecd66c482..ac660a8548da 100644 --- a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx +++ b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx @@ -22,12 +22,13 @@ #include <vcl/window.hxx> #include <vcl/virdev.hxx> -#include <boost/bind.hpp> -#include <boost/function.hpp> - #include <tools/gen.hxx> #include <tools/fract.hxx> +#include <boost/bind.hpp> + +#include <functional> + namespace sd { namespace slidesorter { namespace view { namespace { @@ -75,7 +76,7 @@ void DeviceCopy ( 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); RectangleVector aRectangles; |