//
/////////////////////////////////////////////////////////////////////////
-ToolbarItem::ToolbarItem(Type type, FuncRequest const & func, docstring const & label)
- : type_(type), func_(func), label_(label)
+ToolbarItem::ToolbarItem(Type type, FuncRequest const & func,
+ docstring const & label)
+ : type_(type), func_(make_shared<FuncRequest>(func)), label_(label)
{
}
-ToolbarItem::ToolbarItem(Type type, string const & name, docstring const & label)
- : type_(type), label_(label), name_(name)
+ToolbarItem::ToolbarItem(Type type, string const & name,
+ docstring const & label)
+ : type_(type), func_(make_shared<FuncRequest>()), label_(label), name_(name)
{
}
void ToolbarInfo::add(ToolbarItem const & item)
{
items.push_back(item);
- items.back().func_.setOrigin(FuncRequest::TOOLBAR);
+ items.back().func_->setOrigin(FuncRequest::TOOLBAR);
}
case TO_IMPORTFORMATS:
case TO_UPDATEFORMATS:
case TO_VIEWFORMATS: {
- vector<Format const *> formats = (code == TO_IMPORTFORMATS) ?
+ FormatList formats = (code == TO_IMPORTFORMATS) ?
theConverters().importableFormats() :
theConverters().exportableFormats(true);
sort(formats.begin(), formats.end());