break;
case LFUN_INSET_WIDE_FLOAT:
- {
// check if the float type exist
if (floatList.typeExist(argument)) {
InsetFloat * new_inset =
new InsetFloat(buffer_->params, argument);
new_inset->wide(true);
- if (insertInset(new_inset))
- new_inset->edit(bv_);
- else
- delete new_inset;
+ insertAndEditInset(new_inset);
} else {
lyxerr << "Non-existent float type: "
<< argument << endl;
}
-
- }
- break;
+ break;
#if 0
case LFUN_INSET_LIST:
break;
case LFUN_FLOAT_LIST:
- {
- // We should check the argument for validity. (Lgb)
- Inset * inset = new InsetFloatList(argument);
- if (!insertInset(inset, "Standard"))
- delete inset;
- }
- break;
+ if (floatList.typeExist(argument)) {
+ Inset * inset = new InsetFloatList(argument);
+ if (!insertInset(inset, "Standard"))
+ delete inset;
+ } else {
+ lyxerr << "Non-existent float type: "
+ << argument << endl;
+ }
+ break;
case LFUN_THESAURUS_ENTRY:
{
+2002-04-28 Dekel Tsur <dekelts@tau.ac.il>
+
+ * BufferView_pimpl.C (Dispatch): Check that float type exists when
+ inserting list of floats.
+
2002-04-24 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* CutAndPaste.C (SwitchLayoutsBetweenClasses): when converting a
+2002-04-28 Dekel Tsur <dekelts@tau.ac.il>
+
+ * insetfloatlist.C (getScreenLabel): Fix crash in the case where
+ float type do not exist.
+
2002-04-26 Angus Leeming <a.leeming@ic.ac.uk>
* insetfloat.C (c-tor, wide): translate the name of the float.
string const InsetFloatList::getScreenLabel(Buffer const *) const
{
- string const guiName = floatList[getCmdName()]->second.listName();
- if (!guiName.empty()) {
- return _(guiName);
- }
- 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()) {