]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTOC.cpp
pimpl not needed here
[lyx.git] / src / insets / InsetTOC.cpp
index f583810ff0ad508f796f5e0b90479c4cbdb7c4e8..9f91c06f192e24e04d629791c06caf2c4d7a7abe 100644 (file)
@@ -34,30 +34,31 @@ InsetTOC::InsetTOC(InsetCommandParams const & p)
 {}
 
 
-std::auto_ptr<InsetBase> InsetTOC::doClone() const
+CommandInfo const * InsetTOC::findInfo(std::string const & /* cmdName */)
 {
-       return std::auto_ptr<InsetBase>(new InsetTOC(*this));
+       static const char * const paramnames[] = {"type", ""};
+       static const bool isoptional[] = {false};
+       static const CommandInfo info = {1, paramnames, isoptional};
+       return &info;
 }
 
 
-docstring const InsetTOC::getScreenLabel(Buffer const &) const
+Inset * InsetTOC::clone() const
 {
-       if (getCmdName() == "tableofcontents")
-               return _("Table of Contents");
-       return _("Unknown toc list");
+       return new InsetTOC(*this);
 }
 
 
-InsetBase::Code InsetTOC::lyxCode() const
+docstring const InsetTOC::getScreenLabel(Buffer const & buf) const
 {
        if (getCmdName() == "tableofcontents")
-               return InsetBase::TOC_CODE;
-       return InsetBase::NO_CODE;
+               return buf.B_("Table of Contents");
+       return _("Unknown TOC type");
 }
 
 
 int InsetTOC::plaintext(Buffer const & buffer, odocstream & os,
-                        OutputParams const &) const
+                       OutputParams const &) const
 {
        os << getScreenLabel(buffer) << "\n\n";
 
@@ -68,7 +69,7 @@ int InsetTOC::plaintext(Buffer const & buffer, odocstream & os,
 
 
 int InsetTOC::docbook(Buffer const &, odocstream & os,
-                      OutputParams const &) const
+                     OutputParams const &) const
 {
        if (getCmdName() == "tableofcontents")
                os << "<toc></toc>";