diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-04-05 09:53:39 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-04-05 17:00:46 +0200 |
commit | 304be70b5b082ac4854dadc9e6a7c15075dd28b2 (patch) | |
tree | a5de359e5640802657c6bbedab01348cf6ef4584 /sw/source/ui/dbui | |
parent | fafadd7aee8c384af210008f693b5007a9f5ea48 (diff) |
tdf#148382: Keep first entry selected when address field is not set
Regression after commit f1ca64800074530d95e507f93c764a687310b9eb
Author Caolán McNamara <caolanm@redhat.com>
Date Thu Oct 18 09:52:28 2018 +0100
weld SwMMResultEmailDialog
ListBox::SelectEntry did not change previous selection in case the
entry was not found (because GetEntryPos would then return a huge
"not found" value). OTOH, weld::ComboBox::set_active_text clears
selection in that case (because find_text would return -1).
The code makes sure to pre-select entry 0 before attempting to
select an explicitly configured adderss field name; so keeping
that entry selected when no field name is configured is expected.
Change-Id: I9c8704261ce19bf06633bd4791d294fb16e76f63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132562
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/ui/dbui')
-rw-r--r-- | sw/source/ui/dbui/mmresultdialogs.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index 0e01be311588..d31654bf474c 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -444,7 +444,8 @@ void SwMMResultEmailDialog::FillInEmailSettings() Sequence< OUString> aAssignment = xConfigItem->GetColumnAssignment(xConfigItem->GetCurrentDBData()); if (aAssignment.getLength() > MM_PART_E_MAIL && !aAssignment[MM_PART_E_MAIL].isEmpty()) sEMailColumn = aAssignment[MM_PART_E_MAIL]; - m_xMailToLB->set_active_text(sEMailColumn); + if (int pos = m_xMailToLB->find_text(sEMailColumn); pos >= 0) + m_xMailToLB->set_active(pos); // HTML format pre-selected m_xSendAsLB->set_active(3); |