]> git.lyx.org Git - lyx.git/blobdiff - src/BufferList.cpp
Cmake build: support tests
[lyx.git] / src / BufferList.cpp
index c107862c6d650884eaba55b47b9cbd0b6189eb55..f756384bf455a4f9aab2b9b28b50aab3d38f2258 100644 (file)
@@ -104,7 +104,29 @@ void BufferList::release(Buffer * buf)
 }
 
 
+Buffer * BufferList::newInternalBuffer(string const & s)
+{
+       Buffer * const buf = createNewBuffer(s);
+       if (buf) {
+               buf->setInternal(true);
+               binternal.push_back(buf);
+       }
+       return buf;
+}
+
+
 Buffer * BufferList::newBuffer(string const & s)
+{
+       Buffer * const buf = createNewBuffer(s);
+       if (buf) {
+               LYXERR(Debug::INFO, "Assigning to buffer " << bstore.size());
+               bstore.push_back(buf);
+       }
+       return buf;
+}
+
+
+Buffer * BufferList::createNewBuffer(string const & s)
 {
        auto_ptr<Buffer> tmpbuf;
        try {
@@ -119,12 +141,6 @@ Buffer * BufferList::newBuffer(string const & s)
                }
        }
        tmpbuf->params().useClassDefaults();
-       if (tmpbuf->isInternal()) {
-               binternal.push_back(tmpbuf.get());
-       } else {
-               LYXERR(Debug::INFO, "Assigning to buffer " << bstore.size());
-               bstore.push_back(tmpbuf.get());
-       }
        return tmpbuf.release();
 }
 
@@ -205,8 +221,10 @@ Buffer * BufferList::previous(Buffer const * buf) const
 
 
 void BufferList::updateIncludedTeXfiles(string const & masterTmpDir,
-                                       OutputParams const & runparams)
+                                       OutputParams const & runparams_in)
 {
+       OutputParams runparams = runparams_in;
+       runparams.is_child = true;
        BufferStorage::iterator it = bstore.begin();
        BufferStorage::iterator end = bstore.end();
        for (; it != end; ++it) {
@@ -217,6 +235,7 @@ void BufferList::updateIncludedTeXfiles(string const & masterTmpDir,
                        (*it)->markDepClean(masterTmpDir);
                }
        }
+       runparams.is_child = false;
 }