* 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();
}
bstore.end(), buf);
LASSERT(it != bstore.end(), /**/);
++it;
- if (it == bstore.end())
- return bstore.front();
- else
- return *it;
+ Buffer * nextbuf = (it == bstore.end()) ? bstore.front() : *it;
+ return nextbuf;
}
BufferStorage::const_iterator it = find(bstore.begin(),
bstore.end(), buf);
LASSERT(it != bstore.end(), /**/);
- if (it == bstore.begin())
- return bstore.back();
- else
- return *(it - 1);
+
+ Buffer * previousbuf = (it == bstore.begin()) ? bstore.back() : *(it - 1);
+ 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();