vcl/source/treelist/treelistbox.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit c1d94ca2cf558c38f62b9893bc3e9cba56a1a1a7 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Feb 19 13:44:25 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Feb 19 20:48:59 2019 +0100 survive sorting when a row may not have any string in it yet Change-Id: Idbea259266da817803ebb3d2f36ca0c0fca9bf3b Reviewed-on: https://gerrit.libreoffice.org/68019 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index aa91551177d8..e306d7df0e47 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -3316,8 +3316,10 @@ IMPL_LINK( SvTreeListBox, DefaultCompare, const SvSortData&, rData, sal_Int32 ) { const SvTreeListEntry* pLeft = rData.pLeft; const SvTreeListEntry* pRight = rData.pRight; - OUString aLeft( static_cast<const SvLBoxString*>(pLeft->GetFirstItem(SvLBoxItemType::String))->GetText()); - OUString aRight( static_cast<const SvLBoxString*>(pRight->GetFirstItem(SvLBoxItemType::String))->GetText()); + const SvLBoxString* pLeftText = static_cast<const SvLBoxString*>(pLeft->GetFirstItem(SvLBoxItemType::String)); + const SvLBoxString* pRightText = static_cast<const SvLBoxString*>(pRight->GetFirstItem(SvLBoxItemType::String)); + OUString aLeft = pLeftText ? pLeftText->GetText() : OUString(); + OUString aRight = pRightText ? pRightText->GetText() : OUString(); pImpl->UpdateStringSorter(); return pImpl->m_pStringSorter->compare(aLeft, aRight); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits