}
-FileNameList const & BufferList::fileNames() const
+FileNameList BufferList::fileNames() const
{
- static FileNameList nvec;
- nvec.clear();
+ FileNameList nvec;
BufferStorage::const_iterator it = bstore.begin();
BufferStorage::const_iterator end = bstore.end();
for (; it != end; ++it) {
int BufferList::bufferNum(FileName const & fname) const
{
- FileNameList const & buffers = fileNames();
+ FileNameList const buffers(fileNames());
FileNameList::const_iterator cit =
find(buffers.begin(), buffers.end(), fname);
if (cit == buffers.end())
void closeAll();
/// returns a vector with all the buffers filenames
- support::FileNameList const & fileNames() const;
+ support::FileNameList fileNames() const;
/// return true if no buffers loaded
bool empty() const;
// insert buffer list
bufferCO->clear();
- FileNameList const & buffers = theBufferList().fileNames();
+ FileNameList const buffers(theBufferList().fileNames());
for (FileNameList::const_iterator it = buffers.begin();
it != buffers.end(); ++it) {
bufferCO->addItem(toqstr(makeDisplayPath(it->absFileName())));
refs_.clear();
int const the_buffer = bufferCO->currentIndex();
if (the_buffer != -1) {
- FileName const & name = theBufferList().fileNames()[the_buffer];
+ FileNameList const names(theBufferList().fileNames());
+ FileName const & name = names[the_buffer];
Buffer const * buf = theBufferList().getBuffer(name);
buf->getLabelList(refs_);
}