]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettoc.C
The speed patch: redraw only rows that have changed
[lyx.git] / src / insets / insettoc.C
index 5b5f3ec4367b67c0710e700d15c9af3b8d4bb36b..512c9e96d7e17868f9a4407ea377e0ca0c0533dd 100644 (file)
@@ -26,17 +26,11 @@ using std::ostream;
 
 
 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));
 }
@@ -50,27 +44,11 @@ string const InsetTOC::getScreenLabel(Buffer const &) const
 }
 
 
-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;
 }