diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-07 16:28:27 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-27 08:20:43 +0000 |
commit | 644487a1152c7586a7f20c7f372572a71d8494d5 (patch) | |
tree | 683cdbd755ec1660e75f930e5be4cd6867e3e734 /include/oox | |
parent | 1b4dff2c371d31c99f34324c3f6f31888bdc34d7 (diff) |
loplugin:unusedmethods
Change-Id: I161cd52606c11b6008f5d8b1d8ee391692f91861
Reviewed-on: https://gerrit.libreoffice.org/19231
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/oox')
-rw-r--r-- | include/oox/helper/containerhelper.hxx | 38 | ||||
-rw-r--r-- | include/oox/helper/helper.hxx | 28 | ||||
-rw-r--r-- | include/oox/helper/refmap.hxx | 39 | ||||
-rw-r--r-- | include/oox/helper/refvector.hxx | 28 | ||||
-rw-r--r-- | include/oox/ole/axbinarywriter.hxx | 3 | ||||
-rw-r--r-- | include/oox/vml/vmlshapecontainer.hxx | 10 |
6 files changed, 0 insertions, 146 deletions
diff --git a/include/oox/helper/containerhelper.hxx b/include/oox/helper/containerhelper.hxx index 9894c0040d18..2016d3dee55a 100644 --- a/include/oox/helper/containerhelper.hxx +++ b/include/oox/helper/containerhelper.hxx @@ -240,36 +240,18 @@ public: static const typename VectorType::value_type& getVectorElement( const VectorType& rVector, sal_Int32 nIndex, const typename VectorType::value_type& rDefault ); - /** Returns the reference to an existing element of the passed vector, or - the passed default value, if the passed index is out of bounds. */ - template< typename VectorType > - static typename VectorType::value_type& - getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault ); - /** Returns the pointer to an existing element of the passed map, or a null pointer, if an element with the passed key does not exist. */ template< typename MapType > static const typename MapType::mapped_type* getMapElement( const MapType& rMap, const typename MapType::key_type& rKey ); - /** Returns the pointer to an existing element of the passed map, or a null - pointer, if an element with the passed key does not exist. */ - template< typename MapType > - static typename MapType::mapped_type* - getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey ); - /** Returns the reference to an existing element of the passed map, or the passed default value, if an element with the passed key does not exist. */ template< typename MapType > static const typename MapType::mapped_type& getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault ); - /** Returns the reference to an existing element of the passed map, or the - passed default value, if an element with the passed key does not exist. */ - template< typename MapType > - static typename MapType::mapped_type& - getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault ); - // vector/map/matrix to UNO sequence -------------------------------------- /** Creates a UNO sequence from a std::vector with copies of all elements. @@ -316,12 +298,6 @@ template< typename VectorType > return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault; } -template< typename VectorType > -/*static*/ typename VectorType::value_type& ContainerHelper::getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault ) -{ - return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault; -} - template< typename MapType > /*static*/ const typename MapType::mapped_type* ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey ) { @@ -330,26 +306,12 @@ template< typename MapType > } template< typename MapType > -/*static*/ typename MapType::mapped_type* ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey ) -{ - typename MapType::iterator aIt = rMap.find( rKey ); - return (aIt == rMap.end()) ? 0 : &aIt->second; -} - -template< typename MapType > /*static*/ const typename MapType::mapped_type& ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault ) { typename MapType::const_iterator aIt = rMap.find( rKey ); return (aIt == rMap.end()) ? rDefault : aIt->second; } -template< typename MapType > -/*static*/ typename MapType::mapped_type& ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault ) -{ - typename MapType::iterator aIt = rMap.find( rKey ); - return (aIt == rMap.end()) ? rDefault : aIt->second; -} - template< typename VectorType > /*static*/ css::uno::Sequence< typename VectorType::value_type > ContainerHelper::vectorToSequence( const VectorType& rVector ) { diff --git a/include/oox/helper/helper.hxx b/include/oox/helper/helper.hxx index f36e6325ebd9..516c7a2567b4 100644 --- a/include/oox/helper/helper.hxx +++ b/include/oox/helper/helper.hxx @@ -166,19 +166,6 @@ inline void setFlag( Type& ornBitField, Type nMask, bool bSet = true ) if( bSet ) ornBitField |= nMask; else ornBitField &= ~nMask; } -/** Inserts a value into a bitfield. - - Inserts the lower nBitCount bits of nValue into ornBitField, starting - there at bit nStartBit. Other contents of ornBitField keep unchanged. - */ -template< typename Type, typename InsertType > -void insertValue( Type& ornBitField, InsertType nValue, sal_uInt8 nStartBit, sal_uInt8 nBitCount ) -{ - sal_uInt64 nMask = 1; nMask <<= nBitCount; --nMask; - Type nNewValue = static_cast< Type >( nValue & nMask ); - (ornBitField &= ~(nMask << nStartBit)) |= (nNewValue << nStartBit); -} - /** Optional value, similar to ::boost::optional<>, with convenience accessors. @@ -198,7 +185,6 @@ public: const Type& get() const { return maValue; } const Type& get( const Type& rDefValue ) const { return mbHasValue ? maValue : rDefValue; } - void reset() { mbHasValue = false; } void set( const Type& rValue ) { maValue = rValue; mbHasValue = true; } Type& use() { mbHasValue = true; return maValue; } @@ -256,13 +242,6 @@ public: #endif - /** Reads a value from memory, assuming memory buffer in little-endian. - @param ornValue (out-parameter) Contains the value read from memory. - @param pSrcBuffer The memory buffer to read the value from. - */ - template< typename Type > - inline static void readLittleEndian( Type& ornValue, const void* pSrcBuffer ); - /** Writes a value to memory, while converting it to little-endian. @param pDstBuffer The memory buffer to write the value to. @param nValue The value to be written to memory in little-endian. @@ -281,13 +260,6 @@ private: template< typename Type > -inline void ByteOrderConverter::readLittleEndian( Type& ornValue, const void* pSrcBuffer ) -{ - memcpy( &ornValue, pSrcBuffer, sizeof( Type ) ); - convertLittleEndian( ornValue ); -} - -template< typename Type > inline void ByteOrderConverter::writeLittleEndian( void* pDstBuffer, Type nValue ) { convertLittleEndian( nValue ); diff --git a/include/oox/helper/refmap.hxx b/include/oox/helper/refmap.hxx index e3efbfa4f961..1a40634fa117 100644 --- a/include/oox/helper/refmap.hxx +++ b/include/oox/helper/refmap.hxx @@ -82,14 +82,6 @@ public: /** Calls the passed member function of ObjType on every contained object, automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType > - void forEachMem( FuncType pFunc, ParamType aParam ) const - { - forEach( ::boost::bind( pFunc, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ template< typename FuncType, typename ParamType1, typename ParamType2 > void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const { @@ -104,14 +96,6 @@ public: forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); } - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3, typename ParamType4 > - void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3, ParamType4 aParam4 ) const - { - forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3, aParam4 ) ); - } - /** Calls the passed functor for every contained object. Passes the key as first argument and the object reference as second argument to rFunctor. */ @@ -129,29 +113,6 @@ public: forEachWithKey( ::boost::bind( pFunc, _2, _1 ) ); } - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as first argument to the member function. */ - template< typename FuncType, typename ParamType > - void forEachMemWithKey( FuncType pFunc, ParamType aParam ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2 > - void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > - void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) ); - } private: template< typename FunctorType > diff --git a/include/oox/helper/refvector.hxx b/include/oox/helper/refvector.hxx index b98d961e203f..eff649b718b0 100644 --- a/include/oox/helper/refvector.hxx +++ b/include/oox/helper/refvector.hxx @@ -54,10 +54,6 @@ public: return value_type(); } - /** Returns the index of the last element, or -1, if the vector is empty. - Does *not* check whether the last element is an empty reference. */ - sal_Int32 getLastIndex() const { return static_cast< sal_Int32 >( this->size() ) - 1; } - /** Calls the passed functor for every contained object, automatically skips all elements that are empty references. */ template< typename FunctorType > @@ -107,22 +103,6 @@ public: } /** Calls the passed member function of ObjType on every contained object. - Passes the vector index to the member function. */ - template< typename FuncType > - void forEachMemWithIndex( FuncType pFunc ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1 ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the vector index as first argument to the member function. */ - template< typename FuncType, typename ParamType > - void forEachMemWithIndex( FuncType pFunc, ParamType aParam ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object. Passes the vector index as first argument to the member function. */ template< typename FuncType, typename ParamType1, typename ParamType2 > void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const @@ -130,14 +110,6 @@ public: forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) ); } - /** Calls the passed member function of ObjType on every contained object. - Passes the vector index as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > - void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) ); - } - /** Searches for an element by using the passed functor that takes a constant reference of the object type (const ObjType&). */ template< typename FunctorType > diff --git a/include/oox/ole/axbinarywriter.hxx b/include/oox/ole/axbinarywriter.hxx index 3efd418dea64..ae3cdc124a45 100644 --- a/include/oox/ole/axbinarywriter.hxx +++ b/include/oox/ole/axbinarywriter.hxx @@ -59,9 +59,6 @@ public: /** Aligns the stream according to the passed type and reads a value. */ template< typename Type > void writeAligned( Type nVal ) { align( sizeof( Type ) ); writeValue( nVal ); } - /** Aligns the stream according to the passed type and skips the size of the type. */ - template< typename Type > - void padAligned() { align( sizeof( Type ) ); pad( sizeof( Type ) ); } private: BinaryOutputStream* mpOutStrm; ///< The wrapped input stream. diff --git a/include/oox/vml/vmlshapecontainer.hxx b/include/oox/vml/vmlshapecontainer.hxx index 6b2c3c67940f..cea21146d36c 100644 --- a/include/oox/vml/vmlshapecontainer.hxx +++ b/include/oox/vml/vmlshapecontainer.hxx @@ -75,10 +75,6 @@ public: @param bDeep True = searches in all group shapes too. */ const ShapeBase* getShapeById( const OUString& rShapeId, bool bDeep ) const; - /** Searches for a shape type by using the passed functor that takes a - constant reference of a ShapeType object. */ - template< typename Functor > - const ShapeType* findShapeType( const Functor& rFunctor ) const; /** Searches for a shape by using the passed functor that takes a constant reference of a ShapeBase object. */ template< typename Functor > @@ -132,12 +128,6 @@ ShapeT& ShapeContainer::createShape() } template< typename Functor > -const ShapeType* ShapeContainer::findShapeType( const Functor& rFunctor ) const -{ - return maTypes.findIf( rFunctor ).get(); -} - -template< typename Functor > const ShapeBase* ShapeContainer::findShape( const Functor& rFunctor ) const { return maShapes.findIf( rFunctor ).get(); |