[LyX/master] amend dae064043682ea7dcf03899abaca067ee2245655

Thibaut Cuvelier tcuvelier at lyx.org
Thu Nov 26 22:03:17 UTC 2020


commit 46d90b3415de0f7b89368598261e0ffa5daaf539
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Thu Nov 26 23:32:44 2020 +0100

    amend dae064043682ea7dcf03899abaca067ee2245655
    
    Fix a warning in the code.
---
 src/output_docbook.cpp |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index c033239..bcd04bc 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -741,7 +741,8 @@ DocBookInfoTag getParagraphsWithInfo(ParagraphList const &paragraphs,
 
 	// Traverse everything that might belong to <info>.
 	bool hasAbstractLayout = false;
-	depth_type abstractDepth = -1;
+	static depth_type INVALID_DEPTH = 100000;
+	depth_type abstractDepth = INVALID_DEPTH;
 	pit_type cpit = bpit;
 	for (; cpit < epit; ++cpit) {
 		// Skip paragraphs that don't generate anything in DocBook.
@@ -767,7 +768,7 @@ DocBookInfoTag getParagraphsWithInfo(ParagraphList const &paragraphs,
 
 		// Deeper paragraphs following the abstract must still be considered as part of the abstract.
 		// For instance, this includes lists. There should not be any other kind of paragraph in between.
-		if (abstractDepth != -1 && style.docbookininfo() == "never") {
+		if (abstractDepth != INVALID_DEPTH && style.docbookininfo() == "never") {
 			if (par.getDepth() > abstractDepth) {
 				abstractWithLayout.emplace(cpit);
 				continue;
@@ -775,7 +776,7 @@ DocBookInfoTag getParagraphsWithInfo(ParagraphList const &paragraphs,
 			if (par.getDepth() == abstractDepth) {
 				// This is not an abstract paragraph and it should not either be considered as part
 				// of it. It breaks the rule that abstract paragraphs must follow each other.
-				abstractDepth = -1;
+				abstractDepth = INVALID_DEPTH;
 				break;
 			}
 		}


More information about the lyx-cvs mailing list