}
switch(layout.labeltype) {
- case LABEL_COUNTER:
- if (layout.toclevel <= bp.secnumdepth
- && (layout.latextype != LATEX_ENVIRONMENT
- || it.text()->isFirstInSequence(it.pit()))) {
- if (counters.hasCounter(layout.counter))
- counters.step(layout.counter, utype);
- par.params().labelString(par.expandLabel(layout, bp));
- } else
- par.params().labelString(docstring());
- break;
-
case LABEL_ITEMIZE: {
// At some point of time we should do something more
// clever here, like:
par.params().labelString(docstring());
break;
- case LABEL_MANUAL:
case LABEL_TOP_ENVIRONMENT:
case LABEL_CENTERED_TOP_ENVIRONMENT:
- case LABEL_STATIC:
+ case LABEL_STATIC: {
+ docstring const & lcounter = layout.counter;
+ if (!lcounter.empty()) {
+ if (layout.toclevel <= bp.secnumdepth
+ && (layout.latextype != LATEX_ENVIRONMENT
+ || it.text()->isFirstInSequence(it.pit()))) {
+ if (counters.hasCounter(lcounter))
+ counters.step(lcounter, utype);
+ par.params().labelString(par.expandLabel(layout, bp));
+ } else
+ par.params().labelString(docstring());
+ } else
+ par.params().labelString(par.expandLabel(layout, bp));
+ break;
+ }
+
+ case LABEL_MANUAL:
case LABEL_BIBLIO:
par.params().labelString(par.expandLabel(layout, bp));
- break;
}
}
LA_CENTERED_TOP_ENVIRONMENT,
LA_STATIC,
LA_SENSITIVE,
- LA_COUNTER,
LA_ENUMERATE,
LA_ITEMIZE,
LA_BIBLIO
LexerKeyword labelTypeTags[] = {
{ "bibliography", LA_BIBLIO },
{ "centered_top_environment", LA_CENTERED_TOP_ENVIRONMENT },
- { "counter", LA_COUNTER },
{ "enumerate", LA_ENUMERATE },
{ "itemize", LA_ITEMIZE },
{ "manual", LA_MANUAL },
case LA_SENSITIVE:
labeltype = LABEL_SENSITIVE;
break;
- case LA_COUNTER:
- labeltype = LABEL_COUNTER;
- break;
case LA_ENUMERATE:
labeltype = LABEL_ENUMERATE;
break;
///
LABEL_SENSITIVE,
///
- LABEL_COUNTER,
- ///
LABEL_ENUMERATE,
///
LABEL_ITEMIZE
bool const in_appendix = process_appendix && d->params_.appendix();
docstring fmt = translateIfPossible(layout.labelstring(in_appendix), lang);
- if (fmt.empty() && layout.labeltype == LABEL_COUNTER
- && !layout.counter.empty())
+ if (fmt.empty() && !layout.counter.empty())
return tclass.counters().theCounter(layout.counter, lang);
// handle 'inherited level parts' in 'fmt',
/*
Paragraph & par = pars_[cur.pit()];
if (inset->lyxCode() == LABEL_CODE
- && par.layout().labeltype == LABEL_COUNTER) {
+ && !par.layout().counter.empty() {
// Go to the end of the paragraph
// Warning: Because of Change-Tracking, the last
// position is 'size()' and not 'size()-1':
DocumentClass::const_iterator len = tclass.end();
for (; lit != len; ++lit) {
int const toclevel = lit->toclevel;
- if (toclevel != Layout::NOT_IN_TOC && lit->labeltype == LABEL_COUNTER) {
+ if (toclevel != Layout::NOT_IN_TOC && !lit->counter.empty()) {
item = new QTreeWidgetItem(numberingModule->tocTW);
item->setText(0, toqstr(translateIfPossible(lit->name())));
item->setText(1, (toclevel <= depth) ? yes : no);