mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-12 16:50:39 +00:00
branch: Fix bug #6315: counters in insets that don't produce output have ghost values.
see r36603. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@36671 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d17f05abbb
commit
f984080b21
@ -425,7 +425,7 @@ docstring Counters::theCounter(docstring const & counter,
|
||||
std::set<docstring> & callers)
|
||||
{
|
||||
if (!hasCounter(counter))
|
||||
return from_ascii("??");
|
||||
return from_ascii("#");
|
||||
|
||||
docstring label;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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("??");
|
||||
|
@ -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()),
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user