InsetTOC::InsetTOC(InsetCommandParams const & p)
- : InsetCommand(p)
+ : InsetCommand(p, "toc")
{}
-InsetTOC::~InsetTOC()
-{
- InsetCommandMailer("toc", *this).hideDialog();
-}
-
-
-std::auto_ptr<InsetBase> InsetTOC::clone() const
+std::auto_ptr<InsetBase> InsetTOC::doClone() const
{
return std::auto_ptr<InsetBase>(new InsetTOC(*this));
}
}
-InsetOld::Code InsetTOC::lyxCode() const
+InsetBase::Code InsetTOC::lyxCode() const
{
if (getCmdName() == "tableofcontents")
- return InsetOld::TOC_CODE;
- return InsetOld::NO_CODE;
-}
-
-
-DispatchResult
-InsetTOC::priv_dispatch(FuncRequest const & cmd,
- idx_type & idx, pos_type & pos)
-{
- switch (cmd.action) {
- case LFUN_MOUSE_RELEASE:
- case LFUN_INSET_DIALOG_SHOW:
- InsetCommandMailer("toc", *this).showDialog(cmd.view());
- return DispatchResult(true, true);
-
- default:
- return InsetCommand::priv_dispatch(cmd, idx, pos);
- }
+ return InsetBase::TOC_CODE;
+ return InsetBase::NO_CODE;
}