summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2019-09-30 11:02:05 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-10-01 11:00:04 +0200
commit06831200607932a787430d6ea2c6860b26e4f3e1 (patch)
treebdff923d4f7c582a11e82863676825222e8319c0 /sw
parent2e8b54b172947c30df014fd7cbbfdc6c81f4b0f7 (diff)
tdf#116234 Apply email settings just set
Email configuration that is entered in the SwMailConfigDlg dialog is written to the (global) configuration, while the existing SwMailMergeConfig item 'xConfigItem' was not updated, so the newly entered values for the email server connection weren't applied for the current mail merge previously. In order to have them take effect, take over the new settings to 'xConfigItem' from the global config where those were just set. Change-Id: If0dae3ce26af797ffa728dca96f08dce3197557c Reviewed-on: https://gerrit.libreoffice.org/79847 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit a1573b2e2fda77b7b7d605fe36f5a28f86a3e91b) Reviewed-on: https://gerrit.libreoffice.org/79907 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/dbui/mmresultdialogs.cxx33
1 files changed, 33 insertions, 0 deletions
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx
index e02bdbfa7f71..8afecdea4e05 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -123,6 +123,35 @@ static OUString lcl_GetColumnValueOf(const OUString& rColumn, Reference < contai
return sRet;
}
+/**
+ * Replace email server settings in rConfigItem with those set in Writer's global
+ * mail merge config settings.
+ */
+static void lcl_UpdateEmailSettingsFromGlobalConfig(SwMailMergeConfigItem& rConfigItem)
+{
+ // newly created SwMailMergeConfigItem is initialized with values from (global) config
+ SwMailMergeConfigItem aConfigItem;
+
+ // take over email-related settings
+ rConfigItem.SetMailDisplayName(aConfigItem.GetMailDisplayName());
+ rConfigItem.SetMailAddress(aConfigItem.GetMailAddress());
+ rConfigItem.SetMailReplyTo(aConfigItem.GetMailReplyTo());
+ rConfigItem.SetMailReplyTo(aConfigItem.IsMailReplyTo());
+ rConfigItem.SetMailServer(aConfigItem.GetMailServer());
+ rConfigItem.SetMailPort(aConfigItem.GetMailPort());
+ rConfigItem.SetSecureConnection(aConfigItem.IsSecureConnection());
+ // authentication settings
+ rConfigItem.SetAuthentication(aConfigItem.IsAuthentication());
+ rConfigItem.SetSMTPAfterPOP(aConfigItem.IsSMTPAfterPOP());
+ rConfigItem.SetMailUserName(aConfigItem.GetMailUserName());
+ rConfigItem.SetMailPassword(aConfigItem.GetMailPassword());
+ rConfigItem.SetInServerName(aConfigItem.GetInServerName());
+ rConfigItem.SetInServerPort(aConfigItem.GetInServerPort());
+ rConfigItem.SetInServerPOP(aConfigItem.IsInServerPOP());
+ rConfigItem.SetInServerUserName(aConfigItem.GetInServerUserName());
+ rConfigItem.SetInServerPassword(aConfigItem.GetInServerPassword());
+}
+
class SwSaveWarningBox_Impl : public SwMessageAndEditDialog
{
DECL_LINK( ModifyHdl, weld::Entry&, void);
@@ -856,6 +885,10 @@ IMPL_LINK_NOARG(SwMMResultEmailDialog, SendDocumentsHdl_Impl, weld::Button&, voi
if(nRet != RET_OK && nRet != RET_YES)
return; // back to the dialog
+
+ // SwMailConfigDlg writes mail merge email settings only to (global) config,
+ // so copy them to the existing config item
+ lcl_UpdateEmailSettingsFromGlobalConfig(*xConfigItem.get());
}
//add the documents
sal_uInt32 nBegin = 0;