include/svtools/genericasyncunodialog.hxx |    7 +++++++
 include/vcl/abstdlg.hxx                   |    6 ++++++
 2 files changed, 13 insertions(+)

New commits:
commit 8f215fab5593070556e903121cc195660e16105c
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Fri Jan 5 13:50:34 2024 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Jan 12 11:40:58 2024 +0100

    Document a bit async methods
    
    Retrieved from Miklos' feedback in
    https://lists.freedesktop.org/archives/libreoffice/2024-January/091377.html
    Thank you to him!
    
    Change-Id: I13f074b12cae0ffbc78a4c580d7f0ce58f0ea1e6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161664
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins

diff --git a/include/svtools/genericasyncunodialog.hxx 
b/include/svtools/genericasyncunodialog.hxx
index 058c37b00cdb..64fe80d5f9eb 100644
--- a/include/svtools/genericasyncunodialog.hxx
+++ b/include/svtools/genericasyncunodialog.hxx
@@ -32,6 +32,13 @@ typedef cppu::ImplInheritanceHelper<::svt::OGenericUnoDialog,
     OGenericUnoAsyncDialogBase;
 
 /** abstract base class for implementing UNO objects representing asynchronous 
dialogs
+
+    Contrary to StartExecuteAsync in VclAbstractDialog from 
include/vcl/abstdlg.hxx,
+    the different methods are used in a special case when an import or export 
action
+    wants to show a dialog, as part of a synchronous filter() API call.
+
+    In this case it's not possible to move the "rest of the code" to an async
+    callback, so that needs special handling. Luckily these dialogs are rather 
rare.
     */
 template <typename T> class OGenericUnoAsyncDialog : public 
OGenericUnoAsyncDialogBase
 {
diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx
index 793d8cdd36a9..9fbe53529cff 100644
--- a/include/vcl/abstdlg.hxx
+++ b/include/vcl/abstdlg.hxx
@@ -65,6 +65,12 @@ public:
         bool isSet() const { return !!maEndDialogFn; }
     };
 
+    /**
+    * Usual codepath for modal dialogs. Some uno command decides to open a 
dialog,
+      we call StartExecuteAsync() with a callback to handle the dialog result
+      and that handler will be executed at some stage in the future,
+      instead of right now.
+    */
     bool StartExecuteAsync(const std::function<void(sal_Int32)> &rEndDialogFn)
     {
         AsyncContext aCtx;

Reply via email to