Whitespace

This commit is contained in:
Richard Kimberly Heck 2020-07-08 12:15:34 -04:00
parent eeaea7cbbb
commit 8ae0841826
13 changed files with 906 additions and 881 deletions

View File

@ -3095,7 +3095,6 @@ OptionalFontType fontSizeToXml(FontSize fs)
LATTEST(false);
return {};
}
}
}// anonymous namespace

View File

@ -47,7 +47,8 @@ namespace lyx {
namespace {
std::string const fontToDocBookTag(xml::FontTypes type) {
std::string const fontToDocBookTag(xml::FontTypes type)
{
switch (type) {
case xml::FontTypes::FT_EMPH:
case xml::FontTypes::FT_BOLD:
@ -86,7 +87,8 @@ std::string const fontToDocBookTag(xml::FontTypes type) {
}
}
string fontToRole(xml::FontTypes type) {
string fontToRole(xml::FontTypes type)
{
// Specific fonts are achieved with roles. The only common ones are "" for basic emphasis,
// and "bold"/"strong" for bold. With some specific options, other roles are copied into
// HTML output (via the DocBook XSLT sheets); otherwise, if not recognised, they are just ignored.
@ -184,7 +186,8 @@ namespace {
// convenience functions
void openParTag(XMLStream &xs, Layout const &lay) {
void openParTag(XMLStream &xs, Layout const &lay)
{
if (lay.docbookwrappertag() != "NONE") {
xs << xml::StartTag(lay.docbookwrappertag(), lay.docbookwrapperattr());
}
@ -197,7 +200,8 @@ void openParTag(XMLStream &xs, Layout const &lay) {
}
void closeTag(XMLStream &xs, Layout const &lay) {
void closeTag(XMLStream &xs, Layout const &lay)
{
string tag = lay.docbooktag();
if (tag == "Plain Layout")
tag = "para";
@ -221,13 +225,15 @@ void closeLabelTag(XMLStream & xs, Layout const & lay)
}
void openItemTag(XMLStream &xs, Layout const &lay) {
void openItemTag(XMLStream &xs, Layout const &lay)
{
xs << xml::StartTag(lay.docbookitemtag(), lay.docbookitemattr());
}
// Return true when new elements are output in a paragraph, false otherwise.
bool openInnerItemTag(XMLStream &xs, Layout const &lay) {
bool openInnerItemTag(XMLStream &xs, Layout const &lay)
{
if (lay.docbookiteminnertag() != "NONE") {
xs << xml::CR();
xs << xml::ParTag(lay.docbookiteminnertag(), lay.docbookiteminnerattr());
@ -240,7 +246,8 @@ bool openInnerItemTag(XMLStream &xs, Layout const &lay) {
}
void closeInnerItemTag(XMLStream &xs, Layout const &lay) {
void closeInnerItemTag(XMLStream &xs, Layout const &lay)
{
if (lay.docbookiteminnertag()!= "NONE") {
xs << xml::EndTag(lay.docbookiteminnertag());
xs << xml::CR();
@ -248,7 +255,8 @@ void closeInnerItemTag(XMLStream &xs, Layout const &lay) {
}
inline void closeItemTag(XMLStream &xs, Layout const &lay) {
inline void closeItemTag(XMLStream &xs, Layout const &lay)
{
xs << xml::EndTag(lay.docbookitemtag()) << xml::CR();
}
@ -256,7 +264,7 @@ inline void closeItemTag(XMLStream &xs, Layout const &lay) {
ParagraphList::const_iterator findLastParagraph(
ParagraphList::const_iterator p,
ParagraphList::const_iterator const &pend) {
ParagraphList::const_iterator const & pend) {
for (++p; p != pend && p->layout().latextype == LATEX_PARAGRAPH; ++p);
return p;
@ -264,8 +272,9 @@ ParagraphList::const_iterator findLastParagraph(
ParagraphList::const_iterator findEndOfEnvironment(
ParagraphList::const_iterator const &pstart,
ParagraphList::const_iterator const &pend) {
ParagraphList::const_iterator const & pstart,
ParagraphList::const_iterator const & pend)
{
ParagraphList::const_iterator p = pstart;
Layout const &bstyle = p->layout();
size_t const depth = p->params().depth();
@ -295,12 +304,14 @@ ParagraphList::const_iterator findEndOfEnvironment(
}
ParagraphList::const_iterator makeParagraphs(Buffer const &buf,
ParagraphList::const_iterator makeParagraphs(
Buffer const &buf,
XMLStream &xs,
OutputParams const &runparams,
Text const &text,
ParagraphList::const_iterator const &pbegin,
ParagraphList::const_iterator const &pend) {
ParagraphList::const_iterator const & pbegin,
ParagraphList::const_iterator const & pend)
{
ParagraphList::const_iterator const begin = text.paragraphs().begin();
ParagraphList::const_iterator par = pbegin;
for (; par != pend; ++par) {
@ -394,18 +405,21 @@ ParagraphList::const_iterator makeParagraphs(Buffer const &buf,
}
bool isNormalEnv(Layout const &lay) {
bool isNormalEnv(Layout const &lay)
{
return lay.latextype == LATEX_ENVIRONMENT
|| lay.latextype == LATEX_BIB_ENVIRONMENT;
}
ParagraphList::const_iterator makeEnvironment(Buffer const &buf,
ParagraphList::const_iterator makeEnvironment(
Buffer const &buf,
XMLStream &xs,
OutputParams const &runparams,
Text const &text,
ParagraphList::const_iterator const &pbegin,
ParagraphList::const_iterator const &pend) {
ParagraphList::const_iterator const & pbegin,
ParagraphList::const_iterator const & pend)
{
ParagraphList::const_iterator const begin = text.paragraphs().begin();
ParagraphList::const_iterator par = pbegin;
Layout const &bstyle = par->layout();
@ -553,11 +567,13 @@ ParagraphList::const_iterator makeEnvironment(Buffer const &buf,
}
void makeCommand(Buffer const &buf,
XMLStream &xs,
OutputParams const &runparams,
Text const &text,
ParagraphList::const_iterator const &pbegin) {
void makeCommand(
Buffer const & buf,
XMLStream & xs,
OutputParams const & runparams,
Text const & text,
ParagraphList::const_iterator const & pbegin)
{
Layout const &style = pbegin->layout();
if (!style.counter.empty())
buf.masterBuffer()->params().
@ -574,14 +590,16 @@ void makeCommand(Buffer const &buf,
xs << xml::CR();
}
pair<ParagraphList::const_iterator, ParagraphList::const_iterator> makeAny(Text const &text,
pair<ParagraphList::const_iterator, ParagraphList::const_iterator> makeAny(
Text const &text,
Buffer const &buf,
XMLStream &xs,
OutputParams const &ourparams,
ParagraphList::const_iterator par,
ParagraphList::const_iterator send,
ParagraphList::const_iterator pend) {
Layout const &style = par->layout();
ParagraphList::const_iterator pend)
{
Layout const & style = par->layout();
switch (style.latextype) {
case LATEX_COMMAND: {
@ -696,13 +714,15 @@ bool hasAbstractBetween(ParagraphList const &paragraphs, pit_type const bpitAbst
}
pit_type generateDocBookParagraphWithoutSectioning(Text const &text,
Buffer const &buf,
XMLStream &xs,
OutputParams const &runparams,
ParagraphList const &paragraphs,
pit_type generateDocBookParagraphWithoutSectioning(
Text const & text,
Buffer const & buf,
XMLStream & xs,
OutputParams const & runparams,
ParagraphList const & paragraphs,
pit_type bpit,
pit_type epit) {
pit_type epit)
{
auto par = paragraphs.iterator_at(bpit);
auto lastStartedPar = par;
ParagraphList::const_iterator send;
@ -719,14 +739,16 @@ pit_type generateDocBookParagraphWithoutSectioning(Text const &text,
}
void outputDocBookInfo(Text const &text,
Buffer const &buf,
XMLStream &xs,
OutputParams const &runparams,
ParagraphList const &paragraphs,
DocBookInfoTag const &info,
void outputDocBookInfo(
Text const & text,
Buffer const & buf,
XMLStream & xs,
OutputParams const & runparams,
ParagraphList const & paragraphs,
DocBookInfoTag const & info,
pit_type bpitAbstract,
pit_type const epitAbstract) {
pit_type const epitAbstract)
{
// Consider everything between bpitAbstract and epitAbstract (excluded) as paragraphs for the abstract.
// Use bpitAbstract >= epitAbstract to indicate there is no abstract.
@ -773,11 +795,13 @@ void outputDocBookInfo(Text const &text,
}
void docbookFirstParagraphs(Text const &text,
void docbookFirstParagraphs(
Text const &text,
Buffer const &buf,
XMLStream &xs,
OutputParams const &runparams,
pit_type epit) {
pit_type epit)
{
// Handle the beginning of the document, supposing it has sections.
// Major role: output the first <info> tag.
@ -798,10 +822,12 @@ bool isParagraphEmpty(const Paragraph &par)
}
void docbookSimpleAllParagraphs(Text const &text,
Buffer const &buf,
XMLStream &xs,
OutputParams const &runparams) {
void docbookSimpleAllParagraphs(
Text const & text,
Buffer const & buf,
XMLStream & xs,
OutputParams const & runparams)
{
// Handle the document, supposing it has no sections (i.e. a "simple" document).
// First, the <info> tag.