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

Jochen Nitschke j.nitschke+logerrit at ok.de
Wed Jul 5 06:39:47 UTC 2017


 shell/source/unix/sysshell/recently_used_file_handler.cxx |   19 +++-----------
 1 file changed, 5 insertions(+), 14 deletions(-)

New commits:
commit 11c8f511779d133229e384b25636e0bba28b3089
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Tue Jul 4 13:52:05 2017 +0200

    tdf#108287 replace std::bind2nd with lambda
    
    in preparation of removal of deprecated std::binary_function
    
    Change-Id: Iabb02b100975f67665be9d6d562b7206ef846107
    Reviewed-on: https://gerrit.libreoffice.org/39513
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/shell/source/unix/sysshell/recently_used_file_handler.cxx b/shell/source/unix/sysshell/recently_used_file_handler.cxx
index cf7dad8e5c0f..e9686512d079 100644
--- a/shell/source/unix/sysshell/recently_used_file_handler.cxx
+++ b/shell/source/unix/sysshell/recently_used_file_handler.cxx
@@ -34,7 +34,6 @@
 #include <map>
 #include <vector>
 #include <algorithm>
-#include <functional>
 #include <string.h>
 #include <time.h>
 
@@ -50,18 +49,6 @@ namespace /* private */ {
     #define TAG_GROUPS       "Groups"
     #define TAG_GROUP        "Group"
 
-
-    // compare two string_t's case insensitive, may also be done
-    // by specifying special traits for the string type but in this
-    // case it's easier to do it this way
-    struct str_icase_cmp :
-        public std::binary_function<string_t, string_t, bool>
-    {
-        bool operator() (const string_t& s1, const string_t& s2) const
-        { return (0 == strcasecmp(s1.c_str(), s2.c_str())); }
-    };
-
-
     struct recently_used_item
     {
         recently_used_item()
@@ -116,7 +103,11 @@ namespace /* private */ {
             return (has_groups() &&
                     iter_end != std::find_if(
                         groups_.begin(), iter_end,
-                        std::bind2nd(str_icase_cmp(), name)));
+                        [&name](const string_t& s)
+                        { return (0 == strcasecmp(s.c_str(), name.c_str())); })
+                        // compare two string_t's case insensitive
+                   );
+
         }
 
         void write_xml(const recently_used_file& file) const


More information about the Libreoffice-commits mailing list