cui/source/dialogs/FontFeaturesDialog.cxx |   12 +-----------
 cui/source/inc/FontFeaturesDialog.hxx     |    5 +----
 cui/source/tabpages/chardlg.cxx           |   13 +++++++------
 3 files changed, 9 insertions(+), 21 deletions(-)

New commits:
commit e0e41cdef37ff9cbae8f7985bd258f6bf6a6474e
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Jan 19 19:51:44 2026 +0000
Commit:     Miklos Vajna <[email protected]>
CommitDate: Wed Jan 21 10:39:58 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]>

diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx 
b/cui/source/dialogs/FontFeaturesDialog.cxx
index feb7f401025c..1dd9f20ac3cc 100644
--- a/cui/source/dialogs/FontFeaturesDialog.cxx
+++ b/cui/source/dialogs/FontFeaturesDialog.cxx
@@ -216,7 +216,7 @@ IMPL_LINK_NOARG(FontFeaturesDialog, ComboBoxSelectedHdl, 
weld::ComboBox&, void)
     updateFontPreview();
 }
 
-OUString FontFeaturesDialog::createFontNameWithFeatures()
+OUString FontFeaturesDialog::createFontNameWithFeatures() const
 {
     OUString sResultFontName;
     OUStringBuffer sNameSuffix;
@@ -260,16 +260,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 e1c8d9d97163..b852f45fc5bf 100644
--- a/cui/source/inc/FontFeaturesDialog.hxx
+++ b/cui/source/inc/FontFeaturesDialog.hxx
@@ -51,7 +51,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;
@@ -64,7 +63,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);
@@ -75,9 +73,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 a8d4f716ca3b..0b7aa845bf53 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1151,12 +1151,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();
+            }
+        });
     }
 }
 

Reply via email to