diff options
author | Hannah Meeks <hmeeks4135@gmail.com> | 2023-01-25 11:07:28 +0000 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2023-02-01 06:27:15 +0000 |
commit | 36343165c251e30c700360cc5c4266f576d4ac00 (patch) | |
tree | 5bdc5183e4a585474469f65c28e2e6fa3543bc1d | |
parent | bed16c5e9df1eea4187b2b47a357414b3940bc91 (diff) |
cui: Make SimilaritySearch dialog async and enable use for jsdialog
Change-Id: I89c6665138c94aa355efbbc4aa0947226c68af5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146130
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r-- | cui/source/dialogs/cuifmsearch.cxx | 9 | ||||
-rw-r--r-- | vcl/jsdialog/enabled.cxx | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index f1af2838c4b8..bb3bfaf5cac5 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -312,15 +312,20 @@ IMPL_LINK(FmSearchDialog, OnClickedSpecialSettings, weld::Button&, rButton, void if (m_ppbApproxSettings.get() == &rButton) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxSearchSimilarityDialog> pDlg(pFact->CreateSvxSearchSimilarityDialog(m_xDialog.get(), m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(), + + VclPtr<AbstractSvxSearchSimilarityDialog> pDlg(pFact->CreateSvxSearchSimilarityDialog(m_xDialog.get(), m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(), m_pSearchEngine->GetLevShorter(), m_pSearchEngine->GetLevLonger() )); - if (pDlg->Execute() == RET_OK) + pDlg->StartExecuteAsync([pDlg, this](sal_Int32 nResult){ + + if (nResult == RET_OK) { m_pSearchEngine->SetLevRelaxed( pDlg->IsRelaxed() ); m_pSearchEngine->SetLevOther( pDlg->GetOther() ); m_pSearchEngine->SetLevShorter(pDlg->GetShorter() ); m_pSearchEngine->SetLevLonger( pDlg->GetLonger() ); } + pDlg->disposeOnce(); + }); } else if (m_pSoundsLikeCJKSettings.get() == &rButton) { diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index e0791954d5f8..c11365d6dcbc 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -39,6 +39,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile) || rUIFile == u"cui/ui/numberingformatpage.ui" || rUIFile == u"cui/ui/password.ui" || rUIFile == u"cui/ui/splitcellsdialog.ui" + || rUIFile == u"cui/ui/similaritysearchdialog.ui" || rUIFile == u"cui/ui/widgettestdialog.ui" // scalc || rUIFile == u"modules/scalc/ui/analysisofvariancedialog.ui" |