switch(layout.labeltype) {
case LABEL_COUNTER:
if (layout.toclevel <= bp.secnumdepth
- && (layout.latextype != LATEX_ENVIRONMENT
- || it.text()->isFirstInSequence(it.pit()))) {
- counters.step(layout.counter, utype);
- par.params().labelString(
- par.expandLabel(layout, bp));
+ && (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;
{
CounterList::const_iterator it = counterList_.find(counter);
if (it == counterList_.end())
- return from_ascii("??");
+ return from_ascii("#");
Counter const & ctr = it->second;
Counter::StringMap & sm = ctr.flatLabelStrings(appendix());
Counter::StringMap::iterator smit = sm.find(lang);
CounterList::const_iterator it = counterList_.find(counter);
if (it == counterList_.end())
- return from_ascii("??");
+ return from_ascii("#");
Counter const & c = it->second;
docstring ls = translateIfPossible(c.labelString(in_appendix), lang);
{
CounterList::const_iterator it = counterList_.find(name);
if (it == counterList_.end())
- return from_ascii("??");
+ return from_ascii("#");
Counter const & ctr = it->second;
docstring const value = theCounter(name, lang);
BufferParams const & bp = buffer().masterBuffer()->params();
Counters & counters = bp.documentClass().counters();
docstring const bibitem = from_ascii("bibitem");
- if (counters.hasCounter(bibitem) && getParam("label").empty()) {
- counters.step(bibitem, utype);
+ if (getParam("label").empty()) {
+ if (counters.hasCounter(bibitem))
+ counters.step(bibitem, utype);
string const & lang = it.paragraph().getParLanguage(bp)->code();
autolabel_ = counters.theCounter(bibitem, lang);
} else {
cnts.saveLastCounter();
}
Paragraph const & outer = it.paragraph();
- InsetLayout const & il = getLayout();
- docstring const & count = il.counter();
- if (!outer.layout().intitle && cnts.hasCounter(count)) {
- cnts.step(count, utype);
- custom_label_= translateIfPossible(il.labelstring())
- + ' ' + cnts.theCounter(count, outer.getParLanguage(bp)->code());
- setLabel(custom_label_);
+ if (!outer.layout().intitle) {
+ InsetLayout const & il = getLayout();
+ docstring const & count = il.counter();
+ custom_label_ = translateIfPossible(il.labelstring()) + ' ';
+ if (cnts.hasCounter(count))
+ cnts.step(count, utype);
+ custom_label_ +=
+ cnts.theCounter(count, outer.getParLanguage(bp)->code());
+ setLabel(custom_label_);
}
InsetCollapsable::updateBuffer(it, utype);
if (utype == OutputUpdate)
counter_value_ = cnts.theCounter(active_counter_, lang->code());
pretty_counter_ = cnts.prettyCounter(active_counter_, lang->code());
} else {
- counter_value_ = from_ascii("??");
- pretty_counter_ = from_ascii("??");
+ counter_value_ = from_ascii("#");
+ pretty_counter_ = from_ascii("#");
}
}
}
// tclass.counters().clearLastLayout()
// since we are saving and restoring the existing counters, etc.
Counters const savecnt = tclass.counters();
+ tclass.counters() = Counters();
buffer().updateBuffer(it2, utype);
tclass.counters() = savecnt;
}