vcl/jsdialog/jsdialogbuilder.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit f98d8398b65195ecc82d8d32467790f9a3487a87
Author:     Dennis Francis <[email protected]>
AuthorDate: Tue Feb 24 18:32:09 2026 +0530
Commit:     Dennis Francis <[email protected]>
CommitDate: Wed Feb 25 11:47:55 2026 +0100

    lok:followup: warn if existing notifier is not same
    
    Signed-off-by: Dennis Francis <[email protected]>
    Change-Id: I9d5df7443e518078c95bb9d85dd82ec530fd17ff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200201
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 830ffa5d8f4e..a47c3135a90b 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -934,8 +934,14 @@ JSInstanceBuilder::CreateMessageDialog(weld::Widget* 
pParent, VclMessageType eMe
                                                    eButtonType);
 
     // SetLOKNotifier() asserts that xMessageDialog has no LOKNotifier already.
-    if (pNotifier && !xMessageDialog->GetLOKNotifier())
-        xMessageDialog->SetLOKNotifier(pNotifier);
+    auto* pExistingNotifier = xMessageDialog->GetLOKNotifier();
+    if (pNotifier)
+    {
+        if (!pExistingNotifier)
+            xMessageDialog->SetLOKNotifier(pNotifier);
+        else if (pExistingNotifier != pNotifier)
+            SAL_WARN("vcl", "A different notifier already exists for the 
MessageDialog");
+    }
 
     pNotifier = xMessageDialog->GetLOKNotifier();
     if (pNotifier)

Reply via email to