vcl/qt5/QtInstanceDialog.cxx |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit b520cf15a3569d683ac39edb7fb0202317b927cf
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Oct 25 20:55:20 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Oct 26 13:11:48 2024 +0200

    tdf#130857 qt weld: Allow null func for async dialog
    
    Drop the assert that a function to call is set
    in QtInstanceDialog::dialogFinished and just skip
    that step if none is set.
    
    While `m_aRunAsyncFunc` gets set in both
    QtInstanceDialog::runAsync variants and
    QtInstanceDialog::dialogFinished shouldn't get
    called without these having been called first,
    QtInstanceDialog::runAsync can explicitly be called with
    null for the function, which is the case e.g. for the
    "Help" -> "About" dialog (s. the SID_ABOUT case in
    SfxApplication::MiscExec_Impl), so that assert
    triggers in a WIP branch for implementing support
    for that dialog using native Qt widgets when the
    dialog is closed.
    
    Change-Id: I18578a4b1780b05f59817ad85eee3c3a20ba3b41
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175660
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtInstanceDialog.cxx b/vcl/qt5/QtInstanceDialog.cxx
index 76efd3eca167..059a8fd5f6e5 100644
--- a/vcl/qt5/QtInstanceDialog.cxx
+++ b/vcl/qt5/QtInstanceDialog.cxx
@@ -148,8 +148,6 @@ void QtInstanceDialog::dialogFinished(int nResult)
         return;
     }
 
-    assert(m_aRunAsyncFunc);
-
     disconnect(m_pDialog.get(), &QDialog::finished, this, 
&QtInstanceDialog::dialogFinished);
 
     // use local variables for these, as members might have got de-allocated 
by the time they're reset
@@ -160,7 +158,8 @@ void QtInstanceDialog::dialogFinished(int nResult)
     m_xRunAsyncDialogController.reset();
     m_xRunAsyncDialog.reset();
 
-    aFunc(nResult);
+    if (aFunc)
+        aFunc(nResult);
 
     xRunAsyncDialogController.reset();
     xRunAsyncDialog.reset();

Reply via email to