diff options
author | Noel Grandin <noel@peralex.com> | 2015-09-30 10:29:19 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-01 10:43:24 +0000 |
commit | 58aea3f36c14414f95668e229a7350598f6c53a8 (patch) | |
tree | 70c115dffd44576313cefd49e4164d293895e4bd /chart2/source/inc | |
parent | 3fcbfe10857631212d8b8db9a079bb9692ed78bc (diff) |
loplugin:unusedmethods
- improvements to the plugin to find more method calls
- improvements to python script to remove more false+
- fix the FORCE_COMPILE_ALL build flag to include code in
the $WORKDIR
Change-Id: I4d6015dcb9b9d60c26f0bcee8abad807177a7836
Reviewed-on: https://gerrit.libreoffice.org/19064
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'chart2/source/inc')
-rw-r--r-- | chart2/source/inc/CloneHelper.hxx | 21 | ||||
-rw-r--r-- | chart2/source/inc/CommonFunctors.hxx | 15 | ||||
-rw-r--r-- | chart2/source/inc/ContainerHelper.hxx | 40 | ||||
-rw-r--r-- | chart2/source/inc/DisposeHelper.hxx | 6 | ||||
-rw-r--r-- | chart2/source/inc/EventListenerHelper.hxx | 44 |
5 files changed, 0 insertions, 126 deletions
diff --git a/chart2/source/inc/CloneHelper.hxx b/chart2/source/inc/CloneHelper.hxx index 2545f579c737..24e5f1c25611 100644 --- a/chart2/source/inc/CloneHelper.hxx +++ b/chart2/source/inc/CloneHelper.hxx @@ -77,27 +77,6 @@ template< class Interface > CreateRefClone< Interface >()); } -template< typename Key, class Interface > - void CloneRefPairVector( - const ::std::vector< ::std::pair< Key, Interface > > & rSource, - ::std::vector< ::std::pair< Key, Interface > > & rDestination ) -{ - ::std::transform( rSource.begin(), rSource.end(), - ::std::back_inserter( rDestination ), - CreateRefWithKeyClone< Key, Interface >()); -} - -/// clones a map of elements with a UNO-Reference as value -template< typename Key, class Interface > - void CloneRefMap( - const ::std::map< Key, Interface > & rSource, - ::std::map< Key, Interface > & rDestination ) -{ - ::std::transform( rSource.begin(), rSource.end(), - ::std::inserter( rDestination, rDestination.begin() ), - CreateRefWithKeyClone< const Key, Interface >()); -} - /// clones a UNO-sequence of UNO-References template< class Interface > void CloneRefSequence( diff --git a/chart2/source/inc/CommonFunctors.hxx b/chart2/source/inc/CommonFunctors.hxx index d998069b93ae..89041739a464 100644 --- a/chart2/source/inc/CommonFunctors.hxx +++ b/chart2/source/inc/CommonFunctors.hxx @@ -174,21 +174,6 @@ private: Value m_aValueToCompareWith; }; -/** Searches for data in a given map, i.e. not for the key but for the data - pointed to by the keys. - - To find a key (value) you can use rMap.find( rValue ) - */ -template< class MapType > - inline typename MapType::const_iterator - findValueInMap( const MapType & rMap, const typename MapType::mapped_type & rData ) -{ - return ::std::find_if( rMap.begin(), rMap.end(), - [&rData] - ( const typename MapType::value_type& cp ) - { return rData == cp.second; } ); -} - } // namespace CommonFunctors } // namespace chart diff --git a/chart2/source/inc/ContainerHelper.hxx b/chart2/source/inc/ContainerHelper.hxx index 4f3232b31dbc..7c7284acf888 100644 --- a/chart2/source/inc/ContainerHelper.hxx +++ b/chart2/source/inc/ContainerHelper.hxx @@ -73,32 +73,6 @@ template< class Container > return aResult; } -/** converts a UNO sequence into a standard container. For convenience see the - methods SequenceToVector, etc. below. (In contrast to - SequenceToSTLSequenceContainer this works for all standard containers) - - input: uno::Sequence - output: a standard container that has an insert( iterator, key ) method (all - standard containers) - note: for containers implementing the Concept of a Sequence (vector, deque, - list, slist) use SequenceToSTLSequenceContainer for better speed - - example: - - Sequence< sal_Int32 > aSequence; - ::std::set< sal_Int32 > aVector( - ContainerToSequence::SequenceToSTLContainer< ::std::set< sal_Int32 > >( aSequence ); -*/ -template< class Container > - Container - SequenceToSTLContainer( const ::com::sun::star::uno::Sequence< typename Container::value_type > & rSeq ) -{ - Container aResult; - ::std::copy( rSeq.begin(), rSeq.end(), - ::std::inserter< Container >( aResult, aResult.begin())); - return aResult; -} - // concrete container methods for convenience /** converts a UNO sequence into a standard vector of same value type @@ -115,20 +89,6 @@ template< typename T > return SequenceToSTLSequenceContainer< ::std::vector< T > >( rSeq ); } -/** converts a UNO sequence into a standard set of same value type - - example: - - Sequence< sal_Int32 > aSequence; - ::std::set< sal_Int32 > aVector( ContainerHelper::SequenceToSet( aSequence )); - */ -template< typename T > - ::std::set< T > - SequenceToSet( const ::com::sun::star::uno::Sequence< T > & rSeq ) -{ - return SequenceToSTLContainer< ::std::set< T > >( rSeq ); -} - /** converts the keys of a Pair Associative Container into a UNO sequence example: diff --git a/chart2/source/inc/DisposeHelper.hxx b/chart2/source/inc/DisposeHelper.hxx index d89d31ecb0d2..44b54edc7508 100644 --- a/chart2/source/inc/DisposeHelper.hxx +++ b/chart2/source/inc/DisposeHelper.hxx @@ -80,12 +80,6 @@ template< class Container > ::std::for_each( rContainer.begin(), rContainer.end(), DisposeFunctor< typename Container::value_type >()); } -template< class Map > - void DisposeAllMapElements( Map & rContainer ) -{ - ::std::for_each( rContainer.begin(), rContainer.end(), DisposeSecondOfPairFunctor< typename Map::value_type >()); -} - } // namespace DisposeHelper } // namespace chart diff --git a/chart2/source/inc/EventListenerHelper.hxx b/chart2/source/inc/EventListenerHelper.hxx index 8872eb87f402..6fe8b9f0e9ff 100644 --- a/chart2/source/inc/EventListenerHelper.hxx +++ b/chart2/source/inc/EventListenerHelper.hxx @@ -137,28 +137,6 @@ void addListenerToAllElements( impl::addListenerFunctor< typename Container::value_type >( xListener )); } -template< class Container > -void addListenerToAllMapElements( - const Container & rContainer, - const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XEventListener > & xListener ) -{ - if( xListener.is()) - ::std::for_each( rContainer.begin(), rContainer.end(), - impl::addListenerToMappedElementFunctor< typename Container::value_type >( xListener )); -} - -template< typename T > -void addListenerToAllSequenceElements( - const ::com::sun::star::uno::Sequence< T > & rSequence, - const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XEventListener > & xListener ) -{ - if( xListener.is()) - ::std::for_each( rSequence.getConstArray(), rSequence.getConstArray() + rSequence.getLength(), - impl::addListenerFunctor< T >( xListener )); -} - template< class InterfaceRef > void removeListener( const InterfaceRef & xObject, @@ -183,28 +161,6 @@ void removeListenerFromAllElements( impl::removeListenerFunctor< typename Container::value_type >( xListener )); } -template< class Container > -void removeListenerFromAllMapElements( - const Container & rContainer, - const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XEventListener > & xListener ) -{ - if( xListener.is()) - ::std::for_each( rContainer.begin(), rContainer.end(), - impl::removeListenerFromMappedElementFunctor< typename Container::value_type >( xListener )); -} - -template< typename T > -void removeListenerFromAllSequenceElements( - const ::com::sun::star::uno::Sequence< T > & rSequence, - const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XEventListener > & xListener ) -{ - if( xListener.is()) - ::std::for_each( rSequence.getConstArray(), rSequence.getConstArray() + rSequence.getLength(), - impl::removeListenerFunctor< T >( xListener )); -} - } // namespace EventListenerHelper } // namespace chart |