diff --git a/src/Counters.cpp b/src/Counters.cpp index cf4bfeed43..2e9b6a47a9 100644 --- a/src/Counters.cpp +++ b/src/Counters.cpp @@ -425,7 +425,7 @@ docstring Counters::theCounter(docstring const & counter, std::set & callers) { if (!hasCounter(counter)) - return from_ascii("??"); + return from_ascii("#"); docstring label; diff --git a/src/buffer_funcs.cpp b/src/buffer_funcs.cpp index 7d2c900e2e..4bcb2c7a81 100644 --- a/src/buffer_funcs.cpp +++ b/src/buffer_funcs.cpp @@ -355,10 +355,10 @@ void setLabel(Buffer const & buf, ParIterator & it) case LABEL_COUNTER: if (layout.toclevel <= bp.secnumdepth && (layout.latextype != LATEX_ENVIRONMENT - || isFirstInSequence(it.pit(), it.plist()))) { - counters.step(layout.counter); - par.params().labelString( - par.expandLabel(layout, bp)); + || isFirstInSequence(it.pit(), it.plist()))) { + if (counters.hasCounter(layout.counter)) + counters.step(layout.counter); + par.params().labelString(par.expandLabel(layout, bp)); } else par.params().labelString(docstring()); break; diff --git a/src/insets/InsetBibitem.cpp b/src/insets/InsetBibitem.cpp index 4efeb8f827..9f71680451 100644 --- a/src/insets/InsetBibitem.cpp +++ b/src/insets/InsetBibitem.cpp @@ -310,8 +310,9 @@ void InsetBibitem::updateLabels(ParIterator const &) { Counters & counters = buffer().masterBuffer()->params().documentClass().counters(); docstring const bibitem = from_ascii("bibitem"); - if (counters.hasCounter(bibitem) && getParam("label").empty()) { - counters.step(bibitem); + if (getParam("label").empty()) { + if (counters.hasCounter(bibitem)) + counters.step(bibitem); autolabel_ = counters.theCounter(bibitem); } else { autolabel_ = from_ascii("??"); diff --git a/src/insets/InsetFoot.cpp b/src/insets/InsetFoot.cpp index 30078db53a..58cb34e6e2 100644 --- a/src/insets/InsetFoot.cpp +++ b/src/insets/InsetFoot.cpp @@ -51,8 +51,9 @@ void InsetFoot::updateLabels(ParIterator const & it) Counters & cnts = tclass.counters(); docstring const foot = from_ascii("footnote"); Paragraph const & outer = it.paragraph(); - if (!outer.layout().intitle && cnts.hasCounter(foot)) { - cnts.step(foot); + if (!outer.layout().intitle) { + if (cnts.hasCounter(foot)) + cnts.step(foot); // FIXME: the counter should format itself. custom_label_= support::bformat(from_utf8("%1$s %2$s"), translateIfPossible(getLayout(buffer().params()).labelstring()), diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 5c742530c6..6e06198ce8 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -483,6 +483,7 @@ void InsetText::updateLabels(ParIterator const & it) else { DocumentClass const & tclass = buffer().masterBuffer()->params().documentClass(); Counters const savecnt = tclass.counters(); + tclass.counters() = Counters(); lyx::updateLabels(buffer(), it2); tclass.counters() = savecnt; } diff --git a/status.16x b/status.16x index 7f4de4c39d..10a5f68ccb 100644 --- a/status.16x +++ b/status.16x @@ -84,6 +84,9 @@ What's new - Fix the display of the horizontal alignment of table cells (bug 7007). +- Numbered items in insets that do not produce any output (e.g., Notes) + no longer have a number associated with them (bug 6315). + * DOCUMENTATION AND LOCALIZATION