commit 203d3b00dbc8de7ee9d1f3d80cdf0a1396a286e0
Author: Juergen Spitzmueller <[email protected]>
Date:   Tue Jul 8 11:34:57 2025 +0200

    Fix tabular metrics calculation
    
    with xtabular, varwidth columns and a multicol spanning
    the whole tabular
---
 src/insets/InsetTabular.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 76140cf508..9d9075fc46 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -1453,7 +1453,12 @@ bool Tabular::updateColumnWidths(MetricsInfo & mi)
                        for(col_type j = c; j < c + span ; ++j)
                                old_width += column_info[j].width;
 
-                       if (cellInfo(i).width > old_width) {
+                       if (tabularx && span == int(ncols())) {
+                               // With tabularx and multicolumns spanning all 
columns,
+                               // we assign tabular width
+                               column_info[c + span - 1].width += 
max(mi.base.inPixels(tab_width), column_info[c + span - 1].width) - old_width;
+                               update = false;
+                       } else if (cellInfo(i).width > old_width) {
                                column_info[c + span - 1].width += 
cellInfo(i).width - old_width;
                                // Do not trigger update when no space is left 
for variable
                                // columns, as this will loop
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to