From b1df6d21bf9a608cccb7f34f6cebe9eee5cec18e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 5 Mar 2019 12:11:24 +0000 Subject: [PATCH] sync get_active_id impls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6b0595f6386657afa28b2cb249ea69aa51e5fb4a Reviewed-on: https://gerrit.libreoffice.org/68740 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/source/app/salvtables.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 325d320704fe..f0efbf9373e0 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -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;