]> git.lyx.org Git - lyx.git/blobdiff - src/FloatList.C
More fixes to insettabular/text (and some missing features added).
[lyx.git] / src / FloatList.C
index 61ac278a5dd067a6b62cd874c4c1baf9d29ca350..66e9adcc6b910ef24395695b7c06808d9ff39706 100644 (file)
@@ -9,49 +9,47 @@
 FloatList::FloatList()
 {
        // Insert the latex builtin float-types
-       Floating table;
-       table.type = "table";
-       table.placement = "";
-       table.ext = "lot";
-       table.within = "";
-       table.style = "";
-       table.name = "";
-       table.builtin = true;
-       list[table.type] = table;
-       Floating figure;
-       figure.type = "figure";
-       figure.placement = "";
-       figure.ext = "lof";
-       figure.within = "";
-       figure.style = "";
-       figure.name = "";
-       figure.builtin = true;
-       list[figure.type] = figure;
+
+       // table
+       Floating table("table", "htbp", "lot", "", "plain", "Table", true);
+       list[table.type()] = table;
+
+       // figure
+       Floating figure("figure", "htbp", "lof", "", "plain", "Figure", true);
+       list[figure.type()] = figure;
+       
        // And we add algorithm too since LyX has
-       // supported that for a long time
-       Floating algorithm;
-       algorithm.type = "algorithm";
-       algorithm.placement = "htbp";
-       algorithm.ext = "loa";
-       algorithm.within = "";
-       algorithm.style = "ruled";
-       algorithm.name = "Algorithm";
-       algorithm.builtin = false;
-       list[algorithm.type] = algorithm;
+       // supported that for a long time,
+       // but support for this should probably be moved to a layout file.
+       Floating algorithm("algorithm", "htbp", "loa",
+                          "", "ruled", "Algorithm");
+       list[algorithm.type()] = algorithm;
+}
+
+
+FloatList::const_iterator FloatList::begin() const 
+{
+       return list.begin();
+}
+
+
+FloatList::const_iterator FloatList::end() const 
+{
+       return list.end();
 }
 
 
 void FloatList::newFloat(Floating const & fl)
 {
-       list[fl.type] = fl;
+       list[fl.type()] = fl;
 }
 
 
-string FloatList::defaultPlacement(string const & t) const
+string const FloatList::defaultPlacement(string const & t) const
 {
        List::const_iterator cit = list.find(t);
        if (cit != list.end())
-               return (*cit).second.placement;
+               return (*cit).second.placement();
        return string();
 }
 
@@ -77,5 +75,12 @@ Floating const & FloatList::getType(string const & t) const
 #endif
 }
 
+
+FloatList::const_iterator FloatList::operator[](string const & t) const
+{
+       return list.find(t);
+}
+
+
 // The global floatlist
 FloatList floatList;