Kaydet (Commit) 11c8f511 authored tarafından Jochen Nitschke's avatar Jochen Nitschke Kaydeden (comit) Noel Grandin

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/39513Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 6e3a5631
......@@ -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
......
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