mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-06 01:15:24 +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)
|
std::set<docstring> & callers)
|
||||||
{
|
{
|
||||||
if (!hasCounter(counter))
|
if (!hasCounter(counter))
|
||||||
return from_ascii("??");
|
return from_ascii("#");
|
||||||
|
|
||||||
docstring label;
|
docstring label;
|
||||||
|
|
||||||
|
@ -355,10 +355,10 @@ void setLabel(Buffer const & buf, ParIterator & it)
|
|||||||
case LABEL_COUNTER:
|
case LABEL_COUNTER:
|
||||||
if (layout.toclevel <= bp.secnumdepth
|
if (layout.toclevel <= bp.secnumdepth
|
||||||
&& (layout.latextype != LATEX_ENVIRONMENT
|
&& (layout.latextype != LATEX_ENVIRONMENT
|
||||||
|| isFirstInSequence(it.pit(), it.plist()))) {
|
|| isFirstInSequence(it.pit(), it.plist()))) {
|
||||||
counters.step(layout.counter);
|
if (counters.hasCounter(layout.counter))
|
||||||
par.params().labelString(
|
counters.step(layout.counter);
|
||||||
par.expandLabel(layout, bp));
|
par.params().labelString(par.expandLabel(layout, bp));
|
||||||
} else
|
} else
|
||||||
par.params().labelString(docstring());
|
par.params().labelString(docstring());
|
||||||
break;
|
break;
|
||||||
|
@ -310,8 +310,9 @@ void InsetBibitem::updateLabels(ParIterator const &)
|
|||||||
{
|
{
|
||||||
Counters & counters = buffer().masterBuffer()->params().documentClass().counters();
|
Counters & counters = buffer().masterBuffer()->params().documentClass().counters();
|
||||||
docstring const bibitem = from_ascii("bibitem");
|
docstring const bibitem = from_ascii("bibitem");
|
||||||
if (counters.hasCounter(bibitem) && getParam("label").empty()) {
|
if (getParam("label").empty()) {
|
||||||
counters.step(bibitem);
|
if (counters.hasCounter(bibitem))
|
||||||
|
counters.step(bibitem);
|
||||||
autolabel_ = counters.theCounter(bibitem);
|
autolabel_ = counters.theCounter(bibitem);
|
||||||
} else {
|
} else {
|
||||||
autolabel_ = from_ascii("??");
|
autolabel_ = from_ascii("??");
|
||||||
|
@ -51,8 +51,9 @@ void InsetFoot::updateLabels(ParIterator const & it)
|
|||||||
Counters & cnts = tclass.counters();
|
Counters & cnts = tclass.counters();
|
||||||
docstring const foot = from_ascii("footnote");
|
docstring const foot = from_ascii("footnote");
|
||||||
Paragraph const & outer = it.paragraph();
|
Paragraph const & outer = it.paragraph();
|
||||||
if (!outer.layout().intitle && cnts.hasCounter(foot)) {
|
if (!outer.layout().intitle) {
|
||||||
cnts.step(foot);
|
if (cnts.hasCounter(foot))
|
||||||
|
cnts.step(foot);
|
||||||
// FIXME: the counter should format itself.
|
// FIXME: the counter should format itself.
|
||||||
custom_label_= support::bformat(from_utf8("%1$s %2$s"),
|
custom_label_= support::bformat(from_utf8("%1$s %2$s"),
|
||||||
translateIfPossible(getLayout(buffer().params()).labelstring()),
|
translateIfPossible(getLayout(buffer().params()).labelstring()),
|
||||||
|
@ -483,6 +483,7 @@ void InsetText::updateLabels(ParIterator const & it)
|
|||||||
else {
|
else {
|
||||||
DocumentClass const & tclass = buffer().masterBuffer()->params().documentClass();
|
DocumentClass const & tclass = buffer().masterBuffer()->params().documentClass();
|
||||||
Counters const savecnt = tclass.counters();
|
Counters const savecnt = tclass.counters();
|
||||||
|
tclass.counters() = Counters();
|
||||||
lyx::updateLabels(buffer(), it2);
|
lyx::updateLabels(buffer(), it2);
|
||||||
tclass.counters() = savecnt;
|
tclass.counters() = savecnt;
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,9 @@ What's new
|
|||||||
|
|
||||||
- Fix the display of the horizontal alignment of table cells (bug 7007).
|
- 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
|
* DOCUMENTATION AND LOCALIZATION
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user