- string const label = _(cit->second.name());
- tomenu.add(MenuItem(MenuItem::Command, label,
- FuncRequest(LFUN_INSET_FLOAT,
- cit->second.type())),
- view);
+ docstring const label = _(cit->second.name());
+ tomenu.addWithStatusCheck(MenuItem(MenuItem::Command, label,
+ FuncRequest(LFUN_FLOAT_INSERT,
+ cit->second.type())));
+ }
+}
+
+
+void expandCharStyleInsert(Menu & tomenu, Buffer const * buf)
+{
+ if (!buf) {
+ tomenu.add(MenuItem(MenuItem::Command,
+ _("No Documents Open!"),
+ FuncRequest(LFUN_NOACTION)));
+ return;
+ }
+ CharStyles & charstyles =
+ buf->params().getLyXTextClass().charstyles();
+ CharStyles::iterator cit = charstyles.begin();
+ CharStyles::iterator end = charstyles.end();
+ for (; cit != end; ++cit) {
+ docstring const label = from_utf8(cit->name);
+ tomenu.addWithStatusCheck(MenuItem(MenuItem::Command, label,
+ FuncRequest(LFUN_CHARSTYLE_INSERT,
+ label)));