[LyX/master] Properly nest \lyxdeleted within text markup

Juergen Spitzmueller spitz at lyx.org
Fri Dec 27 12:41:01 UTC 2019


commit 28da0f4360a1d56348f8e5144bef8d0bc6a9cecb
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Fri Dec 27 13:56:53 2019 +0100

    Properly nest \lyxdeleted within text markup
    
    Fixes #8807
---
 src/Paragraph.cpp |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 8fa3c1d..198705c 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -2613,6 +2613,21 @@ void Paragraph::latex(BufferParams const & bparams,
 		     current_font.language() != running_font.language()) &&
 			i != body_pos - 1)
 		{
+			bool const in_ct_deletion = (bparams.output_changes
+						     && runningChange == change
+						     && change.type == Change::DELETED
+						     && !os.afterParbreak());
+			if (in_ct_deletion) {
+				// We have to close and then reopen \lyxdeleted,
+				// as strikeout needs to be on lowest level.
+				bool needPar = false;
+				OutputParams rp = runparams;
+				column += running_font.latexWriteEndChanges(
+					os, bparams, rp, basefont,
+					basefont, needPar);
+				os << '}';
+				column += 1;
+			}
 			odocstringstream ods;
 			column += current_font.latexWriteStartChanges(ods, bparams,
 							      runparams, basefont,
@@ -2641,6 +2656,13 @@ void Paragraph::latex(BufferParams const & bparams,
 				   << from_ascii("{}");
 			else
 				os << fontchange;
+			if (in_ct_deletion) {
+				// We have to close and then reopen \lyxdeleted,
+				// as strikeout needs to be on lowest level.
+				OutputParams rp = runparams;
+				column += Changes::latexMarkChange(os, bparams,
+					Change(Change::UNCHANGED), change, rp);
+			}
 		}
 
 		// FIXME: think about end_pos implementation...


More information about the lyx-cvs mailing list