[LyX/master] Correctly handle deleted environments in ct

Juergen Spitzmueller spitz at lyx.org
Thu Dec 26 14:08:54 UTC 2019


commit dc174db6c1973d1ebd3c955ebe5ad9f68fb337da
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Thu Dec 26 15:24:48 2019 +0100

    Correctly handle deleted environments in ct
    
    Fixes #10252
---
 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 7849db5..8830eb0 100644
--- a/src/output_latex.cpp
+++ b/src/output_latex.cpp
@@ -1629,6 +1629,22 @@ void latexParagraphs(Buffer const & buf,
 			continue;
 		}
 
+		// Do not output empty environments if the whole paragraph has
+		// been deleted with ct and changes are not output.
+		if (pit < runparams.par_end) {
+			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()) && !bparams.output_changes) {
+				if (!bparams.output_changes && !cpar.parEndChange().deleted())
+					os << '\n' << '\n';
+				continue;
+			}
+		}
+
 		TeXEnvironmentData const data =
 			prepareEnvironment(buf, text, par, os, runparams);
 		// pit can be changed in TeXEnvironment.


More information about the lyx-cvs mailing list