Kaydet (Commit) 1dea7fb6 authored tarafından dcvb's avatar dcvb Kaydeden (comit) Noel Grandin

make binary functor unary, related tdf#108782

PropertyValueEqualFunctor was only used as unary functor with
std::bind2nd

Change-Id: Ic91e49de360e04ec5250f2d63f49163a8e7c7b92
Reviewed-on: https://gerrit.libreoffice.org/39624Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 432f7668
...@@ -64,14 +64,17 @@ namespace accessibility ...@@ -64,14 +64,17 @@ namespace accessibility
{ {
typedef std::vector< beans::PropertyValue > PropertyValueVector; typedef std::vector< beans::PropertyValue > PropertyValueVector;
class PropertyValueEqualFunctor : public std::binary_function< beans::PropertyValue, beans::PropertyValue, bool > class PropertyValueEqualFunctor
{ {
const beans::PropertyValue& m_rPValue;
public: public:
PropertyValueEqualFunctor() explicit PropertyValueEqualFunctor(const beans::PropertyValue& rPValue)
: m_rPValue(rPValue)
{} {}
bool operator() ( const beans::PropertyValue& lhs, const beans::PropertyValue& rhs ) const bool operator() ( const beans::PropertyValue& rhs ) const
{ {
return ( lhs.Name == rhs.Name && lhs.Value == rhs.Value ); return ( m_rPValue.Name == rhs.Name && m_rPValue.Value == rhs.Value );
} }
}; };
sal_Unicode const cNewLine(0x0a); sal_Unicode const cNewLine(0x0a);
...@@ -915,7 +918,7 @@ namespace accessibility ...@@ -915,7 +918,7 @@ namespace accessibility
{ {
const beans::PropertyValue* pItr = aSeq.getConstArray(); const beans::PropertyValue* pItr = aSeq.getConstArray();
const beans::PropertyValue* pEnd = pItr + aSeq.getLength(); const beans::PropertyValue* pEnd = pItr + aSeq.getLength();
const beans::PropertyValue* pFind = std::find_if( pItr, pEnd, std::bind2nd( PropertyValueEqualFunctor(), std::cref( *aItr ) ) ); const beans::PropertyValue* pFind = std::find_if( pItr, pEnd, PropertyValueEqualFunctor(*aItr) );
if ( pFind != pEnd ) if ( pFind != pEnd )
{ {
aIntersectionVec.push_back( *pFind ); aIntersectionVec.push_back( *pFind );
...@@ -953,7 +956,7 @@ namespace accessibility ...@@ -953,7 +956,7 @@ namespace accessibility
{ {
const beans::PropertyValue* pItr = aIntersectionSeq.getConstArray(); const beans::PropertyValue* pItr = aIntersectionSeq.getConstArray();
const beans::PropertyValue* pEnd = pItr + aIntersectionSeq.getLength(); const beans::PropertyValue* pEnd = pItr + aIntersectionSeq.getLength();
bool bNone = std::none_of( pItr, pEnd, std::bind2nd( PropertyValueEqualFunctor(), std::cref( pDefAttr[i] ) ) ); bool bNone = std::none_of( pItr, pEnd, PropertyValueEqualFunctor( pDefAttr[i] ) );
if ( bNone && pDefAttr[i].Handle != 0) if ( bNone && pDefAttr[i].Handle != 0)
{ {
aDiffVec.push_back( pDefAttr[i] ); aDiffVec.push_back( pDefAttr[i] );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment