sw/source/ui/dbui/mmoutputtypepage.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit ac165ad008d820dc102f98569f8bb9b6653b852d
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Tue Apr 5 10:06:51 2022 +0300
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed Apr 6 10:33:14 2022 +0200

    tdf#148384: Really leave mail merge results dialog open upon errors
    
    Restructuring mail merge in 5.2 cycle had broken the dialog keeping
    open when errors happened during sending. Later, in 2017, in commit
    bfaa6e35ff09a0426d2c3c9c36f069fabc0c9489
      Author Alex McMurchy1917 <mcmurchy1917-libreoff...@yahoo.co.uk>
      Date   Thu Aug 24 14:34:13 2017 +0100
        tdf#103919 mailmerge: prevent premature end of emailing
    
    SwSendMailDialog::AllMailsSent was changed in attempt to restore that
    expected behavior, but the condition was incorrect:
    m_nSendCount == m_nExpectedCount means "all mails processed", not
    "everything went without errors".
    
    So fix this by considering the error count when deciding to close the
    dialog.
    
    Change-Id: I98d61165803deaf0da985167ba0152e6f50f9246
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132563
    Tested-by: Mike Kaganski <mike.kagan...@collabora.com>
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    (cherry picked from commit 2d9f12be1530f2532276a2447102ed2f1f0ecb5b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132598
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx 
b/sw/source/ui/dbui/mmoutputtypepage.cxx
index e8c8e35bc3dc..b0c22b9144cf 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -511,12 +511,15 @@ void SwSendMailDialog::UpdateTransferStatus()
 
 void SwSendMailDialog::AllMailsSent()
 {
-    // Leave open if some kind of error occurred
     if (m_nSendCount == m_nExpectedCount)
     {
         m_xStop->set_sensitive(false);
-        m_xDialog->hide();
-        m_xDialog->response(RET_CANCEL);
+        // Leave open if some kind of error occurred
+        if (m_nErrorCount == 0)
+        {
+            m_xDialog->hide();
+            m_xDialog->response(RET_CANCEL);
+        }
     }
 }
 

Reply via email to