]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetfloatlist.C
Revert this change as it sneaked in and wasn't discussed yet.
[lyx.git] / src / insets / insetfloatlist.C
index e40876460ef34a0686f9d84b3bc5e696f33a8b7f..7c146848c2179004318197eec0d3ffb9fae5dcf0 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "insetfloatlist.h"
 #include "FloatList.h"
+#include "LaTeXFeatures.h"
 #include "frontends/Dialogs.h"
 #include "LyXView.h"
 #include "BufferView.h"
@@ -33,12 +34,11 @@ InsetFloatList::InsetFloatList(string const & type)
 
 string const InsetFloatList::getScreenLabel(Buffer const *) const
 {
-       string const guiName = floatList[getCmdName()]->second.name();
-       if (!guiName.empty()) {
-               string const res = _(guiName) + _(" List");
-               return res;
-       }
-       return _("ERROR: Nonexistent float type!");
+       FloatList::const_iterator it = floatList[getCmdName()];
+       if (it != floatList.end())
+               return _(it->second.listName());
+       else
+               return _("ERROR: Nonexistent float type!");
 }
 
 
@@ -60,7 +60,9 @@ void InsetFloatList::read(Buffer const *, LyXLex & lex)
 
        if (lex.eatLine()) {
                setCmdName(lex.getString());
-               lyxerr << "FloatList::float_type: " << getCmdName() << endl;
+               lyxerr[Debug::INSETS] << "FloatList::float_type: " << getCmdName() << endl;
+               if (!floatList.typeExist(getCmdName()))
+                       lex.printError("InsetFloatList: Unknown float type: `$$Token'");
        } else
                lex.printError("InsetFloatList: Parse error: `$$Token'");
        while (lex.isOK()) {
@@ -105,7 +107,7 @@ int InsetFloatList::latex(Buffer const *, ostream & os, bool, bool) const
                        }
                } else {
                        os << "\\listof{" << getCmdName() << "}{"
-                          << _("List of ") << cit->second.name() << "}\n";
+                          << cit->second.listName() << "}\n";
                }
        } else {
                os << "%%\\listof{" << getCmdName() << "}{"
@@ -133,3 +135,9 @@ int InsetFloatList::ascii(Buffer const * buffer, ostream & os, int) const
        os << "\n";
        return 0;
 }
+
+
+void InsetFloatList::validate(LaTeXFeatures & features) const
+{
+       features.useFloat(getCmdName());
+}