summaryrefslogtreecommitdiff
path: root/sw/source/ui/dbui/addresslistdialog.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/dbui/addresslistdialog.cxx')
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index 977a81addb2b..77291826ebb0 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -161,6 +161,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
bool bEnableEdit = false;
bool bEnableOK = true;
+ bool bSelected = false;
m_xListLB->unselect_all();
SwDBConfig aDb;
@@ -178,6 +179,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
if (rName == rCurrentData.sDataSource)
{
m_xListLB->select(*m_xIter);
+ bSelected = true;
m_xListLB->set_text(*m_xIter, rCurrentData.sCommand, 1);
pUserData->nCommandType = rCurrentData.nCommandType;
pUserData->xSource = rConfigItem.GetSource();
@@ -203,7 +205,10 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
}
}
- m_xOK->set_sensitive(m_xListLB->n_children() > 0 && bEnableOK);
+ bool bHasChildren = m_xListLB->n_children() > 0;
+ if (bHasChildren && !bSelected)
+ m_xListLB->select(0); // select the first entry if nothing else selected
+ m_xOK->set_sensitive(bHasChildren && bEnableOK);
m_xEditPB->set_sensitive(bEnableEdit);
m_xRemovePB->set_sensitive(m_xListLB->n_children() > 0);
m_xFilterPB->set_sensitive(m_xListLB->n_children() > 0);