X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetTOC.cpp;h=d1d0e8b5489534dcae4745340b64ab88029df22d;hb=2c357c1d23b7b83839a9beb8225d4f1ae4f793b4;hp=51234af7cd27c2e47c914fa0c0a82c6c7293707c;hpb=897436efbb9bd641b61467d185a2dfae9839e575;p=lyx.git diff --git a/src/insets/InsetTOC.cpp b/src/insets/InsetTOC.cpp index 51234af7cd..d1d0e8b548 100644 --- a/src/insets/InsetTOC.cpp +++ b/src/insets/InsetTOC.cpp @@ -15,44 +15,43 @@ #include "Buffer.h" #include "DispatchResult.h" #include "FuncRequest.h" -#include "gettext.h" +#include "support/gettext.h" #include "MetricsInfo.h" #include "OutputParams.h" #include "TocBackend.h" -#include "support/std_ostream.h" +#include +using namespace std; namespace lyx { -using std::string; -using std::ostream; - InsetTOC::InsetTOC(InsetCommandParams const & p) : InsetCommand(p, "toc") {} -std::auto_ptr InsetTOC::doClone() const +CommandInfo const * InsetTOC::findInfo(string const & /* cmdName */) { - return std::auto_ptr(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 & buf) const +Inset * InsetTOC::clone() const { - if (getCmdName() == "tableofcontents") - return buf.B_("Table of Contents"); - return _("Unknown TOC type"); + return new InsetTOC(*this); } -Inset::Code InsetTOC::lyxCode() const +docstring const InsetTOC::getScreenLabel(Buffer const & buf) const { if (getCmdName() == "tableofcontents") - return Inset::TOC_CODE; - return Inset::NO_CODE; + return buf.B_("Table of Contents"); + return _("Unknown TOC type"); }