From 902d61bc7f2e0491b95798c2ece8595b3881b573 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 3 Aug 2015 12:50:28 +0200 Subject: 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 --- sdext/source/presenter/PresenterAccessibility.cxx | 4 ++-- .../presenter/PresenterConfigurationAccess.hxx | 9 +++++---- .../source/presenter/PresenterFrameworkObserver.cxx | 8 ++++---- .../source/presenter/PresenterFrameworkObserver.hxx | 8 +++++--- sdext/source/presenter/PresenterPaintManager.cxx | 2 +- sdext/source/presenter/PresenterPaintManager.hxx | 5 +++-- sdext/source/presenter/PresenterPaneContainer.cxx | 6 +++--- sdext/source/presenter/PresenterPaneContainer.hxx | 12 +++++++----- sdext/source/presenter/PresenterScrollBar.cxx | 4 ++-- sdext/source/presenter/PresenterScrollBar.hxx | 12 +++++++----- sdext/source/presenter/PresenterSlideSorter.cxx | 5 +++-- sdext/source/presenter/PresenterTextView.cxx | 10 +++++----- sdext/source/presenter/PresenterTextView.hxx | 21 +++++++++++---------- sdext/source/presenter/PresenterTimer.cxx | 4 +--- sdext/source/presenter/PresenterTimer.hxx | 7 +++++-- sdext/source/presenter/PresenterToolBar.hxx | 6 ++++-- 16 files changed, 68 insertions(+), 55 deletions(-) (limited to 'sdext/source') 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()); + ::std::function()); mpTextView->SetTextChangeBroadcaster( - ::boost::function()); + ::std::function()); } 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 #include #include + #include -#include +#include namespace sdext { namespace presenter { @@ -48,7 +49,7 @@ class PresenterConfigurationAccess { public: enum WriteMode { READ_WRITE, READ_ONLY }; - typedef ::boost::function&)> Predicate; static const OUString msPresenterScreenRootName; @@ -121,10 +122,10 @@ public: */ void CommitChanges(); - typedef ::boost::function&) > ItemProcessor; - typedef ::boost::function&) > 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 #include #include -#include + #include +#include + namespace sdext { namespace presenter { typedef ::cppu::WeakComponentImplHelper1 < @@ -42,8 +44,8 @@ class PresenterFrameworkObserver public PresenterFrameworkObserverInterfaceBase { public: - typedef ::boost::function Predicate; - typedef ::boost::function Action; + typedef ::std::function Predicate; + typedef ::std::function Action; static void RunOnUpdateEnd ( const css::uno::Reference&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 +::std::function PresenterPaintManager::GetInvalidator ( const css::uno::Reference& 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 #include #include -#include + +#include namespace sdext { namespace presenter { @@ -45,7 +46,7 @@ public: const css::uno::Reference& rxPresenterHelper, const rtl::Reference& rpPaneContainer); - ::boost::function + ::std::function GetInvalidator ( const css::uno::Reference& 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 #include #include -#include -#include + #include #include +#include +#include + namespace sdext { namespace presenter { class PresenterPaneBase; @@ -65,7 +67,7 @@ public: virtual void SAL_CALL disposing() SAL_OVERRIDE; - typedef ::boost::function1&> + typedef ::std::function&)> ViewInitializationFunction; /** Each pane descriptor holds references to one pane and the view @@ -79,8 +81,8 @@ public: class PaneDescriptor { public: - typedef ::boost::function Activator; - typedef ::boost::function()> SpriteProvider; + typedef ::std::function Activator; + typedef ::std::function ()> SpriteProvider; css::uno::Reference mxPaneId; OUString msViewURL; ::rtl::Reference 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& rxComponentContext, const Reference& rxParentWindow, const ::boost::shared_ptr& rpPaintManager, - const ::boost::function& rThumbMotionListener) + const ::std::function& rThumbMotionListener) : PresenterScrollBarInterfaceBase(m_aMutex), mxComponentContext(rxComponentContext), mxParentWindow(rxParentWindow), @@ -630,7 +630,7 @@ PresenterVerticalScrollBar::PresenterVerticalScrollBar ( const Reference& rxComponentContext, const Reference& rxParentWindow, const ::boost::shared_ptr& rpPaintManager, - const ::boost::function& rThumbMotionListener) + const ::std::function& 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 #include #include -#include + #include #include #include +#include + namespace sdext { namespace presenter { class PresenterCanvasHelper; @@ -55,7 +57,7 @@ class PresenterScrollBar public PresenterScrollBarInterfaceBase { public: - typedef ::boost::function ThumbMotionListener; + typedef ::std::function 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 maThumbMotionListener; + ::std::function maThumbMotionListener; Area meButtonDownArea; Area meMouseMoveArea; css::geometry::RealRectangle2D maBox[__AreaCount__]; @@ -205,7 +207,7 @@ protected: const css::uno::Reference& rxComponentContext, const css::uno::Reference& rxParentWindow, const ::boost::shared_ptr& rpPaintManager, - const ::boost::function& rThumbMotionListener); + const ::std::function& rThumbMotionListener); void Repaint ( const css::geometry::RealRectangle2D& rBox, @@ -250,7 +252,7 @@ public: const css::uno::Reference& rxComponentContext, const css::uno::Reference& rxParentWindow, const ::boost::shared_ptr& rpPaintManager, - const ::boost::function& rThumbMotionListener); + const ::std::function& 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& rAction); + void ForAllVisibleSlides (const ::std::function& 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& rAction) +void PresenterSlideSorter::Layout::ForAllVisibleSlides( + const ::std::function& 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& rxContext, const Reference& rxCanvas, - const ::boost::function& rInvalidator) + const ::std::function& rInvalidator) : mxCanvas(rxCanvas), mbDoOuput(true), mxBreakIterator(), @@ -139,7 +139,7 @@ void PresenterTextView::SetText (const Reference& rxText) } void PresenterTextView::SetTextChangeBroadcaster ( - const ::boost::function& rBroadcaster) + const ::std::function& rBroadcaster) { maTextChangeBroadcaster = rBroadcaster; } @@ -1084,8 +1084,8 @@ void PresenterTextParagraph::SetupCellArray ( //===== PresenterTextCaret ================================================---- PresenterTextCaret::PresenterTextCaret ( - const ::boost::function& rCharacterBoundsAccess, - const ::boost::function& rInvalidator) + const ::std::function& rCharacterBoundsAccess, + const ::std::function& rInvalidator) : mnParagraphIndex(-1), mnCharacterIndex(-1), mnCaretBlinkTaskId(0), @@ -1164,7 +1164,7 @@ void PresenterTextCaret::SetPosition ( void PresenterTextCaret::SetCaretMotionBroadcaster ( - const ::boost::function& rBroadcaster) + const ::std::function& 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 #include +#include namespace sdext { namespace presenter { @@ -41,9 +42,9 @@ class PresenterTextCaret { public: PresenterTextCaret ( - const ::boost::function& + const ::std::function& rCharacterBoundsAccess, - const ::boost::function& + const ::std::function& rInvalidator); ~PresenterTextCaret(); @@ -64,7 +65,7 @@ public: when the caret changes position. */ void SetCaretMotionBroadcaster ( - const ::boost::function& rBroadcaster); + const ::std::function& rBroadcaster); css::awt::Rectangle GetBounds() const; @@ -73,9 +74,9 @@ private: sal_Int32 mnCharacterIndex; sal_Int32 mnCaretBlinkTaskId; bool mbIsCaretVisible; - const ::boost::function maCharacterBoundsAccess; - const ::boost::function maInvalidator; - ::boost::function maBroadcaster; + const ::std::function maCharacterBoundsAccess; + const ::std::function maInvalidator; + ::std::function maBroadcaster; css::awt::Rectangle maCaretBounds; void InvertCaret(); @@ -219,9 +220,9 @@ public: PresenterTextView ( const css::uno::Reference& rxContext, const css::uno::Reference& rxCanvas, - const ::boost::function& rInvalidator); + const ::std::function& rInvalidator); void SetText (const css::uno::Reference& rxText); - void SetTextChangeBroadcaster (const ::boost::function& rBroadcaster); + void SetTextChangeBroadcaster(const ::std::function& 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 maInvalidator; + const ::std::function maInvalidator; bool mbIsFormatPending; sal_Int32 mnCharacterCount; - ::boost::function maTextChangeBroadcaster; + ::std::function 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 #include #include -#include #include #include #include @@ -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 #include #include -#include + +#include + +#include #include 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 Task; + typedef ::std::function 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 #include #include -#include + #include +#include + namespace { typedef cppu::WeakComponentImplHelper5< css::awt::XWindowListener, @@ -76,7 +78,7 @@ class PresenterToolBar public CachablePresenterView { public: - typedef ::boost::function Action; + typedef ::std::function Action; enum Anchor { Left, Center, Right }; -- cgit v1.2.3