sw/source/uibase/app/docst.cxx |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit ccdbffd86b934a400938a9f7408f62b23bd7b155
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Jan 19 11:00:52 2026 +0000
Commit:     Miklos Vajna <[email protected]>
CommitDate: Tue Jan 20 08:38:30 2026 +0100

    make new style by example async
    
    Change-Id: Icd274289defd44f1fdbb08c7e56d49a379a421e8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197570
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 3954fac8c625..99ad9f3b03a8 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -468,12 +468,18 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
                     case SID_STYLE_NEW_BY_EXAMPLE:
                     {
                         SfxStyleSheetBasePool& rPool = *GetStyleSheetPool();
-                        SfxNewStyleDlg aDlg(GetView()->GetFrameWeld(), rPool, 
nFamily);
-                        if (aDlg.run() == RET_OK)
-                        {
-                            aParam = aDlg.GetName();
-                            rReq.AppendItem(SfxStringItem(nSlot, aParam));
-                        }
+                        auto xDlg = 
std::make_shared<SfxNewStyleDlg>(GetView()->GetFrameWeld(), rPool, 
SfxStyleFamily::Para);
+                        auto xRequest = std::make_shared<SfxRequest>(rReq);
+                        rReq.Ignore();
+                        weld::GenericDialogController::runAsync(xDlg, [xDlg, 
xRequest=std::move(xRequest), this](sal_Int32 nResult){
+                            if (nResult == RET_OK) {
+                                OUString sName = xDlg->GetName();
+                                
xRequest->AppendItem(SfxStringItem(SID_STYLE_NEW_BY_EXAMPLE, sName));
+                                ApplyStyleSheetRequest(sName, 
SID_STYLE_NEW_BY_EXAMPLE, *xRequest, SfxStyleFamily::Para,
+                                                       
SfxStyleSearchBits::Auto, nullptr);
+                            }
+                        });
+                        return;
                     }
                     break;
 

Reply via email to