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 /dbaccess | |
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 'dbaccess')
-rw-r--r-- | dbaccess/source/core/dataaccess/databasedocument.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/datasource.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/inc/composertools.hxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/misc/DatabaseDataProvider.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/app/subcomponentmanager.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/genericcontroller.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/sbagrid.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/unodatbr.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/control/tabletree.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/TableCopyHelper.hxx | 5 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/WCopyTable.hxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/TableFieldDescription.cxx | 4 |
12 files changed, 16 insertions, 23 deletions
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index ee3109b5e2b4..dc917cf7a72f 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -2033,7 +2033,7 @@ Reference< XInterface > ODatabaseDocument::getThis() const return *const_cast< ODatabaseDocument* >( this ); } -struct CreateAny : public std::unary_function< Reference<XController>, Any> +struct CreateAny { Any operator() (const Reference<XController>& lhs) const { diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index c56f67b90f18..81df15a36620 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -442,7 +442,7 @@ namespace typedef std::map< OUString, sal_Int32 > PropertyAttributeCache; - struct IsDefaultAndNotRemoveable : public std::unary_function< PropertyValue, bool > + struct IsDefaultAndNotRemoveable { private: const PropertyAttributeCache& m_rAttribs; @@ -796,7 +796,7 @@ sal_Bool ODatabaseSource::convertFastPropertyValue(Any & rConvertedValue, Any & namespace { - struct SelectPropertyName : public std::unary_function< PropertyValue, OUString > + struct SelectPropertyName { public: const OUString& operator()( const PropertyValue& _lhs ) diff --git a/dbaccess/source/core/inc/composertools.hxx b/dbaccess/source/core/inc/composertools.hxx index 986f23948a66..91f790495948 100644 --- a/dbaccess/source/core/inc/composertools.hxx +++ b/dbaccess/source/core/inc/composertools.hxx @@ -23,13 +23,11 @@ #include <rtl/ustrbuf.hxx> #include <osl/diagnose.h> -#include <functional> - namespace dbaccess { // TokenComposer - struct TokenComposer : public std::unary_function< OUString, void > + struct TokenComposer { private: #ifdef DBG_UTIL diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index eaa8afec3cd8..ef6345f0b024 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -634,7 +634,7 @@ namespace } }; - struct CreateColumnDescription : public std::unary_function< OUString, ColumnDescription > + struct CreateColumnDescription { ColumnDescription operator()( const OUString& i_rName ) { @@ -642,7 +642,7 @@ namespace } }; - struct SelectColumnName : public std::unary_function< ColumnDescription, OUString > + struct SelectColumnName { const OUString& operator()( const ColumnDescription& i_rColumn ) { diff --git a/dbaccess/source/ui/app/subcomponentmanager.cxx b/dbaccess/source/ui/app/subcomponentmanager.cxx index 851c67cf79a1..bb66c221b918 100644 --- a/dbaccess/source/ui/app/subcomponentmanager.cxx +++ b/dbaccess/source/ui/app/subcomponentmanager.cxx @@ -37,7 +37,6 @@ #include <osl/mutex.hxx> #include <algorithm> -#include <functional> namespace dbaui { @@ -157,7 +156,7 @@ namespace dbaui } }; - struct SelectSubComponent : public std::unary_function< SubComponentDescriptor, Reference< XComponent > > + struct SelectSubComponent { Reference< XComponent > operator()( const SubComponentDescriptor &_desc ) const { @@ -170,7 +169,7 @@ namespace dbaui typedef std::vector< SubComponentDescriptor > SubComponents; - struct SubComponentMatch : public std::unary_function< SubComponentDescriptor, bool > + struct SubComponentMatch { public: SubComponentMatch( const OUString& i_rName, const sal_Int32 i_nComponentType, diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 4dc69a4830df..5e5d83a5e8fd 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -1260,7 +1260,7 @@ Sequence< ::sal_Int16 > SAL_CALL OGenericUnoController::getSupportedCommandGroup namespace { //Current c++0x draft (apparently) has std::identity, but not operator() - template<typename T> struct SGI_identity : public std::unary_function<T,T> + template<typename T> struct SGI_identity { T& operator()(T& x) const { return x; } const T& operator()(const T& x) const { return x; } diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index ad7439446c1f..f40df7404bdd 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -1215,7 +1215,7 @@ void SbaGridControl::DoFieldDrag(sal_uInt16 nColumnPos, sal_Int16 nRowPos) } /// unary_function Functor object for class ZZ returntype is void - struct SbaGridControlPrec : std::unary_function<DataFlavorExVector::value_type,bool> + struct SbaGridControlPrec { bool operator()(const DataFlavorExVector::value_type& _aType) { diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 241fa9aa19ad..782bfdbea876 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -386,7 +386,7 @@ bool SbaTableQueryBrowser::Construct(vcl::Window* pParent) namespace { - struct SelectValueByName : public std::unary_function< OUString, Any > + struct SelectValueByName { const Any& operator()( OUString const& i_name ) const { diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index cdaddb7069b5..b29cba9d1328 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -178,7 +178,7 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn namespace { - struct OViewSetter : public std::unary_function< OTableTreeListBox::TNames::value_type, bool> + struct OViewSetter { const Sequence< OUString> m_aViews; ::comphelper::UStringMixEqual m_aEqualFunctor; diff --git a/dbaccess/source/ui/inc/TableCopyHelper.hxx b/dbaccess/source/ui/inc/TableCopyHelper.hxx index 187f2fcb46c7..376dd600e785 100644 --- a/dbaccess/source/ui/inc/TableCopyHelper.hxx +++ b/dbaccess/source/ui/inc/TableCopyHelper.hxx @@ -26,14 +26,13 @@ #include <svtools/transfer.hxx> #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> -#include <functional> class SvTreeListEntry; namespace dbaui { class OGenericUnoController; - /// unary_function Functor object for class DataFlavorExVector::value_type returntype is bool - struct TAppSupportedSotFunctor : std::unary_function<DataFlavorExVector::value_type,bool> + /// Functor object for class DataFlavorExVector::value_type returntype is bool + struct TAppSupportedSotFunctor { ElementType eEntryType; TAppSupportedSotFunctor(const ElementType& _eEntryType) diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx index f8042af896e9..68981577cc6c 100644 --- a/dbaccess/source/ui/inc/WCopyTable.hxx +++ b/dbaccess/source/ui/inc/WCopyTable.hxx @@ -45,8 +45,7 @@ namespace dbaui { - typedef std::unary_function< OUString,bool> TColumnFindFunctorType; - class TColumnFindFunctor : public TColumnFindFunctorType + class TColumnFindFunctor { public: virtual bool operator()(const OUString& _sColumnName) const = 0; diff --git a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx index bd08fe05087f..bcde5918a1f7 100644 --- a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx +++ b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx @@ -24,8 +24,6 @@ #include <comphelper/namedvaluecollection.hxx> #include <vcl/window.hxx> -#include <functional> - using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -119,7 +117,7 @@ OUString OTableFieldDesc::GetCriteria( sal_uInt16 nIdx ) const namespace { - struct SelectPropertyValueAsString : public std::unary_function< PropertyValue, OUString > + struct SelectPropertyValueAsString { OUString operator()( const PropertyValue& i_rPropValue ) const { |