From 197863f377470b4c6efa636ec40389b3a10aa808 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Tue, 6 Oct 2026 19:16:10 -0400 Subject: [PATCH] tdf#173510 sw: allow AutoFormat styles to remove table style You can remove a table style by Ctrl-clicking on the selected one. (Probably nobody will find this - it probably needs a help tip.) This was kind-of working before 26.8 (when chosing 'None') but not as 'nice'. Then at least it STOPPED applying the style when new changes are made. I assume that a lot of the work that when into table styles in 26.8 made it so that with this patch's change, the existing format is cleared to nothing as the style is removed. Clearing the existing seems like a good thing to me. Change-Id: I174b3e8a408995500598937bbb548250c80bc40f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211925 Tested-by: Jenkins Reviewed-by: Justin Luth --- sw/source/uibase/shells/tabsh.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 5caa0f95c54b..679f7efb5ae2 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -891,6 +891,11 @@ void SwTableShell::Execute(SfxRequest &rReq) size_t nIndex = aDlg.GetIndex(); if (nIndex < rFormats.size()) rSh.SetTableStyle(*rFormats.GetData(nIndex)); + else + { + TableStyleName aNone; + rSh.UpdateTableStyleFormatting(nullptr, false, &aNone); + } } break;