commit b3ab0190c1d8baa1f9c77bd8fb0fb0d5001cfe13
Author: Richard Heck <[email protected]>
Date: Sat Jul 9 23:53:18 2016 -0400
Rename some variables and routines.
---
src/Paragraph.cpp | 4 ++--
src/insets/InsetText.cpp | 8 ++++----
src/output_xhtml.cpp | 20 ++++++++++----------
src/output_xhtml.h | 13 +++++++------
4 files changed, 23 insertions(+), 22 deletions(-)
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index daac791..8ea300e 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -2776,7 +2776,7 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const &
buf,
Layout const & style = *d->layout_;
if (start_paragraph)
- xs.startParagraph(allowEmpty());
+ xs.startDivision(allowEmpty());
FontInfo font_old =
style.labeltype == LABEL_MANUAL ? style.labelfont : style.font;
@@ -3080,7 +3080,7 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const &
buf,
// wrapped in some font stuff. I think that will not work.
xs.closeFontTags();
if (close_paragraph)
- xs.endParagraph();
+ xs.endDivision();
return retval;
}
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index 583bd82..1222a69 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -613,9 +613,9 @@ docstring InsetText::insetAsXHTML(XHTMLStream & xs,
OutputParams const & rp,
runparams.par_end = text().paragraphs().size();
if (undefined()) {
- xs.startParagraph(false);
+ xs.startDivision(false);
xhtmlParagraphs(text_, buffer(), xs, runparams);
- xs.endParagraph();
+ xs.endDivision();
return docstring();
}
@@ -649,9 +649,9 @@ docstring InsetText::insetAsXHTML(XHTMLStream & xs,
OutputParams const & rp,
if (il.isPassThru())
runparams.pass_thru = true;
- xs.startParagraph(false);
+ xs.startDivision(false);
xhtmlParagraphs(text_, buffer(), xs, runparams);
- xs.endParagraph();
+ xs.endDivision();
if (opts & WriteInnerTag)
xs << html::EndTag(il.htmlinnertag());
diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp
index 84d171b..585ee2c 100644
--- a/src/output_xhtml.cpp
+++ b/src/output_xhtml.cpp
@@ -368,7 +368,7 @@ bool XHTMLStream::closeFontTags()
}
-void XHTMLStream::startParagraph(bool keep_empty)
+void XHTMLStream::startDivision(bool keep_empty)
{
pending_tags_.push_back(makeTagPtr(html::StartTag(parsep_tag)));
if (keep_empty)
@@ -376,7 +376,7 @@ void XHTMLStream::startParagraph(bool keep_empty)
}
-void XHTMLStream::endParagraph()
+void XHTMLStream::endDivision()
{
if (isTagPending(parsep_tag)) {
// this case is normal. it just means we didn't have content,
@@ -394,7 +394,7 @@ void XHTMLStream::endParagraph()
}
if (!isTagOpen(parsep_tag)) {
- writeError("No paragraph separation tag found in
endParagraph().");
+ writeError("No division separation tag found in
endDivision().");
return;
}
@@ -852,7 +852,7 @@ ParagraphList::const_iterator makeParagraphs(Buffer const &
buf,
bool const special_case =
specinset && !specinset->getLayout().htmlisblock();
- bool const opened = runparams.html_make_pars
+ bool const open_par = runparams.html_make_pars
&& (!runparams.html_in_par || par != pbegin)
&& !special_case;
@@ -863,11 +863,11 @@ ParagraphList::const_iterator makeParagraphs(Buffer const
& buf,
// but we are in the first par, and there is a next par.
ParagraphList::const_iterator nextpar = par;
++nextpar;
- bool const needclose =
- (opened && (!runparams.html_in_par || nextpar != pend))
- || (!opened && runparams.html_in_par && par == pbegin
&& nextpar != pend);
+ bool const close_par =
+ (open_par && (!runparams.html_in_par || nextpar !=
pend))
+ || (!open_par && runparams.html_in_par && par == pbegin
&& nextpar != pend);
- if (opened) {
+ if (open_par) {
// We do not issue the paragraph id if we are doing
// this for the TOC (or some similar purpose)
openParTag(xs, lay, par->params(),
@@ -876,12 +876,12 @@ ParagraphList::const_iterator makeParagraphs(Buffer const
& buf,
docstring const deferred = par->simpleLyXHTMLOnePar(buf, xs,
runparams, text.outerFont(distance(begin, par)),
- opened, needclose);
+ open_par, close_par);
if (!deferred.empty()) {
xs << XHTMLStream::ESCAPE_NONE << deferred <<
html::CR();
}
- if (needclose) {
+ if (close_par) {
closeTag(xs, lay);
xs << html::CR();
}
diff --git a/src/output_xhtml.h b/src/output_xhtml.h
index 57a2b2b..981038b 100644
--- a/src/output_xhtml.h
+++ b/src/output_xhtml.h
@@ -204,12 +204,13 @@ public:
/// \return false if there are open font tags we could not close.
/// because they are "blocked" by open non-font tags on the stack.
bool closeFontTags();
- /// call at start of paragraph. sets a mark so we know what tags
- /// to close at the end.
- void startParagraph(bool keep_empty);
- /// call at end of paragraph to clear that mark. note that this
- /// will also close any tags still open.
- void endParagraph();
+ /// sets a mark so we know what tags to close at the end.
+ /// normally called at the start of a paragraph.
+ void startDivision(bool keep_empty);
+ /// clears the mark set by previous method.
+ /// there should not be any other tags open before it on the stack,
+ /// but if there are, we will close them.
+ void endDivision();
///
XHTMLStream & operator<<(docstring const &);
///