From b18bfcf3cc3a6dc91d607f28b269344db6ce3106 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Thu, 21 Jan 2010 18:46:20 +0000 Subject: [PATCH] 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 --- src/Paragraph.cpp | 18 ++++++++++++++++-- src/Paragraph.h | 11 +++++++---- src/output_docbook.cpp | 2 +- src/output_xhtml.cpp | 4 ++-- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 23d0ca34a4..2e72ff2314 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -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); diff --git a/src/Paragraph.h b/src/Paragraph.h index 2c04b66935..06c3cfb1e8 100644 --- a/src/Paragraph.h +++ b/src/Paragraph.h @@ -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(); /// diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp index 4dc6048d5b..f413f2831b 100644 --- a/src/output_docbook.cpp +++ b/src/output_docbook.cpp @@ -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()); } diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp index 1e57a28c45..21894a2941 100644 --- a/src/output_xhtml.cpp +++ b/src/output_xhtml.cpp @@ -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(); }