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

New commits:
commit e63d10c0133a366e57cc5dd884d8632cb15c2669
Author:     Dennis Francis <[email protected]>
AuthorDate: Tue Feb 24 18:32:09 2026 +0530
Commit:     Dennis Francis <[email protected]>
CommitDate: Wed Feb 25 11:53:46 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/+/200199
    Tested-by: Jenkins

diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index ba1bb6f9b199..93cd2f5ff169 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