Prepare ANNOUNCE and NEWS for rc2
[lyx.git] / src / FloatList.cpp
blob20bbf6713ae97da0ca56294ad77be2b579a0ec47
1 /**
2 * \file FloatList.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS.
9 */
11 #include <config.h>
13 #include "FloatList.h"
14 #include "Floating.h"
16 using namespace std;
18 namespace lyx {
20 FloatList::FloatList()
24 FloatList::const_iterator FloatList::begin() const
26 return list.begin();
30 FloatList::const_iterator FloatList::end() const
32 return list.end();
36 void FloatList::newFloat(Floating const & fl)
38 list[fl.type()] = fl;
42 string const FloatList::defaultPlacement(string const & t) const
44 List::const_iterator cit = list.find(t);
45 if (cit != list.end())
46 return cit->second.placement();
47 return string();
51 bool FloatList::typeExist(string const & t) const
53 List::const_iterator cit = list.find(t);
54 return cit != list.end();
58 Floating const & FloatList::getType(string const & t) const
60 // I wish we could use exceptions
61 List::const_iterator cit = list.find(t);
62 if (cit != list.end())
63 return cit->second;
64 #ifdef HAVE_EXCEPTIONS
65 throw UnknownFloatType(t);
66 #else
67 static Floating empty_float;
68 return empty_float;
69 #endif
73 void FloatList::erase(string const & t)
75 list.erase(t);
79 FloatList::const_iterator FloatList::operator[](string const & t) const
81 return list.find(t);
85 } // namespace lyx