diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-06-28 21:48:22 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-07-03 12:21:03 +0200 |
commit | c4ddf6cd6d97e7ce7c2e63e4d393bbeffcb34e4d (patch) | |
tree | 128225fc91bd7da687f965337a49b9b64fbe8a79 /xmloff | |
parent | 5034e8217c9844293dc94e5dff0bdc865ad7a91a (diff) |
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 <functional> 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 <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 12 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLImport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLPlotAreaContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLTableContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/forms/elementimport.cxx | 5 | ||||
-rw-r--r-- | xmloff/source/forms/formcellbinding.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/forms/property_meta_data.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 1 |
8 files changed, 12 insertions, 17 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 74ff16fb6d31..aad2d6539569 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -273,7 +273,7 @@ public: namespace { -class lcl_MatchesRole : public ::std::unary_function< Reference< chart2::data::XLabeledDataSequence >, bool > +class lcl_MatchesRole { public: explicit lcl_MatchesRole( const OUString & aRole ) : @@ -702,12 +702,10 @@ struct lcl_TableData typedef ::std::map< sal_Int32, SchXMLExportHelper_Impl::tLabelValuesDataPair > lcl_DataSequenceMap; -struct lcl_SequenceToMapElement : - public ::std::unary_function< lcl_DataSequenceMap::mapped_type, lcl_DataSequenceMap::value_type > +struct lcl_SequenceToMapElement { - lcl_SequenceToMapElement() - {} - result_type operator() ( const argument_type & rContent ) + std::pair<const sal_Int32, SchXMLExportHelper_Impl::tLabelValuesDataPair> + operator() (const SchXMLExportHelper_Impl::tLabelValuesDataPair& rContent) { sal_Int32 nIndex = -1; if( rContent.second.is()) //has values @@ -717,7 +715,7 @@ struct lcl_SequenceToMapElement : } else if( rContent.first.is()) //has labels nIndex = rContent.first->getSourceRangeRepresentation().copy( sizeof("label ")).toInt32(); - return result_type( nIndex, rContent ); + return std::make_pair(nIndex, rContent); } }; diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index 10d8fc105b39..8c44d3f65702 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -60,7 +60,7 @@ using ::com::sun::star::uno::Sequence; namespace { -class lcl_MatchesChartType : public ::std::unary_function< Reference< chart2::XChartType >, bool > +class lcl_MatchesChartType { public: explicit lcl_MatchesChartType( const OUString & aChartTypeName ) : diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 9fe693cd0bb0..ba69c3a50456 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -65,7 +65,7 @@ using com::sun::star::uno::Reference; namespace { -struct lcl_AxisHasCategories : public ::std::unary_function< SchXMLAxis, bool > +struct lcl_AxisHasCategories { bool operator() ( const SchXMLAxis & rAxis ) { diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index ae92040a00c2..0d42dcebc3a9 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -63,7 +63,7 @@ const char aCategoriesRange[] = "categories"; typedef ::std::multimap< OUString, OUString > lcl_tOriginalRangeToInternalRangeMap; -struct lcl_ApplyCellToData : public ::std::unary_function< SchXMLCell, void > +struct lcl_ApplyCellToData { explicit lcl_ApplyCellToData( Sequence< double > & rOutData ) : m_rData( rOutData ), diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index a4234a0b9056..322297d81672 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -50,7 +50,6 @@ #include <comphelper/sequence.hxx> #include <algorithm> -#include <functional> namespace xmloff { @@ -1404,7 +1403,7 @@ namespace xmloff simulateDefaultedAttribute(OAttributeMetaData::getDatabaseAttributeName(DAFlags::ConvertEmpty), PROPERTY_EMPTY_IS_NULL, "false"); } - struct EqualHandle : public ::std::unary_function< PropertyValue, bool > + struct EqualHandle { const sal_Int32 m_nHandle; explicit EqualHandle( sal_Int32 _nHandle ) : m_nHandle( _nHandle ) { } @@ -1457,7 +1456,7 @@ namespace xmloff // since this is the default of this property, anyway. } - struct EqualName : public ::std::unary_function< PropertyValue, bool > + struct EqualName { const OUString & m_sName; explicit EqualName( const OUString& _rName ) : m_sName( _rName ) { } diff --git a/xmloff/source/forms/formcellbinding.cxx b/xmloff/source/forms/formcellbinding.cxx index f81142640929..cd673bc58965 100644 --- a/xmloff/source/forms/formcellbinding.cxx +++ b/xmloff/source/forms/formcellbinding.cxx @@ -34,7 +34,6 @@ #include "strings.hxx" #include <osl/diagnose.h> -#include <functional> #include <algorithm> namespace xmloff @@ -80,7 +79,7 @@ namespace return getTypedModelNode< XModel >( _rxModelNode ); } - struct StringCompare : public ::std::unary_function< OUString, bool > + struct StringCompare { private: const OUString & m_sReference; diff --git a/xmloff/source/forms/property_meta_data.cxx b/xmloff/source/forms/property_meta_data.cxx index 496a929b5cc8..3a8c8dabea28 100644 --- a/xmloff/source/forms/property_meta_data.cxx +++ b/xmloff/source/forms/property_meta_data.cxx @@ -123,7 +123,7 @@ namespace xmloff { namespace metadata return s_reverseTokenLookup; } - struct AttributeHash : public ::std::unary_function< AttributeDescription, size_t > + struct AttributeHash { size_t operator()( const AttributeDescription& i_attribute ) const { diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index b1f8b60c50dc..9829030d9d17 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -151,7 +151,6 @@ namespace }; struct FrameRefHash - : public unary_function<Reference<XTextFrame>, size_t> { size_t operator()(const Reference<XTextFrame>& rFrame) const { return sal::static_int_cast<size_t>(reinterpret_cast<sal_uIntPtr>(rFrame.get())); } |