summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-08-31 15:23:58 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-09-01 13:41:09 +0200
commitaf002a22eea1a3a94649ab5154db55b266696787 (patch)
tree7a56da0c875ca6da552c55123952ced1814c87b3 /sw/source
parentc52ac477beefc46802148033adbca9edb9970ac1 (diff)
tdf#135636 the selection at dialog-launch time is lost by dialog-apply time
since... commit c3a085d22742f88e91ff92f319a26d6e8d1d9a98 Date: Tue Jan 23 18:13:01 2018 +0100 lokdialog: Convert the Table -> Properties... to async exec. so save it at launch and temp apply it during ok handler. This is somewhat similar to tdf#134439 Change-Id: Ia0869307b1a37e5efa1703e68b946793b0ddc91b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101679 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/shells/tabsh.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 0348f461f0e0..04dfbda01131 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -596,9 +596,13 @@ void SwTableShell::Execute(SfxRequest &rReq)
auto pRequest = std::make_shared<SfxRequest>(rReq);
rReq.Ignore(); // the 'old' request is not relevant any more
- pDlg->StartExecuteAsync([pDlg, pRequest, pTableRep, &rBindings, &rSh](sal_Int32 nResult){
+ auto xPaM(std::make_shared<SwPaM>(*rSh.GetCursor(), nullptr)); // tdf#135636 make a copy to use at later apply
+ pDlg->StartExecuteAsync([pDlg, pRequest, pTableRep, &rBindings, &rSh, xPaM](sal_Int32 nResult){
if (RET_OK == nResult)
{
+ rSh.Push(); // save current cursor on stack
+ rSh.SetSelection(*xPaM); // tdf#135636 set the table selected at dialog launch as current selection
+
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
//to record FN_INSERT_TABLE correctly
@@ -606,6 +610,8 @@ void SwTableShell::Execute(SfxRequest &rReq)
pRequest->Done(*pOutSet);
ItemSetToTableParam(*pOutSet, rSh);
+
+ rSh.Pop(SwCursorShell::PopMode::DeleteCurrent); // restore cursor from stack
}
rBindings.Update(SID_RULER_BORDERS);