cui/source/dialogs/FontFeaturesDialog.cxx | 12 +----------- cui/source/inc/FontFeaturesDialog.hxx | 5 +---- cui/source/tabpages/chardlg.cxx | 13 +++++++------ include/svx/srchdlg.hxx | 2 ++ svx/source/dialog/srchdlg.cxx | 30 +++++++++++++++++++++--------- 5 files changed, 32 insertions(+), 30 deletions(-)
New commits: commit 3adcba26d3975b5f1f089f770c1c53253cdf1be3 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Jan 19 19:51:44 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Feb 13 12:18:56 2026 +0100 name FontFeaturesDialog async Change-Id: I5d6ef3dbf0570b6cc78fe130d18774d28cf47f44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197609 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199320 Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx index f8ba8a683415..89719445fc9f 100644 --- a/cui/source/dialogs/FontFeaturesDialog.cxx +++ b/cui/source/dialogs/FontFeaturesDialog.cxx @@ -219,7 +219,7 @@ IMPL_LINK_NOARG(FontFeaturesDialog, ComboBoxSelectedHdl, weld::ComboBox&, void) updateFontPreview(); } -OUString FontFeaturesDialog::createFontNameWithFeatures() +OUString FontFeaturesDialog::createFontNameWithFeatures() const { OUString sResultFontName; OUStringBuffer sNameSuffix; @@ -263,16 +263,6 @@ OUString FontFeaturesDialog::createFontNameWithFeatures() return sResultFontName; } -short FontFeaturesDialog::run() -{ - short nResult = GenericDialogController::run(); - if (nResult == RET_OK) - { - m_sResultFontName = createFontNameWithFeatures(); - } - return nResult; -} - } // end svx namespace /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/FontFeaturesDialog.hxx b/cui/source/inc/FontFeaturesDialog.hxx index cd286d61938d..e54dc73e24e4 100644 --- a/cui/source/inc/FontFeaturesDialog.hxx +++ b/cui/source/inc/FontFeaturesDialog.hxx @@ -57,7 +57,6 @@ class FontFeaturesDialog : public weld::GenericDialogController private: std::vector<std::unique_ptr<FontFeatureItem>> m_aFeatureItems; OUString m_sFontName; - OUString m_sResultFontName; SvxFontPrevWindow m_aPreviewWindow; std::unique_ptr<weld::ScrolledWindow> m_xContentWindow; @@ -70,7 +69,6 @@ private: std::unique_ptr<weld::CustomWeld> m_xPreviewWindow; void initialize(); - OUString createFontNameWithFeatures(); // returns the max height of a row int fillGrid(std::vector<vcl::font::Feature> const& rFontFeatures); @@ -81,9 +79,8 @@ private: public: FontFeaturesDialog(weld::Window* pParent, OUString aFontName); ~FontFeaturesDialog() override; - virtual short run() override; - OUString const& getResultFontName() const { return m_sResultFontName; } + OUString createFontNameWithFeatures() const; void updateFontPreview(); }; diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index cf36f32c01b2..256ffb4d41fb 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -1146,12 +1146,13 @@ IMPL_LINK(SvxCharNamePage, FontFeatureButtonClicked, weld::Button&, rButton, voi if (!sFontName.isEmpty() && pNameBox) { - cui::FontFeaturesDialog aDialog(GetFrameWeld(), sFontName); - if (aDialog.run() == RET_OK) - { - pNameBox->set_entry_text(aDialog.getResultFontName()); - UpdatePreview_Impl(); - } + auto xDlg = std::make_shared<cui::FontFeaturesDialog>(GetFrameWeld(), sFontName); + weld::GenericDialogController::runAsync(xDlg, [xDlg, pNameBox, this](sal_Int32 nResult){ + if (nResult == RET_OK) { + pNameBox->set_entry_text(xDlg->createFontNameWithFeatures()); + UpdatePreview_Impl(); + } + }); } } commit 0e1c87b584a50d296cd54a3c2f3ad04fc1b9f35f Author: Caolán McNamara <[email protected]> AuthorDate: Mon Jan 19 16:46:19 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Feb 13 12:18:43 2026 +0100 make search SimilarityDialog async Change-Id: Ib8a704f929d557b7ceb45762fbcfe452346ea727 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197599 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199319 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx index 0093b4751514..f10dc30d119a 100644 --- a/include/svx/srchdlg.hxx +++ b/include/svx/srchdlg.hxx @@ -272,6 +272,8 @@ private: SVX_DLLPRIVATE bool IsOtherOptionsExpanded() const; SVX_DLLPRIVATE short executeSubDialog(VclAbstractDialog * dialog); + SVX_DLLPRIVATE void executeSubDialog(VclPtr<VclAbstractDialog> dialog, + const std::function<void(sal_Int32)>& func); DECL_DLLPRIVATE_LINK(PresentTimeoutHdl_Impl, Timer*, void); }; diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index d6dd7adcb6df..fa814ea57ddb 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -1395,17 +1395,18 @@ IMPL_LINK(SvxSearchDialog, CommandHdl_Impl, weld::Button&, rBtn, void) else if (&rBtn == m_xSimilarityBtn.get()) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxSearchSimilarityDialog> pDlg(pFact->CreateSvxSearchSimilarityDialog( + VclPtr<AbstractSvxSearchSimilarityDialog> pDlg(pFact->CreateSvxSearchSimilarityDialog( m_xDialog.get(), m_pSearchItem->IsLEVRelaxed(), m_pSearchItem->GetLEVOther(), m_pSearchItem->GetLEVShorter(), m_pSearchItem->GetLEVLonger())); - if ( executeSubDialog(pDlg.get()) == RET_OK ) - { - m_pSearchItem->SetLEVRelaxed(pDlg->IsRelaxed()); - m_pSearchItem->SetLEVOther(pDlg->GetOther()); - m_pSearchItem->SetLEVShorter(pDlg->GetShorter()); - m_pSearchItem->SetLEVLonger(pDlg->GetLonger()); - SaveToModule_Impl(); - } + executeSubDialog(pDlg, [pDlg, this](sal_Int32 nResult) { + if (nResult == RET_OK ) { + m_pSearchItem->SetLEVRelaxed(pDlg->IsRelaxed()); + m_pSearchItem->SetLEVOther(pDlg->GetOther()); + m_pSearchItem->SetLEVShorter(pDlg->GetShorter()); + m_pSearchItem->SetLEVLonger(pDlg->GetLonger()); + SaveToModule_Impl(); + }; + }); } else if (&rBtn == m_xJapOptionsBtn.get()) { @@ -2334,6 +2335,17 @@ short SvxSearchDialog::executeSubDialog(VclAbstractDialog * dialog) { return dialog->Execute(); } +void SvxSearchDialog::executeSubDialog(VclPtr<VclAbstractDialog> dialog, const std::function<void(sal_Int32)>& func) { + assert(!m_executingSubDialog); + m_executingSubDialog = true; + + dialog->StartExecuteAsync([dialog, func, this](sal_Int32 nResult) { + func(nResult); + dialog->disposeOnce(); + m_executingSubDialog = false; + }); +} + SFX_IMPL_CHILDWINDOW_WITHID(SvxSearchDialogWrapper, SID_SEARCH_DLG);
