[LyX/master] Fix disabling of LFUN_FONT_* lfuns with multi-cell table selection

Juergen Spitzmueller <[email protected]> Mon, 13 Jul 2026 11:40:27 +0000
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit bf8cc517a751f24276dd4b37bc36fa76041cc162
Author: Juergen Spitzmueller <[email protected]>
Date:   Mon Jul 13 13:39:12 2026 +0200

    Fix disabling of LFUN_FONT_* lfuns with multi-cell table selection
---
 src/insets/InsetTabular.cpp | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 5af1525b45..53d03253e5 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -6871,6 +6871,36 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
 		return cell(cur.idx())->getStatus(cur, cmd, status);
 	}
 
+	case LFUN_FONT_FRAK:
+	case LFUN_FONT_SIZE:
+	case LFUN_FONT_STATE:
+	case LFUN_FONT_UNDERLINE:
+	case LFUN_FONT_STRIKEOUT:
+	case LFUN_FONT_CROSSOUT:
+	case LFUN_FONT_UNDERUNDERLINE:
+	case LFUN_FONT_UNDERWAVE:
+	case LFUN_FONT_NO_SPELLCHECK:
+	case LFUN_TEXTSTYLE_UPDATE: {
+		if (cur.selIsMultiCell()) {
+			row_type rs, re;
+			col_type cs, ce;
+			getSelection(cur, rs, re, cs, ce);
+			bool enable;
+			for (row_type r = rs; r <= re; ++r) {
+				for (col_type c = cs; c <= ce; ++c) {
+					if (!tabular.cellInset(r, c)->getStatus(cur, cmd, status)) {
+						status.setEnabled(false);
+						return true;
+					}
+				}
+				status.setEnabled(true);
+				return true;
+			}
+		} else
+			return cell(cur.idx())->getStatus(cur, cmd, status);
+		break;
+	}
+
 	case LFUN_PARAGRAPH_BREAK:
 	case LFUN_NEWLINE_INSERT:
 		return cell(cur.idx())->getStatus(cur, cmd, status);
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs