diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-08-03 12:50:28 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-08-03 14:47:45 +0200 |
commit | 902d61bc7f2e0491b95798c2ece8595b3881b573 (patch) | |
tree | 0cccac094a864ac3f2421cd485088f6418b5da96 /sdext | |
parent | 34d2a07a23f344b33f9b3ed7d2a70b405b392db6 (diff) |
sdext: replace boost::function with std::function
This one is a bit odd, wonder if that was a bug:
- aAction(aPredicate);
+ aAction(aPredicate());
Change-Id: I0ddd565b65fe4778a297486805fa7f7a12702224
Diffstat (limited to 'sdext')
17 files changed, 68 insertions, 56 deletions
diff --git a/sdext/inc/pch/precompiled_PresenterScreen.hxx b/sdext/inc/pch/precompiled_PresenterScreen.hxx index 405e652a1be0..7183265d51be 100644 --- a/sdext/inc/pch/precompiled_PresenterScreen.hxx +++ b/sdext/inc/pch/precompiled_PresenterScreen.hxx @@ -21,7 +21,6 @@ #include <algorithm> #include <boost/bind.hpp> #include <boost/enable_shared_from_this.hpp> -#include <boost/function.hpp> #include <boost/noncopyable.hpp> #include <boost/shared_ptr.hpp> #include <boost/weak_ptr.hpp> diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx index 817b4a29a3f4..94d002ce5758 100644 --- a/sdext/source/presenter/PresenterAccessibility.cxx +++ b/sdext/source/presenter/PresenterAccessibility.cxx @@ -1874,9 +1874,9 @@ void AccessibleNotes::SetTextView ( if (mpTextView) { mpTextView->GetCaret()->SetCaretMotionBroadcaster( - ::boost::function<void(sal_Int32,sal_Int32,sal_Int32,sal_Int32)>()); + ::std::function<void (sal_Int32,sal_Int32,sal_Int32,sal_Int32)>()); mpTextView->SetTextChangeBroadcaster( - ::boost::function<void()>()); + ::std::function<void ()>()); } mpTextView = rpTextView; diff --git a/sdext/source/presenter/PresenterConfigurationAccess.hxx b/sdext/source/presenter/PresenterConfigurationAccess.hxx index ef2a6b443057..a92736811643 100644 --- a/sdext/source/presenter/PresenterConfigurationAccess.hxx +++ b/sdext/source/presenter/PresenterConfigurationAccess.hxx @@ -25,8 +25,9 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/uno/XComponentContext.hpp> + #include <vector> -#include <boost/function.hpp> +#include <functional> namespace sdext { namespace presenter { @@ -48,7 +49,7 @@ class PresenterConfigurationAccess { public: enum WriteMode { READ_WRITE, READ_ONLY }; - typedef ::boost::function<bool( + typedef ::std::function<bool ( const OUString&, const css::uno::Reference<css::beans::XPropertySet>&)> Predicate; static const OUString msPresenterScreenRootName; @@ -121,10 +122,10 @@ public: */ void CommitChanges(); - typedef ::boost::function<void( + typedef ::std::function<void ( const OUString&, const ::std::vector<css::uno::Any>&) > ItemProcessor; - typedef ::boost::function<void( + typedef ::std::function<void ( const OUString&, const css::uno::Reference<css::beans::XPropertySet>&) > PropertySetProcessor; diff --git a/sdext/source/presenter/PresenterFrameworkObserver.cxx b/sdext/source/presenter/PresenterFrameworkObserver.cxx index b3dc3859a58d..0a5f5e7f4aec 100644 --- a/sdext/source/presenter/PresenterFrameworkObserver.cxx +++ b/sdext/source/presenter/PresenterFrameworkObserver.cxx @@ -82,7 +82,7 @@ bool PresenterFrameworkObserver::True() void SAL_CALL PresenterFrameworkObserver::disposing() { - if ( ! maAction.empty()) + if (maAction) maAction(false); Shutdown(); } @@ -108,7 +108,7 @@ void SAL_CALL PresenterFrameworkObserver::disposing (const lang::EventObject& rE if (rEvent.Source == mxConfigurationController) { mxConfigurationController = NULL; - if ( ! maAction.empty()) + if (maAction) maAction(false); } } @@ -124,7 +124,7 @@ void SAL_CALL PresenterFrameworkObserver::notifyConfigurationChange ( if (rEvent.Type == "ConfigurationUpdateEnd") { Shutdown(); - aAction(aPredicate); + aAction(aPredicate()); bDispose = true; } else if (aPredicate()) @@ -136,7 +136,7 @@ void SAL_CALL PresenterFrameworkObserver::notifyConfigurationChange ( if (bDispose) { - maAction.clear(); + maAction = nullptr; dispose(); } } diff --git a/sdext/source/presenter/PresenterFrameworkObserver.hxx b/sdext/source/presenter/PresenterFrameworkObserver.hxx index 3ebc2cb59140..edc9481605cf 100644 --- a/sdext/source/presenter/PresenterFrameworkObserver.hxx +++ b/sdext/source/presenter/PresenterFrameworkObserver.hxx @@ -24,9 +24,11 @@ #include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase1.hxx> -#include <boost/function.hpp> + #include <boost/noncopyable.hpp> +#include <functional> + namespace sdext { namespace presenter { typedef ::cppu::WeakComponentImplHelper1 < @@ -42,8 +44,8 @@ class PresenterFrameworkObserver public PresenterFrameworkObserverInterfaceBase { public: - typedef ::boost::function<bool()> Predicate; - typedef ::boost::function<void(bool)> Action; + typedef ::std::function<bool ()> Predicate; + typedef ::std::function<void (bool)> Action; static void RunOnUpdateEnd ( const css::uno::Reference<css::drawing::framework::XConfigurationController>&rxController, diff --git a/sdext/source/presenter/PresenterPaintManager.cxx b/sdext/source/presenter/PresenterPaintManager.cxx index 8c00b7d949df..4f385e815cc7 100644 --- a/sdext/source/presenter/PresenterPaintManager.cxx +++ b/sdext/source/presenter/PresenterPaintManager.cxx @@ -40,7 +40,7 @@ PresenterPaintManager::PresenterPaintManager ( { } -::boost::function<void(const css::awt::Rectangle& rRepaintBox)> +::std::function<void (const css::awt::Rectangle& rRepaintBox)> PresenterPaintManager::GetInvalidator ( const css::uno::Reference<css::awt::XWindow>& rxWindow, const bool bSynchronous) diff --git a/sdext/source/presenter/PresenterPaintManager.hxx b/sdext/source/presenter/PresenterPaintManager.hxx index 440d1dc1e537..3ad014146eee 100644 --- a/sdext/source/presenter/PresenterPaintManager.hxx +++ b/sdext/source/presenter/PresenterPaintManager.hxx @@ -24,7 +24,8 @@ #include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/drawing/XPresenterHelper.hpp> #include <rtl/ref.hxx> -#include <boost/function.hpp> + +#include <functional> namespace sdext { namespace presenter { @@ -45,7 +46,7 @@ public: const css::uno::Reference<css::drawing::XPresenterHelper>& rxPresenterHelper, const rtl::Reference<PresenterPaneContainer>& rpPaneContainer); - ::boost::function<void(const css::awt::Rectangle& rRepaintBox)> + ::std::function<void (const css::awt::Rectangle& rRepaintBox)> GetInvalidator ( const css::uno::Reference<css::awt::XWindow>& rxWindow, const bool bSynchronous = false); diff --git a/sdext/source/presenter/PresenterPaneContainer.cxx b/sdext/source/presenter/PresenterPaneContainer.cxx index 74dfb1c288f2..6d0d59571717 100644 --- a/sdext/source/presenter/PresenterPaneContainer.cxx +++ b/sdext/source/presenter/PresenterPaneContainer.cxx @@ -196,11 +196,11 @@ PresenterPaneContainer::SharedPaneDescriptor pDescriptor->mxPane->SetBackground(rpViewBackground); try { - if ( ! pDescriptor->maViewInitialization.empty()) + if (pDescriptor->maViewInitialization) pDescriptor->maViewInitialization(rxView); // Activate or deactivate the pane/view. - if ( ! pDescriptor->maActivator.empty()) + if (pDescriptor->maActivator) pDescriptor->maActivator(pDescriptor->mbIsActive); } catch (RuntimeException&) @@ -376,7 +376,7 @@ void SAL_CALL PresenterPaneContainer::disposing ( void PresenterPaneContainer::PaneDescriptor::SetActivationState (const bool bIsActive) { mbIsActive = bIsActive; - if ( ! maActivator.empty()) + if (maActivator) maActivator(mbIsActive); } diff --git a/sdext/source/presenter/PresenterPaneContainer.hxx b/sdext/source/presenter/PresenterPaneContainer.hxx index c22eb278fc64..03704b9910a6 100644 --- a/sdext/source/presenter/PresenterPaneContainer.hxx +++ b/sdext/source/presenter/PresenterPaneContainer.hxx @@ -33,11 +33,13 @@ #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase1.hxx> #include <rtl/ref.hxx> -#include <vector> -#include <boost/function.hpp> + #include <boost/noncopyable.hpp> #include <boost/shared_ptr.hpp> +#include <vector> +#include <functional> + namespace sdext { namespace presenter { class PresenterPaneBase; @@ -65,7 +67,7 @@ public: virtual void SAL_CALL disposing() SAL_OVERRIDE; - typedef ::boost::function1<void, const css::uno::Reference<css::drawing::framework::XView>&> + typedef ::std::function<void (const css::uno::Reference<css::drawing::framework::XView>&)> ViewInitializationFunction; /** Each pane descriptor holds references to one pane and the view @@ -79,8 +81,8 @@ public: class PaneDescriptor { public: - typedef ::boost::function<void(bool)> Activator; - typedef ::boost::function<boost::shared_ptr<PresenterSprite>()> SpriteProvider; + typedef ::std::function<void (bool)> Activator; + typedef ::std::function<boost::shared_ptr<PresenterSprite> ()> SpriteProvider; css::uno::Reference<css::drawing::framework::XResourceId> mxPaneId; OUString msViewURL; ::rtl::Reference<PresenterPaneBase> mxPane; diff --git a/sdext/source/presenter/PresenterScrollBar.cxx b/sdext/source/presenter/PresenterScrollBar.cxx index fcf708e49f6f..bd5f07b78c81 100644 --- a/sdext/source/presenter/PresenterScrollBar.cxx +++ b/sdext/source/presenter/PresenterScrollBar.cxx @@ -72,7 +72,7 @@ PresenterScrollBar::PresenterScrollBar ( const Reference<XComponentContext>& rxComponentContext, const Reference<awt::XWindow>& rxParentWindow, const ::boost::shared_ptr<PresenterPaintManager>& rpPaintManager, - const ::boost::function<void(double)>& rThumbMotionListener) + const ::std::function<void (double)>& rThumbMotionListener) : PresenterScrollBarInterfaceBase(m_aMutex), mxComponentContext(rxComponentContext), mxParentWindow(rxParentWindow), @@ -630,7 +630,7 @@ PresenterVerticalScrollBar::PresenterVerticalScrollBar ( const Reference<XComponentContext>& rxComponentContext, const Reference<awt::XWindow>& rxParentWindow, const ::boost::shared_ptr<PresenterPaintManager>& rpPaintManager, - const ::boost::function<void(double)>& rThumbMotionListener) + const ::std::function<void (double)>& rThumbMotionListener) : PresenterScrollBar(rxComponentContext, rxParentWindow, rpPaintManager, rThumbMotionListener), mnScrollBarWidth(0) { diff --git a/sdext/source/presenter/PresenterScrollBar.hxx b/sdext/source/presenter/PresenterScrollBar.hxx index 09413586869e..5e91d20ca019 100644 --- a/sdext/source/presenter/PresenterScrollBar.hxx +++ b/sdext/source/presenter/PresenterScrollBar.hxx @@ -28,11 +28,13 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase4.hxx> -#include <boost/function.hpp> + #include <boost/noncopyable.hpp> #include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> +#include <functional> + namespace sdext { namespace presenter { class PresenterCanvasHelper; @@ -55,7 +57,7 @@ class PresenterScrollBar public PresenterScrollBarInterfaceBase { public: - typedef ::boost::function<void(double)> ThumbMotionListener; + typedef ::std::function<void (double)> ThumbMotionListener; virtual ~PresenterScrollBar(); virtual void SAL_CALL disposing() SAL_OVERRIDE; @@ -171,7 +173,7 @@ protected: double mnThumbSize; double mnLineHeight; css::geometry::RealPoint2D maDragAnchor; - ::boost::function<void(double)> maThumbMotionListener; + ::std::function<void (double)> maThumbMotionListener; Area meButtonDownArea; Area meMouseMoveArea; css::geometry::RealRectangle2D maBox[__AreaCount__]; @@ -205,7 +207,7 @@ protected: const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext, const css::uno::Reference<css::awt::XWindow>& rxParentWindow, const ::boost::shared_ptr<PresenterPaintManager>& rpPaintManager, - const ::boost::function<void(double)>& rThumbMotionListener); + const ::std::function<void (double)>& rThumbMotionListener); void Repaint ( const css::geometry::RealRectangle2D& rBox, @@ -250,7 +252,7 @@ public: const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext, const css::uno::Reference<css::awt::XWindow>& rxParentWindow, const ::boost::shared_ptr<PresenterPaintManager>& rpPaintManager, - const ::boost::function<void(double)>& rThumbMotionListener); + const ::std::function<void (double)>& rThumbMotionListener); virtual ~PresenterVerticalScrollBar(); virtual sal_Int32 GetSize() const SAL_OVERRIDE; diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx index c1024c600706..e785f590a9f4 100644 --- a/sdext/source/presenter/PresenterSlideSorter.cxx +++ b/sdext/source/presenter/PresenterSlideSorter.cxx @@ -101,7 +101,7 @@ public: const sal_Int32 nRelativeHorizontalPosition, const sal_Int32 nRelativeVerticalPosition) const; css::awt::Rectangle GetBoundingBox (const sal_Int32 nSlideIndex) const; - void ForAllVisibleSlides (const ::boost::function<void(sal_Int32)>& rAction); + void ForAllVisibleSlides (const ::std::function<void (sal_Int32)>& rAction); sal_Int32 GetFirstVisibleSlideIndex() const; sal_Int32 GetLastVisibleSlideIndex() const; bool SetHorizontalOffset (const double nOffset); @@ -1394,7 +1394,8 @@ awt::Rectangle PresenterSlideSorter::Layout::GetBoundingBox (const sal_Int32 nSl aWindowPosition.Y + maPreviewSize.Height)); } -void PresenterSlideSorter::Layout::ForAllVisibleSlides (const ::boost::function<void(sal_Int32)>& rAction) +void PresenterSlideSorter::Layout::ForAllVisibleSlides( + const ::std::function<void (sal_Int32)>& rAction) { for (sal_Int32 nRow=mnFirstVisibleRow; nRow<=mnLastVisibleRow; ++nRow) { diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx index e0b3838ef660..310427e13ab9 100644 --- a/sdext/source/presenter/PresenterTextView.cxx +++ b/sdext/source/presenter/PresenterTextView.cxx @@ -64,7 +64,7 @@ namespace sdext { namespace presenter { PresenterTextView::PresenterTextView ( const Reference<XComponentContext>& rxContext, const Reference<rendering::XCanvas>& rxCanvas, - const ::boost::function<void(const css::awt::Rectangle&)>& rInvalidator) + const ::std::function<void (const css::awt::Rectangle&)>& rInvalidator) : mxCanvas(rxCanvas), mbDoOuput(true), mxBreakIterator(), @@ -139,7 +139,7 @@ void PresenterTextView::SetText (const Reference<text::XText>& rxText) } void PresenterTextView::SetTextChangeBroadcaster ( - const ::boost::function<void()>& rBroadcaster) + const ::std::function<void ()>& rBroadcaster) { maTextChangeBroadcaster = rBroadcaster; } @@ -1084,8 +1084,8 @@ void PresenterTextParagraph::SetupCellArray ( //===== PresenterTextCaret ================================================---- PresenterTextCaret::PresenterTextCaret ( - const ::boost::function<css::awt::Rectangle(const sal_Int32,const sal_Int32)>& rCharacterBoundsAccess, - const ::boost::function<void(const css::awt::Rectangle&)>& rInvalidator) + const ::std::function<css::awt::Rectangle (const sal_Int32,const sal_Int32)>& rCharacterBoundsAccess, + const ::std::function<void (const css::awt::Rectangle&)>& rInvalidator) : mnParagraphIndex(-1), mnCharacterIndex(-1), mnCaretBlinkTaskId(0), @@ -1164,7 +1164,7 @@ void PresenterTextCaret::SetPosition ( void PresenterTextCaret::SetCaretMotionBroadcaster ( - const ::boost::function<void(sal_Int32,sal_Int32,sal_Int32,sal_Int32)>& rBroadcaster) + const ::std::function<void (sal_Int32,sal_Int32,sal_Int32,sal_Int32)>& rBroadcaster) { maBroadcaster = rBroadcaster; } diff --git a/sdext/source/presenter/PresenterTextView.hxx b/sdext/source/presenter/PresenterTextView.hxx index 1a47da041d0d..3b5fea741932 100644 --- a/sdext/source/presenter/PresenterTextView.hxx +++ b/sdext/source/presenter/PresenterTextView.hxx @@ -34,6 +34,7 @@ #include <cppuhelper/compbase1.hxx> #include <cppuhelper/basemutex.hxx> +#include <functional> namespace sdext { namespace presenter { @@ -41,9 +42,9 @@ class PresenterTextCaret { public: PresenterTextCaret ( - const ::boost::function<css::awt::Rectangle(const sal_Int32,const sal_Int32)>& + const ::std::function<css::awt::Rectangle (const sal_Int32,const sal_Int32)>& rCharacterBoundsAccess, - const ::boost::function<void(const css::awt::Rectangle&)>& + const ::std::function<void (const css::awt::Rectangle&)>& rInvalidator); ~PresenterTextCaret(); @@ -64,7 +65,7 @@ public: when the caret changes position. */ void SetCaretMotionBroadcaster ( - const ::boost::function<void(sal_Int32,sal_Int32,sal_Int32,sal_Int32)>& rBroadcaster); + const ::std::function<void (sal_Int32,sal_Int32,sal_Int32,sal_Int32)>& rBroadcaster); css::awt::Rectangle GetBounds() const; @@ -73,9 +74,9 @@ private: sal_Int32 mnCharacterIndex; sal_Int32 mnCaretBlinkTaskId; bool mbIsCaretVisible; - const ::boost::function<css::awt::Rectangle(const sal_Int32,const sal_Int32)> maCharacterBoundsAccess; - const ::boost::function<void(const css::awt::Rectangle&)> maInvalidator; - ::boost::function<void(sal_Int32,sal_Int32,sal_Int32,sal_Int32)> maBroadcaster; + const ::std::function<css::awt::Rectangle (const sal_Int32,const sal_Int32)> maCharacterBoundsAccess; + const ::std::function<void (const css::awt::Rectangle&)> maInvalidator; + ::std::function<void (sal_Int32,sal_Int32,sal_Int32,sal_Int32)> maBroadcaster; css::awt::Rectangle maCaretBounds; void InvertCaret(); @@ -219,9 +220,9 @@ public: PresenterTextView ( const css::uno::Reference<css::uno::XComponentContext>& rxContext, const css::uno::Reference<css::rendering::XCanvas>& rxCanvas, - const ::boost::function<void(const css::awt::Rectangle&)>& rInvalidator); + const ::std::function<void (const css::awt::Rectangle&)>& rInvalidator); void SetText (const css::uno::Reference<css::text::XText>& rxText); - void SetTextChangeBroadcaster (const ::boost::function<void()>& rBroadcaster); + void SetTextChangeBroadcaster(const ::std::function<void ()>& rBroadcaster); void SetLocation (const css::geometry::RealPoint2D& rLocation); void SetSize (const css::geometry::RealSize2D& rSize); @@ -264,10 +265,10 @@ private: SharedPresenterTextCaret mpCaret; double mnLeftOffset; double mnTopOffset; - const ::boost::function<void(const css::awt::Rectangle&)> maInvalidator; + const ::std::function<void (const css::awt::Rectangle&)> maInvalidator; bool mbIsFormatPending; sal_Int32 mnCharacterCount; - ::boost::function<void()> maTextChangeBroadcaster; + ::std::function<void ()> maTextChangeBroadcaster; void RequestFormat(); void Format(); diff --git a/sdext/source/presenter/PresenterTimer.cxx b/sdext/source/presenter/PresenterTimer.cxx index 0af44829382b..dd0e671080ed 100644 --- a/sdext/source/presenter/PresenterTimer.cxx +++ b/sdext/source/presenter/PresenterTimer.cxx @@ -23,7 +23,6 @@ #include <osl/doublecheckedlocking.h> #include <osl/thread.hxx> #include <boost/bind.hpp> -#include <boost/function.hpp> #include <boost/enable_shared_from_this.hpp> #include <set> #include <iterator> @@ -274,8 +273,7 @@ void SAL_CALL TimerScheduler::run() else { // Execute task. - if ( ! pTask->maTask.empty() - && ! pTask->mbIsCanceled) + if (pTask->maTask && !pTask->mbIsCanceled) { pTask->maTask(aCurrentTime); diff --git a/sdext/source/presenter/PresenterTimer.hxx b/sdext/source/presenter/PresenterTimer.hxx index 8e37a8b2a7fe..e7bd6164f615 100644 --- a/sdext/source/presenter/PresenterTimer.hxx +++ b/sdext/source/presenter/PresenterTimer.hxx @@ -28,7 +28,10 @@ #include <osl/time.h> #include <rtl/ref.hxx> #include <sal/types.h> -#include <boost/function.hpp> + +#include <boost/shared_ptr.hpp> + +#include <functional> #include <vector> namespace com { namespace sun { namespace star { namespace uno { @@ -45,7 +48,7 @@ class PresenterTimer public: /** A task is called with the current time. */ - typedef ::boost::function<void(const TimeValue&)> Task; + typedef ::std::function<void (const TimeValue&)> Task; static const sal_Int32 NotAValidTaskId = 0; diff --git a/sdext/source/presenter/PresenterToolBar.hxx b/sdext/source/presenter/PresenterToolBar.hxx index fabdbc587a8c..a249d018b5f6 100644 --- a/sdext/source/presenter/PresenterToolBar.hxx +++ b/sdext/source/presenter/PresenterToolBar.hxx @@ -43,9 +43,11 @@ #include <com/sun/star/drawing/framework/XView.hpp> #include <com/sun/star/drawing/framework/XResourceId.hpp> #include <com/sun/star/frame/XController.hpp> -#include <boost/function.hpp> + #include <boost/noncopyable.hpp> +#include <functional> + namespace { typedef cppu::WeakComponentImplHelper5< css::awt::XWindowListener, @@ -76,7 +78,7 @@ class PresenterToolBar public CachablePresenterView { public: - typedef ::boost::function<void()> Action; + typedef ::std::function<void ()> Action; enum Anchor { Left, Center, Right }; |