summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorPatrick Luby <guibmacdev@gmail.com>2024-05-31 16:23:59 -0400
committerPatrick Luby <guibomacdev@gmail.com>2024-06-11 23:18:56 +0200
commit6f4adc1274cfac30b9097411bb193bd4386969f0 (patch)
tree02c79c8bdb7b0b7d908708ad747d26e6c7694832 /sw
parent8fadd44f5947e1022d3431e3ac781b0924c7652e (diff)
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 <guibomacdev@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/shells/textsh1.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index a51c7f6432be..0144b01dbfaf 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1049,12 +1049,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;
}