diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2019-09-30 11:02:05 +0000 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2019-10-01 07:45:24 +0200 |
commit | a1573b2e2fda77b7b7d605fe36f5a28f86a3e91b (patch) | |
tree | 171161b3175eee426bc43d8bc1f9544d72cd68c5 /sw/source/ui/dbui | |
parent | 2d4bb24588dc872ba856dd4430541e0e0a641b7e (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>
Diffstat (limited to 'sw/source/ui/dbui')
-rw-r--r-- | sw/source/ui/dbui/mmresultdialogs.cxx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index ef96c5b31029..2b7d5e2ab2d2 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -124,6 +124,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; |