[LyX/master] Consider longtable caption when adding new column (#13299)

Juergen Spitzmueller <[email protected]>
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit 9740b2904af4b3e57dde5826ddb78ad175ad8069
Author: Juergen Spitzmueller <[email protected]>
Date:   Fri Apr 10 06:37:38 2026 +0200

    Consider longtable caption when adding new column (#13299)
---
 src/insets/InsetTabular.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index edcbf60f92..d69257770f 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -1050,12 +1050,12 @@ void Tabular::insertColumn(col_type col, bool copy, row_type row)
 		cell_info[r].insert(cell_info[r].begin() + col + 1,
 			copy ? cell_info[r][col] : CellData(buffer_));
 		// make new cell part of multicolumn if old cell was at the beginning
-		// or middle of a multicolumn
+		// or middle of a multicolumn, or if it is part of a longtable caption
 		if (cell_info[r][col].multicolumn == CELL_BEGIN_OF_MULTICOLUMN
-			|| (col + 2 < ncols()
-				&& cell_info[r][col].multicolumn == CELL_PART_OF_MULTICOLUMN
-				&& cell_info[r][col + 2].multicolumn == CELL_PART_OF_MULTICOLUMN
-			))
+		    || (col + 2 < ncols()
+			&& cell_info[r][col].multicolumn == CELL_PART_OF_MULTICOLUMN
+			&& cell_info[r][col + 2].multicolumn == CELL_PART_OF_MULTICOLUMN)
+		    || (is_long_tabular && ltCaption(r)))
 			cell_info[r][col + 1].multicolumn = CELL_PART_OF_MULTICOLUMN;
 	}
 	updateIndexes();
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.