Rename some variables and routines.

This commit is contained in:
Richard Heck 2016-07-09 23:53:18 -04:00
parent 31e25c8ec6
commit b3ab0190c1
4 changed files with 23 additions and 22 deletions

View File

@ -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;
}

View File

@ -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());

View File

@ -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();
}

View File

@ -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 &);
///