Kaydet (Commit) 902d61bc authored tarafından Michael Stahl's avatar Michael Stahl

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
üst 34d2a07a
......@@ -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>
......
......@@ -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;
......
......@@ -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;
......
......@@ -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();
}
}
......
......@@ -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,
......
......@@ -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)
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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)
{
......
......@@ -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;
}
......
......@@ -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();
......
......@@ -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);
......
......@@ -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;
......
......@@ -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 };
......
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