diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-03-05 12:14:20 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-03-05 17:33:40 +0100 |
commit | db8b4d8c58e808f645a5d854b73c8a8132e2d898 (patch) | |
tree | 6925c4c95a8739938dbb42bdb95ce6efe4e34fe8 /include | |
parent | 9d152d29e2def8c15b493b1c8915aecee272a2fd (diff) |
sync get_selected_id with get_active_id
Change-Id: I983cc45d13e02a020f608b8e9abfd2f12f7b10f5
Reviewed-on: https://gerrit.libreoffice.org/68741
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/weld.hxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 6000bb53032c..5511879ed188 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -608,7 +608,11 @@ public: //by id virtual OUString get_id(int pos) const = 0; virtual int find_id(const OUString& rId) const = 0; - OUString get_selected_id() const { return get_id(get_selected_index()); } + OUString get_selected_id() const + { + int pos = get_selected_index(); + return pos == -1 ? OUString() : get_id(pos); + } void select_id(const OUString& rId) { select(find_id(rId)); } //via iter |