[Libreoffice-commits] core.git: editeng/source

dcvb sdfgh at sdfg.com
Thu Jul 6 18:22:32 UTC 2017


 editeng/source/accessibility/AccessibleStaticTextBase.cxx |   15 ++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 1dea7fb6be5f1ba64f680e3ad885afa1c99030bf
Author: dcvb <sdfgh at sdfg.com>
Date:   Thu Jul 6 10:04:39 2017 +0200

    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/39624
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
index e607d30a6a4f..2fca44ce48c3 100644
--- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx
+++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
@@ -64,14 +64,17 @@ namespace accessibility
 {
     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:
-        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);
@@ -915,7 +918,7 @@ namespace accessibility
             {
                 const beans::PropertyValue* pItr = aSeq.getConstArray();
                 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 )
                 {
                     aIntersectionVec.push_back( *pFind );
@@ -953,7 +956,7 @@ namespace accessibility
         {
             const beans::PropertyValue* pItr = aIntersectionSeq.getConstArray();
             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)
             {
                 aDiffVec.push_back( pDefAttr[i] );


More information about the Libreoffice-commits mailing list