From c4ddf6cd6d97e7ce7c2e63e4d393bbeffcb34e4d Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Wed, 28 Jun 2017 21:48:22 +0200 Subject: C++11 remove std::unary_function bases from functors std::unary_function is deprecated since C++11 and removed in C++17 90% done with regexp magic. removed obsolete includes. The std::unary_function base class was used in 3 places: * chart2/source/tools/DataSeriesHelper.cxx: lcl_MatchesRole is used in a std::not1 function helper who uses the members return_type and argument_type. - replace deprecated std::not1 with a lambda * chart2/source/tools/ModifyListenerHelper.cxx: lcl_weakReferenceToSame used the argument_type member in the operator() parameter. - inline the parameter type. * xmloff/source/chart/SchXMLExport.cxx: lcl_SequenceToMapElement used result_type and argument_type in operator(). - inline the types Also fix compile error with gcc about finding std::for_each. Change-Id: I073673beb01410c3108e7d0346d9e7d6b9ad2e2f Reviewed-on: https://gerrit.libreoffice.org/39358 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- svx/source/accessibility/AccessibleTextHelper.cxx | 11 +++++------ svx/source/form/formcontroller.cxx | 6 +++--- svx/source/form/formcontrolling.cxx | 9 ++++----- 3 files changed, 12 insertions(+), 14 deletions(-) (limited to 'svx') diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index f933056909d1..d38b26a68319 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -332,7 +332,7 @@ namespace accessibility } // functor for sending child events (no stand-alone function, they are maybe not inlined) - class AccessibleTextHelper_OffsetChildIndex : public ::std::unary_function< ::accessibility::AccessibleEditableTextPara&, void > + class AccessibleTextHelper_OffsetChildIndex { public: explicit AccessibleTextHelper_OffsetChildIndex( sal_Int32 nDifference ) : mnDifference(nDifference) {} @@ -828,8 +828,7 @@ namespace accessibility } // functor for checking changes in paragraph bounding boxes (no stand-alone function, maybe not inlined) - class AccessibleTextHelper_UpdateChildBounds : public ::std::unary_function< const ::accessibility::AccessibleParaManager::WeakChild&, - ::accessibility::AccessibleParaManager::WeakChild > + class AccessibleTextHelper_UpdateChildBounds { public: explicit AccessibleTextHelper_UpdateChildBounds() {} @@ -880,7 +879,7 @@ namespace accessibility #endif // functor for sending child events (no stand-alone function, they are maybe not inlined) - class AccessibleTextHelper_LostChildEvent : public ::std::unary_function< const ::accessibility::AccessibleParaManager::WeakChild&, void > + class AccessibleTextHelper_LostChildEvent { public: explicit AccessibleTextHelper_LostChildEvent( AccessibleTextHelper_Impl& rImpl ) : mrImpl(rImpl) {} @@ -975,7 +974,7 @@ namespace accessibility } // functor for sending child events (no stand-alone function, they are maybe not inlined) - class AccessibleTextHelper_ChildrenTextChanged : public ::std::unary_function< ::accessibility::AccessibleEditableTextPara&, void > + class AccessibleTextHelper_ChildrenTextChanged { public: void operator()( ::accessibility::AccessibleEditableTextPara& rPara ) @@ -989,7 +988,7 @@ namespace accessibility Reacts on SfxHintId::TextParaInserted/REMOVED events and stores their content */ - class AccessibleTextHelper_QueueFunctor : public ::std::unary_function< const SfxHint*, void > + class AccessibleTextHelper_QueueFunctor { public: AccessibleTextHelper_QueueFunctor() : diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 54777d9ebe8d..89518e9de4ac 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -499,7 +499,7 @@ IMPL_LINK_NOARG( FormController, OnActivateTabOrder, Timer*, void ) } -struct UpdateAllListeners : public ::std::unary_function< Reference< XDispatch >, bool > +struct UpdateAllListeners { bool operator()( const Reference< XDispatch >& _rxDispatcher ) const { @@ -699,7 +699,7 @@ Sequence< OUString> const & FormController::getSupportedServiceNames_Static() namespace { - struct ResetComponentText : public ::std::unary_function< Reference< XTextComponent >, void > + struct ResetComponentText { void operator()( const Reference< XTextComponent >& _rxText ) { @@ -707,7 +707,7 @@ namespace } }; - struct RemoveComponentTextListener : public ::std::unary_function< Reference< XTextComponent >, void > + struct RemoveComponentTextListener { explicit RemoveComponentTextListener( const Reference< XTextListener >& _rxListener ) :m_xListener( _rxListener ) diff --git a/svx/source/form/formcontrolling.cxx b/svx/source/form/formcontrolling.cxx index ccfde930f8a4..30996bfd7062 100644 --- a/svx/source/form/formcontrolling.cxx +++ b/svx/source/form/formcontrolling.cxx @@ -35,7 +35,6 @@ #include #include -#include #include @@ -117,7 +116,7 @@ namespace svx namespace { - struct MatchFeatureDescriptionByURL : public ::std::unary_function< FeatureDescription, bool > + struct MatchFeatureDescriptionByURL { const OUString& m_rURL; explicit MatchFeatureDescriptionByURL( const OUString& _rURL ) :m_rURL( _rURL ) { } @@ -129,7 +128,7 @@ namespace svx }; - struct MatchFeatureDescriptionBySlotId : public ::std::unary_function< FeatureDescription, bool > + struct MatchFeatureDescriptionBySlotId { sal_Int32 m_nSlotId; explicit MatchFeatureDescriptionBySlotId( sal_Int32 _nSlotId ) :m_nSlotId( _nSlotId ) { } @@ -141,7 +140,7 @@ namespace svx }; - struct MatchFeatureDescriptionByFormFeature : public ::std::unary_function< FeatureDescription, bool > + struct MatchFeatureDescriptionByFormFeature { sal_Int32 m_nFormFeature; explicit MatchFeatureDescriptionByFormFeature( sal_Int32 _nFormFeature ) :m_nFormFeature( _nFormFeature ) { } @@ -153,7 +152,7 @@ namespace svx }; - struct FormFeatureToSlotId : public ::std::unary_function< sal_Int16, sal_Int32 > + struct FormFeatureToSlotId { sal_Int32 operator()( sal_Int16 FormFeature ) { -- cgit