tdf#148382: Keep first entry selected when address field is not set
commit1e50737b57df0b3683063f73d78abee5ea20fb27
authorMike Kaganski <mike.kaganski@collabora.com>
Tue, 5 Apr 2022 06:53:39 +0000 (5 09:53 +0300)
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>
Thu, 7 Apr 2022 06:22:34 +0000 (7 08:22 +0200)
tree78749e0ea89176cddcdeddfe51b30622ecedc2d0
parentb60e4b4ba11c726cbbc45f0747d8fc4d3da0ed74
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>
(cherry picked from commit 304be70b5b082ac4854dadc9e6a7c15075dd28b2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132597
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
sw/source/ui/dbui/mmresultdialogs.cxx