* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
*
* Full author contact details are available in file CREDITS.
*/
{}
+BufferList::~BufferList()
+{
+ BufferStorage::iterator it = binternal.begin();
+ BufferStorage::iterator end = binternal.end();
+ for (; it != end; ++it)
+ delete (*it);
+}
+
+
bool BufferList::empty() const
{
return bstore.empty();
}
}
tmpbuf->params().useClassDefaults();
- LYXERR(Debug::INFO, "Assigning to buffer " << bstore.size());
- bstore.push_back(tmpbuf.get());
+ if (tmpbuf->fileName().extension() == "internal") {
+ binternal.push_back(tmpbuf.get());
+ } else {
+ LYXERR(Debug::INFO, "Assigning to buffer " << bstore.size());
+ bstore.push_back(tmpbuf.get());
+ }
return tmpbuf.release();
}
LASSERT(it != bstore.end(), /**/);
++it;
Buffer * nextbuf = (it == bstore.end()) ? bstore.front() : *it;
- if (nextbuf->fileName().extension() == "internal")
- return next(nextbuf);
return nextbuf;
}
LASSERT(it != bstore.end(), /**/);
Buffer * previousbuf = (it == bstore.begin()) ? bstore.back() : *(it - 1);
- if (previousbuf->fileName().extension() == "internal")
- return previous(previousbuf);
return previousbuf;
}
bool BufferList::isLoaded(Buffer const * b) const
{
- LASSERT(b, /**/);
BufferStorage::const_iterator cit =
find(bstore.begin(), bstore.end(), b);
return cit != bstore.end();