cui/source/dialogs/cuifmsearch.cxx |    9 +++++++--
 vcl/jsdialog/enabled.cxx           |    1 +
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 36343165c251e30c700360cc5c4266f576d4ac00
Author:     Hannah Meeks <hmeeks4...@gmail.com>
AuthorDate: Wed Jan 25 11:07:28 2023 +0000
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Wed Feb 1 06:27:15 2023 +0000

    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.k...@collabora.com>

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"

Reply via email to