mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 11:16:55 +00:00
DocBook: don't output abstract if it would have no content.
Restore a change frome709a662
(reverted byd75ff993
) that was mixed into another commit. Also, add a TODO for InsetIndex.
This commit is contained in:
parent
e153477bca
commit
6434b666bf
@ -199,6 +199,7 @@ void InsetIndex::docbook(XMLStream & xs, OutputParams const & runparams) const
|
|||||||
"Complete entry: \"") + latexString + from_utf8("\"");
|
"Complete entry: \"") + latexString + from_utf8("\"");
|
||||||
LYXERR0(error);
|
LYXERR0(error);
|
||||||
xs << XMLStream::ESCAPE_NONE << (from_utf8("<!-- Output Error: ") + error + from_utf8(" -->\n"));
|
xs << XMLStream::ESCAPE_NONE << (from_utf8("<!-- Output Error: ") + error + from_utf8(" -->\n"));
|
||||||
|
// TODO: implement @ using the sortas attribute (on primary, secondary, tertiary).
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle several indices.
|
// Handle several indices.
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include <stack>
|
#include <stack>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace lyx::support;
|
using namespace lyx::support;
|
||||||
@ -863,17 +864,25 @@ void outputDocBookInfo(
|
|||||||
generateDocBookParagraphWithoutSectioning(text, buf, xs, runparams, paragraphs, bpitInfo, epitInfo);
|
generateDocBookParagraphWithoutSectioning(text, buf, xs, runparams, paragraphs, bpitInfo, epitInfo);
|
||||||
|
|
||||||
if (hasAbstract) {
|
if (hasAbstract) {
|
||||||
string tag = paragraphs[bpitAbstract].layout().docbookforceabstracttag();
|
// Sometimes, there are many paragraphs that should go into the abstract, but none generates actual content.
|
||||||
if (tag == "NONE")
|
// Thus, first generate to a temporary stream, then only create the <abstract> tag if these paragraphs
|
||||||
tag = "abstract";
|
// generate some content.
|
||||||
|
odocstringstream os2;
|
||||||
|
XMLStream xs2(os2);
|
||||||
|
generateDocBookParagraphWithoutSectioning(text, buf, xs2, runparams, paragraphs, bpitAbstract, epitAbstract);
|
||||||
|
|
||||||
xs << xml::StartTag(tag);
|
// Actually output the abstract if there is something to do.
|
||||||
xs << xml::CR();
|
if (!os2.str().empty()) {
|
||||||
xs.startDivision(false);
|
string tag = paragraphs[bpitAbstract].layout().docbookforceabstracttag();
|
||||||
generateDocBookParagraphWithoutSectioning(text, buf, xs, runparams, paragraphs, bpitAbstract, epitAbstract);
|
if (tag == "NONE")
|
||||||
xs.endDivision();
|
tag = "abstract";
|
||||||
xs << xml::EndTag(tag);
|
|
||||||
xs << xml::CR();
|
xs << xml::StartTag(tag);
|
||||||
|
xs << xml::CR();
|
||||||
|
xs << XMLStream::ESCAPE_NONE << os2.str();
|
||||||
|
xs << xml::EndTag(tag);
|
||||||
|
xs << xml::CR();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// End the <info> tag if it was started.
|
// End the <info> tag if it was started.
|
||||||
|
Loading…
Reference in New Issue
Block a user