summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-05-17 14:48:20 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-05-17 18:12:11 +0200
commit4d52d2bc81f9d27472fe368785912a530489d046 (patch)
tree74629b2e5e94d17b4147984794e5c2e38d0b3405
parentc29f91f3d7a0deb902b900ff07e6c32632b8c958 (diff)
tdf#142165 restore a SwShellTableCursor if the orig selection described that
so that we are operating on the same selection that existed when the dialog was originally launched we need to avoid the assert of commit 6db71f70a3b200d4074f6cda8ce445e9861d3296 tdf#140977 drop possible table-cursor before setting the new one and support the multi-selection of commit e08b446e46f56e15af58fdd4396afba1a316f9e5 tdf#140257 duplicate entire PaM ring when making copy and support not scrolling to a different location on changing a table page break style of commit 9c61732677d038e32b73fc9fb883aced14c0febf tdf#135916 just set the target table as selection and keep making it possible to remove aa page break on a table of commit 81f91196b98af38e29af451b86c26a893a109abc tdf#135636 the selection at dialog-launch time is lost by dialog-apply time all of which is necessitated by commit c3a085d22742f88e91ff92f319a26d6e8d1d9a98 lokdialog: Convert the Table -> Properties... to async exec. Change-Id: Ide5f953e63da46a8750e85d623310af0062b048b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115709 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/uibase/shells/tabsh.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 9c73c9923a2d..3eb0e9b6ed4f 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -597,14 +597,18 @@ void SwTableShell::Execute(SfxRequest &rReq)
auto pRequest = std::make_shared<SfxRequest>(rReq);
rReq.Ignore(); // the 'old' request is not relevant any more
- auto vCursors = CopyPaMRing(*rSh.GetCursor()); // tdf#135636 make a copy to use at later apply
+ SwPaM* pCursor = rSh.IsTableMode() ? rSh.GetTableCrs() : rSh.GetCursor(); // tdf#142165 use table cursor if in table mode
+ auto vCursors = CopyPaMRing(*pCursor); // tdf#135636 make a copy to use at later apply
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
+ // tdf#135636 set the table selected at dialog launch as current selection
+ rSh.SetSelection(*vCursors->front()); // UpdateCursor() will be called which in the case
+ // of a table selection should recreate a
+ // SwShellTableCursor
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();