lyx_mirror/src/frontends/WorkAreaManager.cpp
Abdelrazak Younes f0402e69c6 Fix some issues with buffer closing.
* Switch WorkAreaManager to std::list instead of vector.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20664 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-02 14:39:48 +00:00

59 lines
934 B
C++

// -*- C++ -*-
/**
* \file WorkAreaManager.cpp
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Abdelrazak Younes
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "WorkArea.h"
#include "WorkAreaManager.h"
using std::list;
namespace lyx {
namespace frontend {
void WorkAreaManager::add(WorkArea * wa)
{
work_areas_.push_back(wa);
}
void WorkAreaManager::remove(WorkArea * wa)
{
work_areas_.remove(wa);
}
void WorkAreaManager::redrawAll()
{
for (list<WorkArea *>::iterator it = work_areas_.begin();
it != work_areas_.end(); ) {
(*it)->redraw();
++it;
}
}
void WorkAreaManager::closeAll()
{
for (list<WorkArea *>::iterator it = work_areas_.begin();
it != work_areas_.end(); ) {
(*it)->close();
if (work_areas_.empty())
break;
++it;
}
}
} // namespace frontend
} // namespace lyx