[LyX/master] Revert "DocBook: eat a bit of that spaghetti code."
Thibaut Cuvelier
tcuvelier at lyx.org
Mon Aug 3 20:33:02 UTC 2020
commit c2be69187ce23951506b097f1465b08f98f79ef1
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date: Mon Aug 3 22:56:16 2020 +0200
Revert "DocBook: eat a bit of that spaghetti code."
This reverts commit 25bcbe766601b7bbc5b9832858ab8e5874f5d2a2.
---
src/output_docbook.cpp | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index d0536ee..339f1c3 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -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();
}
More information about the lyx-cvs
mailing list