#include "insetfloatlist.h"
#include "FloatList.h"
+#include "LaTeXFeatures.h"
#include "frontends/Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "BufferView.h"
#include "buffer.h"
#include "gettext.h"
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!");
}
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()) {
}
-void InsetFloatList::edit(BufferView * bv, int, int, unsigned int)
+void InsetFloatList::edit(BufferView * bv, int, int, mouse_button::state)
{
bv->owner()->getDialogs()->showTOC(this);
}
void InsetFloatList::edit(BufferView * bv, bool)
{
- edit(bv, 0, 0, 0);
+ edit(bv, 0, 0, mouse_button::none);
}
}
} else {
os << "\\listof{" << getCmdName() << "}{"
- << _("List of ") << cit->second.name() << "}\n";
+ << cit->second.listName() << "}\n";
}
} else {
os << "%%\\listof{" << getCmdName() << "}{"
os << "\n";
return 0;
}
+
+
+void InsetFloatList::validate(LaTeXFeatures & features) const
+{
+ features.useFloat(getCmdName());
+}