[LyX/master] Fix case when cellvarwidth environment was closed were it was never opened

Juergen Spitzmueller spitz at lyx.org
Tue Sep 8 16:44:17 UTC 2026


commit 5f6719b7e99afde5719c573b0d65cfefa96618e4
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Tue Sep 8 18:43:43 2026 +0200

    Fix case when cellvarwidth environment was closed were it was never opened
---
 src/insets/InsetTabular.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 8f8a16ccb3..8791d5151a 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -3362,8 +3362,8 @@ void Tabular::TeXCellPostamble(otexstream & os, idx_type cell,
 	else if (getUsebox(cell) == BOX_MINIPAGE)
 		os << breakln << "\\end{minipage}";
 	else if (getUsebox(cell) == BOX_VARWIDTH
-		 && (getRotateCell(cell) != 0 || getAlignment(cell) != LYX_ALIGN_LEFT
-		     || getVAlignment(cell) != LYX_VALIGN_TOP || hasNewlines(cell)))
+		 && (getRotateCell(cell) != 0 || getAlignment(cell, !isMultiColumn(cell)) != LYX_ALIGN_LEFT
+		     || getVAlignment(cell, !isMultiColumn(cell)) != LYX_VALIGN_TOP || hasNewlines(cell)))
 		os << breakln << "\\end{cellvarwidth}";
 	if (getRotateCell(cell) != 0)
 		os << breakln << "\\end{turn}";


More information about the lyx-cvs mailing list