]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetfloatlist.C
move inset related stuff from src/graphics to src/inset/
[lyx.git] / src / insets / insetfloatlist.C
index cb2785b5197d4733287f9bb931d16d2538511da4..2bebacd11490036ede5cdc8dbf5eccedc8160321 100644 (file)
@@ -8,7 +8,7 @@
 #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"
@@ -34,11 +34,11 @@ InsetFloatList::InsetFloatList(string const & type)
 
 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!");
 }
 
 
@@ -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()) {
@@ -76,7 +78,7 @@ void InsetFloatList::read(Buffer const *, LyXLex & lex)
 }
 
 
-void InsetFloatList::edit(BufferView * bv, int, int, unsigned int)
+void InsetFloatList::edit(BufferView * bv, int, int, mouse_button::state)
 {
        bv->owner()->getDialogs()->showTOC(this);
 }
@@ -84,7 +86,7 @@ void InsetFloatList::edit(BufferView * bv, int, int, unsigned int)
 
 void InsetFloatList::edit(BufferView * bv, bool)
 {
-       edit(bv, 0, 0, 0);
+       edit(bv, 0, 0, mouse_button::none);
 }