X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftoc.C;h=d90cab6e37812c83ce88fc07193b6ce72ecda316;hb=b9963e1a57135c3e2ab128a9ec4300f0e4886992;hp=d207636526dfc41171830281c734ef064358689a;hpb=200435f2d9dfc0e9737841db8533bee504bbfcf0;p=lyx.git diff --git a/src/toc.C b/src/toc.C index d207636526..d90cab6e37 100644 --- a/src/toc.C +++ b/src/toc.C @@ -17,7 +17,6 @@ #include "bufferparams.h" #include "FloatList.h" #include "funcrequest.h" -#include "gettext.h" #include "LyXAction.h" #include "paragraph.h" #include "pariterator.h" @@ -61,20 +60,20 @@ string const getType(string const & cmdName) { // special case if (cmdName == "tableofcontents") - return _("TOC"); + return "TOC"; else return cmdName; } -string const getGuiName(string const & cmdName, Buffer const & buffer) +string const getGuiName(string const & type, Buffer const & buffer) { FloatList const & floats = buffer.params().getLyXTextClass().floats(); - if (floats.typeExist(cmdName)) - return _(floats.getType(cmdName).name()); + if (floats.typeExist(type)) + return floats.getType(type).name(); else - return getType(cmdName); + return type; } @@ -123,14 +122,15 @@ TocList const getTocList(Buffer const & buf) /// now the toc entry for the paragraph int const toclevel = pit->layout()->toclevel; - if (toclevel >= min_toclevel + if (toclevel != LyXLayout::NOT_IN_TOC + && toclevel >= min_toclevel && toclevel <= bufparams.tocdepth) { // insert this into the table of contents if (tocstring.empty()) tocstring = pit->asString(buf, true); TocItem const item(pit->id(), toclevel - min_toclevel, tocstring); - toclist[_("TOC")].push_back(item); + toclist["TOC"].push_back(item); } } return toclist;