+ case MenuItem::ViewFormats:
+ formats = Exporter::GetExportableFormats(buf, true);
+ action = LFUN_PREVIEW;
+ break;
+ case MenuItem::UpdateFormats:
+ formats = Exporter::GetExportableFormats(buf, true);
+ action = LFUN_UPDATE;
+ break;
+ default:
+ formats = Exporter::GetExportableFormats(buf, false);
+ action = LFUN_EXPORT;
+ }
+ sort(formats.begin(), formats.end(), compare_format());
+
+ Formats::const_iterator fit = formats.begin();
+ Formats::const_iterator end = formats.end();
+ for (; fit != end ; ++fit) {
+ if ((*fit)->dummy())
+ continue;
+ string label = (*fit)->prettyname();
+ // we need to hide the default graphic export formats
+ // from the external menu, because we need them only
+ // for the internal lyx-view and external latex run
+ if (label == "EPS" || label == "XPM" || label == "PNG")
+ continue;
+
+ if (kind == MenuItem::ImportFormats) {
+ if ((*fit)->name() == "text")
+ label = _("ASCII text as lines");
+ else if ((*fit)->name() == "textparagraph")
+ label = _("ASCII text as paragraphs");
+ label += "...";
+ }
+ if (!(*fit)->shortcut().empty())
+ label += '|' + (*fit)->shortcut();
+ int const action2 = lyxaction.
+ getPseudoAction(action, (*fit)->name());
+ tomenu.add(MenuItem(MenuItem::Command, label, action2));
+ }
+}
+
+
+void expandFloatListInsert(Menu & tomenu, Buffer const * buf)
+{
+ if (!buf) {
+ tomenu.add(MenuItem(MenuItem::Command,
+ _("No Documents Open!"), LFUN_NOACTION));
+ return;
+ }
+
+ FloatList const & floats = buf->params.getLyXTextClass().floats();
+ FloatList::const_iterator cit = floats.begin();
+ FloatList::const_iterator end = floats.end();
+ for (; cit != end; ++cit) {
+ int const action = lyxaction
+ .getPseudoAction(LFUN_FLOAT_LIST, cit->second.type());
+ tomenu.add(MenuItem(MenuItem::Command,
+ _(cit->second.listName()),
+ action));
+ }
+}
+
+
+void expandFloatInsert(Menu & tomenu, Buffer const * buf)
+{
+ if (!buf) {
+ tomenu.add(MenuItem(MenuItem::Command,
+ _("No Documents Open!"), LFUN_NOACTION));
+ return;
+ }
+
+ FloatList const & floats = buf->params.getLyXTextClass().floats();
+ FloatList::const_iterator cit = floats.begin();
+ FloatList::const_iterator end = floats.end();
+ for (; cit != end; ++cit) {
+ // normal float
+ int const action =
+ lyxaction.getPseudoAction(LFUN_INSET_FLOAT,
+ cit->second.type());
+ string const label = _(cit->second.name());
+ tomenu.add(MenuItem(MenuItem::Command, label, action));
+ }
+}
+
+
+Menu::size_type const max_number_of_items = 25;