tdf#140977 drop possible table-cursor before setting the new one

Change-Id: I3d278af77886af3413b4a15464c8a52caa9a8e02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112310
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 34d98f6..0362745 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -600,6 +600,9 @@ void SwTableShell::Execute(SfxRequest &rReq)
                pDlg->StartExecuteAsync([pDlg, pRequest, pTableRep, &rBindings, &rSh, vCursors](sal_Int32 nResult){
                    if (RET_OK == nResult)
                    {
                        if (rSh.IsTableMode()) // tdf#140977 drop possible table-cursor before setting the new one
                            rSh.TableCursorToCursor();

                        rSh.SetSelection(*vCursors->front()); // tdf#135636 set the table selected at dialog launch as current selection

                        const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();