]> git.lyx.org Git - lyx.git/blobdiff - src/BufferList.cpp
Compile fix.
[lyx.git] / src / BufferList.cpp
index b68dea9a3ae37a3d961e4694545226e5300a044a..466c924bdb2db851a29fb013703ddb4870966626 100644 (file)
@@ -36,8 +36,8 @@
 
 #include <algorithm>
 #include <functional>
-
-
+#include <iterator>
+#include <memory>
 
 using namespace std;
 using namespace lyx::support;
@@ -255,12 +255,12 @@ Buffer * BufferList::getBuffer(support::FileName const & fname) const
 {
        // 1) cheap test, using string comparison of file names
        BufferStorage::const_iterator it = find_if(bstore.begin(), bstore.end(),
-               bind(equal_to<FileName>(), bind(&Buffer::fileName, _1), fname));
+               lyx::bind(equal_to<FileName>(), lyx::bind(&Buffer::fileName, _1), fname));
        if (it != bstore.end())
                        return *it;
        // 2) possibly expensive test, using equivalence test of file names
        it = find_if(bstore.begin(), bstore.end(),
-               bind(equivalent_to(), bind(&Buffer::fileName, _1), fname));
+               lyx::bind(equivalent_to(), lyx::bind(&Buffer::fileName, _1), fname));
        return it != bstore.end() ? (*it) : 0;
 }
 
@@ -272,15 +272,14 @@ Buffer * BufferList::getBufferFromTmp(string const & s)
        for (; it < end; ++it) {
                if (prefixIs(s, (*it)->temppath())) {
                        // check whether the filename matches the master
-                       string const master_name = changeExtension(onlyFileName(
-                                               (*it)->absFileName()), ".tex");
+                       string const master_name = (*it)->latexName();
                        if (suffixIs(s, master_name))
                                return *it;
                        // if not, try with the children
-                       vector<Buffer *> clist = (*it)->getChildren();
-                       vector<Buffer *>::const_iterator cit = clist.begin();
-                       vector<Buffer *>::const_iterator cend = clist.end();
-                       for (; cit < cend; ++cit) {
+                       ListOfBuffers clist = (*it)->getDescendents();
+                       ListOfBuffers::const_iterator cit = clist.begin();
+                       ListOfBuffers::const_iterator cend = clist.end();
+                       for (; cit != cend; ++cit) {
                                string const mangled_child_name = DocFileName(
                                        changeExtension((*cit)->absFileName(),
                                                ".tex")).mangledFileName();