]> git.lyx.org Git - lyx.git/blobdiff - src/BufferList.cpp
GuiBox.cpp: fix this issue: horizontal box alignment is only possible without inner...
[lyx.git] / src / BufferList.cpp
index 61d62206a3f3e35e740c74f2cf25022e331d2370..f9a89f78b239eea29deb6dcfa79b4f7a48e73a53 100644 (file)
 #include "support/Package.h"
 
 #include "support/lassert.h"
-#include <boost/bind.hpp>
+#include "support/bind.h"
 
 #include <algorithm>
 #include <functional>
-
-using boost::bind;
+#include <iterator>
+#include <memory>
 
 using namespace std;
 using namespace lyx::support;
@@ -142,7 +142,7 @@ FileNameList const & BufferList::fileNames() const
        nvec.clear();
        transform(bstore.begin(), bstore.end(),
                  back_inserter(nvec),
-                 boost::bind(&Buffer::fileName, _1));
+                 bind(&Buffer::fileName, _1));
        return nvec;
 }
 
@@ -232,8 +232,10 @@ bool BufferList::exists(FileName const & fname) const
 }
 
 
-bool BufferList::isLoaded(Buffer const * b) const
+ bool BufferList::isLoaded(Buffer const * b) const
 {
+       if (!b)
+               return false;
        BufferStorage::const_iterator cit =
                find(bstore.begin(), bstore.end(), b);
        return cit != bstore.end();
@@ -270,8 +272,7 @@ 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
@@ -281,7 +282,7 @@ Buffer * BufferList::getBufferFromTmp(string const & s)
                        for (; cit < cend; ++cit) {
                                string const mangled_child_name = DocFileName(
                                        changeExtension((*cit)->absFileName(),
-                                               ".tex")).mangledFilename();
+                                               ".tex")).mangledFileName();
                                if (suffixIs(s, mangled_child_name))
                                        return *cit;
                        }