diff options
author | Henry Castro <hcastro@collabora.com> | 2018-03-05 09:03:10 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2018-03-05 20:23:48 +0100 |
commit | 3e8d1e80d81999d2c5e160b756491a847226d423 (patch) | |
tree | 1e67f3116248dc9211b6199e83e24c8ba829a678 /sw/source/uibase/app | |
parent | c92af727f70b0ccc16450bb340f9bff713a42ce1 (diff) |
lokdialog: more, convert the dialog to async exec
ClassificationDialog
SwWatermarkDialog
Change-Id: I835648df8df5ad3ee5a404a582c2179e5b3b276a
Reviewed-on: https://gerrit.libreoffice.org/50771
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'sw/source/uibase/app')
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index a78e295d0604..efdba307cff3 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1172,22 +1172,22 @@ void SwDocShell::Execute(SfxRequest& rReq) break; case SID_CLASSIFICATION_DIALOG: { - ScopedVclPtr<svx::ClassificationDialog> pDialog(VclPtr<svx::ClassificationDialog>::Create(nullptr, false)); + VclPtr<svx::ClassificationDialog> pDialog(VclPtr<svx::ClassificationDialog>::Create(&GetView()->GetViewFrame()->GetWindow(), false)); SwWrtShell* pShell = GetWrtShell(); std::vector<svx::ClassificationResult> aInput = pShell->CollectAdvancedClassification(); pDialog->setupValues(aInput); - if (RET_OK == pDialog->Execute()) - pShell->ApplyAdvancedClassification(pDialog->getResult()); - - pDialog.disposeAndClear(); + pDialog->StartExecuteAsync([pDialog, pShell](sal_Int32 nResult){ + if (RET_OK == nResult) + pShell->ApplyAdvancedClassification(pDialog->getResult()); + }); } break; case SID_PARAGRAPH_SIGN_CLASSIFY_DLG: { SwWrtShell* pShell = GetWrtShell(); - ScopedVclPtr<svx::ClassificationDialog> pDialog(VclPtr<svx::ClassificationDialog>::Create(nullptr, true, [pShell]() + VclPtr<svx::ClassificationDialog> pDialog(VclPtr<svx::ClassificationDialog>::Create(&GetView()->GetViewFrame()->GetWindow(), true, [pShell]() { pShell->SignParagraph(); })); @@ -1195,10 +1195,10 @@ void SwDocShell::Execute(SfxRequest& rReq) std::vector<svx::ClassificationResult> aInput = pShell->CollectParagraphClassification(); pDialog->setupValues(aInput); - if (RET_OK == pDialog->Execute()) - pShell->ApplyParagraphClassification(pDialog->getResult()); - - pDialog.disposeAndClear(); + pDialog->StartExecuteAsync([pDialog, pShell](sal_Int32 nResult){ + if (RET_OK == nResult) + pShell->ApplyParagraphClassification(pDialog->getResult()); + }); } break; case SID_WATERMARK: @@ -1226,9 +1226,8 @@ void SwDocShell::Execute(SfxRequest& rReq) { SfxViewShell* pViewShell = GetView()? GetView(): SfxViewShell::Current(); SfxBindings& rBindings( pViewShell->GetViewFrame()->GetBindings() ); - ScopedVclPtr<SwWatermarkDialog> pDlg( VclPtr<SwWatermarkDialog>::Create( nullptr, rBindings ) ); - pDlg->Execute(); - pDlg.disposeAndClear(); + VclPtr<SwWatermarkDialog> pDlg(VclPtr<SwWatermarkDialog>::Create(&GetView()->GetViewFrame()->GetWindow(), rBindings)); + pDlg->StartExecuteAsync([](sal_Int32 /*nResult*/){}); } } } |