]> git.lyx.org Git - lyx.git/blobdiff - src/bufferlist.C
Fix #1736
[lyx.git] / src / bufferlist.C
index b43b07a9e0e7ffc59b53e1ab563e679559816454..9eedebeffe85d29ab31e61d66f98691674297872 100644 (file)
 #include "frontends/Alert.h"
 
 #include "support/filetools.h"
-#include "support/lyxfunctional.h"
 
 #include <boost/bind.hpp>
 
+#include <algorithm>
+#include <functional>
+
 using lyx::support::AddName;
 using lyx::support::bformat;
 using lyx::support::GetEnvPath;
@@ -44,11 +46,14 @@ using boost::bind;
 
 using std::auto_ptr;
 using std::endl;
+using std::equal_to;
 using std::find;
 using std::find_if;
 using std::for_each;
 using std::string;
 using std::vector;
+using std::back_inserter;
+using std::transform;
 
 
 BufferList::BufferList()
@@ -195,8 +200,9 @@ bool BufferList::close(Buffer * buf, bool ask)
 vector<string> const BufferList::getFileNames() const
 {
        vector<string> nvec;
-       std::copy(bstore.begin(), bstore.end(),
-                 lyx::back_inserter_fun(nvec, &Buffer::fileName));
+       transform(bstore.begin(), bstore.end(),
+                 back_inserter(nvec),
+                 boost::bind(&Buffer::fileName, _1));
        return nvec;
 }
 
@@ -332,7 +338,9 @@ void BufferList::emergencyWrite(Buffer * buf)
 bool BufferList::exists(string const & s) const
 {
        return find_if(bstore.begin(), bstore.end(),
-                      lyx::compare_memfun(&Buffer::fileName, s))
+                      bind(equal_to<string>(),
+                           bind(&Buffer::fileName, _1),
+                           s))
                != bstore.end();
 }
 
@@ -350,7 +358,10 @@ Buffer * BufferList::getBuffer(string const & s)
 {
        BufferStorage::iterator it =
                find_if(bstore.begin(), bstore.end(),
-                       lyx::compare_memfun(&Buffer::fileName, s));
+                       bind(equal_to<string>(),
+                            bind(&Buffer::fileName, _1),
+                            s));
+
        return it != bstore.end() ? (*it) : 0;
 }