[Libreoffice-commits] core.git: sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 31 19:57:48 UTC 2020
sw/source/uibase/shells/tabsh.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 81f91196b98af38e29af451b86c26a893a109abc
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 31 15:23:58 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Aug 31 21:57:10 2020 +0200
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/+/101743
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 3f1fca336f3a..1fa8f287fbff 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);
More information about the Libreoffice-commits
mailing list