sw/source/uibase/shells/textsh1.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
New commits: commit 48acaca27e84b914d37770a75b37da264e1a96fb Author: Patrick Luby <guibmac...@gmail.com> AuthorDate: Fri May 31 16:23:59 2024 -0400 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Wed Jun 12 08:49:33 2024 +0200 tdf#160801 fix crash by delaying resetting of attributes Calling SwWrtShell::ResetAttr() will sometimes delete the current SwTextShell instance so call it after clearing the direct formatting flag. Change-Id: I43a66527cee30271447dff30f166086c6759e162 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168304 Tested-by: Jenkins Reviewed-by: Patrick Luby <guibomac...@gmail.com> (cherry picked from commit 6f4adc1274cfac30b9097411bb193bd4386969f0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168628 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 2bf6c670e489..df26346fc23d 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1041,12 +1041,17 @@ void SwTextShell::Execute(SfxRequest &rReq) for (sal_uInt16 i = nBegin; i <= nEnd; ++i) aAttribs.insert( i ); } - rWrtSh.ResetAttr( aAttribs ); // also clear the direct formatting flag inside SwTableBox(es) if (SwFEShell* pFEShell = GetView().GetDocShell()->GetFEShell()) pFEShell->UpdateTableStyleFormatting(nullptr, true); + // tdf#160801 fix crash by delaying resetting of attributes + // Calling SwWrtShell::ResetAttr() will sometimes delete the + // current SwTextShell instance so call it after clearing the + // direct formatting flag. + rWrtSh.ResetAttr( aAttribs ); + rReq.Done(); break; }