InsetBibitem::InsetBibitem(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "bibitem")
+ : InsetCommand(buf, p)
{
buffer().invalidateBibinfoCache();
if (getParam("key").empty())
InsetBibtex::InsetBibtex(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "bibtex")
+ : InsetCommand(buf, p)
{
buffer().invalidateBibinfoCache();
}
InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "citation")
+ : InsetCommand(buf, p)
{}
// FIXME Would it now be possible to use the InsetCode in
// place of the mailer name and recover that information?
-InsetCommand::InsetCommand(Buffer * buf, InsetCommandParams const & p,
- string const & mailer_name)
- : Inset(buf), p_(p), mailer_name_(mailer_name)
+InsetCommand::InsetCommand(Buffer * buf, InsetCommandParams const & p)
+ : Inset(buf), p_(p)
{}
// The sole purpose of this copy constructor is to make sure
// that the mouse_hover_ map is not copied and remains empty.
InsetCommand::InsetCommand(InsetCommand const & rhs)
- : Inset(rhs), p_(rhs.p_), mailer_name_(rhs.mailer_name_)
+ : Inset(rhs), p_(rhs.p_)
{}
InsetCommand::~InsetCommand()
{
- if (!mailer_name_.empty())
- hideDialogs(mailer_name_, this);
+ if (p_.code() != NO_CODE)
+ hideDialogs(insetName(p_.code()), this);
map<BufferView const *, bool>::iterator it = mouse_hover_.begin();
map<BufferView const *, bool>::iterator end = mouse_hover_.end();
docstring InsetCommand::contextMenu(BufferView const &, int, int) const
{
- return from_ascii("context-") + from_ascii(mailer_name_);
+ return from_ascii("context-") + from_ascii(insetName(p_.code()));
}
bool InsetCommand::showInsetDialog(BufferView * bv) const
{
- if (!mailer_name_.empty())
- bv->showDialog(mailer_name_, params2string(p_),
+ if (p_.code() != NO_CODE)
+ bv->showDialog(insetName(p_.code()), params2string(p_),
const_cast<InsetCommand *>(this));
return true;
}
{
public:
///
- InsetCommand(Buffer *, InsetCommandParams const &,
- std::string const & mailer_name);
+ InsetCommand(Buffer *, InsetCommandParams const &);
///
InsetCommand(InsetCommand const & rhs);
///
///
InsetCommandParams p_;
- ///
- std::string mailer_name_;
/// changes color when mouse enters/leaves this inset
mutable std::map<BufferView const *, bool> mouse_hover_;
///
InsetFloatList::InsetFloatList(Buffer * buf)
- : InsetCommand(buf, InsetCommandParams(FLOAT_LIST_CODE), "floatlist")
+ : InsetCommand(buf, InsetCommandParams(FLOAT_LIST_CODE))
{}
InsetFloatList::InsetFloatList(Buffer * buf, string const & type)
- : InsetCommand(buf, InsetCommandParams(FLOAT_LIST_CODE), "floatlist")
+ : InsetCommand(buf, InsetCommandParams(FLOAT_LIST_CODE))
{
setParam("type", from_ascii(type));
}
InsetHyperlink::InsetHyperlink(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "href")
+ : InsetCommand(buf, p)
{}
InsetInclude::InsetInclude(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "include"), include_label(uniqueID()),
+ : InsetCommand(buf, p), include_label(uniqueID()),
preview_(new RenderMonitoredPreview(this)), failedtoload_(false),
set_label_(false), label_(0), child_buffer_(0)
{
///////////////////////////////////////////////////////////////////////
InsetPrintIndex::InsetPrintIndex(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "index_print")
+ : InsetCommand(buf, p)
{}
InsetLabel::InsetLabel(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "label")
+ : InsetCommand(buf, p)
{}
InsetLine::InsetLine(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "line")
+ : InsetCommand(buf, p)
{}
/////////////////////////////////////////////////////////////////////
InsetNomencl::InsetNomencl(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "nomenclature"),
+ : InsetCommand(buf, p),
nomenclature_entry_id(sgml::uniqueID(from_ascii("nomen")))
{}
/////////////////////////////////////////////////////////////////////
InsetPrintNomencl::InsetPrintNomencl(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "nomencl_print")
+ : InsetCommand(buf, p)
{}
InsetRef::InsetRef(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "ref")
+ : InsetCommand(buf, p)
{}
InsetTOC::InsetTOC(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "toc")
+ : InsetCommand(buf, p)
{}