From c08511c560acb4fb22157eeb4798ccac51ffdfdf Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Tue, 6 Oct 2026 15:55:06 -0400 Subject: [PATCH] tdf#173510 svx: prevent another crash when table style deselected This fixes a regression from commit 4fb31ea85f94c0cffba2282a119811833e584570 When you de-select a table style in Table - AutoFormat Styles, then the checkboxes below were left enabled despite a -1 index, so the rename and renew buttons would crash. Change-Id: I3c9601476f874116e43387ee40e934932a44b311 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211922 Tested-by: Jenkins Reviewed-by: Justin Luth --- svx/source/dialog/TableAutoFmtDlg.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/dialog/TableAutoFmtDlg.cxx b/svx/source/dialog/TableAutoFmtDlg.cxx index 219ad28f0390..ce339f71986f 100644 --- a/svx/source/dialog/TableAutoFmtDlg.cxx +++ b/svx/source/dialog/TableAutoFmtDlg.cxx @@ -158,7 +158,7 @@ void SvxTableAutoFmtDlg::PopulateFormatList() void SvxTableAutoFmtDlg::UpdateUIState() { - const bool bCanModify = mnIndex != DEFAULT_STYLE; + const bool bCanModify = mnIndex != DEFAULT_STYLE && mnIndex < mpFormat.size(); mxBtnRename->set_sensitive(bCanModify); mxBtnRemove->set_sensitive(bCanModify); }