X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCounters.cpp;h=519cb2734668e9a39c440bec0236d5208cde0919;hb=61d68d05bd0f2172ab9406f23dc2640e6b9ac56b;hp=6376b647f49a0466eab014cd1dbc62de78866c6e;hpb=00d07d67326e7e2b65d17a2054f61a72fe34fc7d;p=features.git diff --git a/src/Counters.cpp b/src/Counters.cpp index 6376b647f4..519cb27346 100644 --- a/src/Counters.cpp +++ b/src/Counters.cpp @@ -6,7 +6,7 @@ * \author Lars Gullik Bjønnes * \author Martin Vermeer * \author André Pönitz - * \author Richard Heck (roman numerals) + * \author Richard Kimberly Heck (roman numerals) * * Full author contact details are available in file CREDITS. */ @@ -59,6 +59,7 @@ bool Counter::read(Lexer & lex) CT_PRETTYFORMAT, CT_INITIALVALUE, CT_GUINAME, + CT_LATEXNAME, CT_END }; @@ -68,6 +69,7 @@ bool Counter::read(Lexer & lex) { "initialvalue", CT_INITIALVALUE}, { "labelstring", CT_LABELSTRING }, { "labelstringappendix", CT_LABELSTRING_APPENDIX }, + { "latexname", CT_LATEXNAME }, { "prettyformat", CT_PRETTYFORMAT }, { "within", CT_WITHIN } }; @@ -120,6 +122,10 @@ bool Counter::read(Lexer & lex) lex.next(); guiname_ = lex.getDocString(); break; + case CT_LATEXNAME: + lex.next(); + latexname_ = lex.getDocString(); + break; case CT_END: getout = true; break; @@ -374,6 +380,22 @@ docstring const & Counters::guiName(docstring const & cntr) const } +docstring const & Counters::latexName(docstring const & cntr) const +{ + CounterList::const_iterator it = counterList_.find(cntr); + if (it == counterList_.end()) { + lyxerr << "step: Counter does not exist: " + << to_utf8(cntr) << endl; + return empty_docstring(); + } + + docstring const & latexname = it->second.latexName(); + if (latexname.empty()) + return cntr; + return latexname; +} + + void Counters::reset() { appendix_ = false;