sync get_active_id impls

Change-Id: I6b0595f6386657afa28b2cb249ea69aa51e5fb4a
Reviewed-on: https://gerrit.libreoffice.org/68740
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2019-03-05 12:11:24 +00:00
parent b7ddc514bf
commit b1df6d21bf

View File

@@ -3677,7 +3677,12 @@ public:
virtual OUString get_active_id() const override
{
const OUString* pRet = getEntryData(m_xComboBox->GetSelectedEntryPos());
sal_Int32 nPos = m_xComboBox->GetSelectedEntryPos();
const OUString* pRet;
if (nPos != LISTBOX_ENTRY_NOTFOUND)
pRet = getEntryData(m_xComboBox->GetSelectedEntryPos());
else
pRet = nullptr;
if (!pRet)
return OUString();
return *pRet;