include/vcl/weld.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit db8b4d8c58e808f645a5d854b73c8a8132e2d898 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Mar 5 12:14:20 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Mar 5 17:33:40 2019 +0100 sync get_selected_id with get_active_id Change-Id: I983cc45d13e02a020f608b8e9abfd2f12f7b10f5 Reviewed-on: https://gerrit.libreoffice.org/68741 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> 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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits