sw/source/uibase/shells/tabsh.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit af002a22eea1a3a94649ab5154db55b266696787
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Aug 31 15:23:58 2020 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Sep 1 13:41:09 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/+/101679
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

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);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to