[LyX/master] Amend dc174db6c19

Juergen Spitzmueller spitz at lyx.org
Mon Dec 30 12:09:25 UTC 2019


commit ada07d0bf1661c19c8178b903b39c3032ea24e42
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Mon Dec 30 13:25:49 2019 +0100

    Amend dc174db6c19
---
 src/output_latex.cpp |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/output_latex.cpp b/src/output_latex.cpp
index aca126c..4befb3c 100644
--- a/src/output_latex.cpp
+++ b/src/output_latex.cpp
@@ -434,6 +434,22 @@ void TeXEnvironment(Buffer const & buf, Text const & text,
 			continue;
 		}
 
+		// Do not output empty environments if the whole paragraph has
+		// been deleted with ct and changes are not output.
+		if (size_t(pit + 1) < paragraphs.size()) {
+			ParagraphList::const_iterator nextpar = paragraphs.constIterator(pit + 1);
+			Paragraph const & cpar = paragraphs.at(pit);
+			if ((par->layout() != nextpar->layout()
+			     || par->params().depth() == nextpar->params().depth()
+			     || par->params().leftIndent() == nextpar->params().leftIndent())
+			    && !runparams.for_search && cpar.size() > 0
+			    && cpar.isDeleted(0, cpar.size()) && !buf.params().output_changes) {
+				if (!buf.params().output_changes && !cpar.parEndChange().deleted())
+					os << '\n' << '\n';
+				continue;
+			}
+		}
+
 		// This is a new environment.
 		TeXEnvironmentData const data =
 			prepareEnvironment(buf, text, par, os, runparams);


More information about the lyx-cvs mailing list