Kill a (public) magic boolean.

The point of this will become clear shortly. I hope.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33133 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-01-21 18:46:20 +00:00
parent bb044b16c9
commit b18bfcf3cc
4 changed files with 26 additions and 9 deletions

View File

@ -1656,7 +1656,21 @@ void Paragraph::setLabelWidthString(docstring const & s)
}
docstring Paragraph::expandLabel(Layout const & layout,
docstring Paragraph::expandLabel(Layout const & layout,
BufferParams const & bparams) const
{
return expandParagraphLabel(layout, bparams, true);
}
docstring Paragraph::expandDocBookLabel(Layout const & layout,
BufferParams const & bparams) const
{
return expandParagraphLabel(layout, bparams, false);
}
docstring Paragraph::expandParagraphLabel(Layout const & layout,
BufferParams const & bparams, bool process_appendix) const
{
DocumentClass const & tclass = bparams.documentClass();
@ -1677,7 +1691,7 @@ docstring Paragraph::expandLabel(Layout const & layout,
docstring parent(fmt, i + 1, j - i - 1);
docstring label = from_ascii("??");
if (tclass.hasLayout(parent))
docstring label = expandLabel(tclass[parent], bparams,
docstring label = expandParagraphLabel(tclass[parent], bparams,
process_appendix);
fmt = docstring(fmt, 0, i) + label
+ docstring(fmt, j + 1, docstring::npos);

View File

@ -242,16 +242,16 @@ public:
/// recompute this value
void setBeginOfBody();
///
docstring expandLabel(Layout const &, BufferParams const &) const;
///
docstring expandDocBookLabel(Layout const &, BufferParams const &) const;
///
docstring const & labelString() const;
/// the next two functions are for the manual labels
docstring const getLabelWidthString() const;
/// Set label width string.
void setLabelWidthString(docstring const & s);
/// Expand the counters for the labelstring of \c layout
docstring expandLabel(Layout const &, BufferParams const &,
bool process_appendix = true) const;
/// Actual paragraph alignment used
char getAlign() const;
/// The nesting depth of a paragraph
@ -430,6 +430,9 @@ public:
std::string magicLabel() const;
private:
/// Expand the counters for the labelstring of \c layout
docstring expandParagraphLabel(Layout const &, BufferParams const &,
bool process_appendix) const;
///
void deregisterWords();
///

View File

@ -260,7 +260,7 @@ ParagraphList::const_iterator makeCommand(Buffer const & buf,
if (!bstyle.labeltag().empty()) {
sgml::openTag(os, bstyle.labeltag());
// We don't care about appendix in DOCBOOK.
os << par->expandLabel(bstyle, buf.params(), false);
os << par->expandDocBookLabel(bstyle, buf.params());
sgml::closeTag(os, bstyle.labeltag());
}

View File

@ -699,7 +699,7 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
openItemTag(xs, style);
if (par == pbegin && style.htmllabeltag() != "NONE") {
docstring const lbl =
pbegin->expandLabel(style, buf.params(), false);
pbegin->expandLabel(style, buf.params());
if (!lbl.empty()) {
openLabelTag(xs, style);
xs << lbl;
@ -721,7 +721,7 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
else if (style.labeltype != LABEL_NO_LABEL
&& style.htmllabeltag() != "NONE") {
openLabelTag(xs, style);
xs << par->expandLabel(style, buf.params(), false);
xs << par->expandLabel(style, buf.params());
closeLabelTag(xs, style);
xs.cr();
}