Revert "DocBook: eat a bit of that spaghetti code."

This reverts commit 25bcbe7666.
This commit is contained in:
Thibaut Cuvelier 2020-08-03 22:56:16 +02:00
parent 42eca3d8d6
commit c2be69187c

View File

@ -202,10 +202,14 @@ void openParTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar
// first paragraph of an author, then merging with the previous tag does not make sense. Say the
// next paragraph is the affiliation, then it should be output in the same <author> tag (different
// layout, same wrapper tag).
bool openWrapper = lay.docbookwrappertag() != "NONE";
if (prevpar != nullptr) {
bool openWrapper = false;
if (prevpar == nullptr) {
openWrapper = lay.docbookwrappertag() != "NONE";
} else {
Layout const & prevlay = prevpar->layout();
if (prevlay.docbookwrappertag() != "NONE") {
if (prevlay.docbookwrappertag() == "NONE") {
openWrapper = lay.docbookwrappertag() != "NONE";
} else {
openWrapper = prevlay.docbookwrappertag() == lay.docbookwrappertag()
&& !lay.docbookwrappermergewithprevious();
}
@ -234,10 +238,14 @@ void closeTag(XMLStream & xs, Paragraph const * par, Paragraph const * nextpar)
nextpar = nullptr;
// See comment in openParTag.
bool closeWrapper = lay.docbookwrappertag() != "NONE";
if (nextpar != nullptr) {
bool closeWrapper = false;
if (nextpar == nullptr) {
closeWrapper = lay.docbookwrappertag() != "NONE";
} else {
Layout const & nextlay = nextpar->layout();
if (nextlay.docbookwrappertag() != "NONE") {
if (nextlay.docbookwrappertag() == "NONE") {
closeWrapper = lay.docbookwrappertag() != "NONE";
} else {
closeWrapper = nextlay.docbookwrappertag() == lay.docbookwrappertag()
&& !nextlay.docbookwrappermergewithprevious();
}