From ebbf550f7087b173bdcf600a02bb87c0b655e787 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 13 Mar 2021 18:12:24 +0200 Subject: tdf#140590 Writer crash in Tools>Chapter Numbering and an assert in vcl to catch it a little higher up the stack. Change-Id: Iaa2e70f901f93ca9f678118e4f5a8bc1b6eda20a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112459 Tested-by: Jenkins Reviewed-by: Noel Grandin Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112866 --- sw/source/ui/misc/outline.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index e9b147f4d343..a7004880ad0c 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -92,7 +92,7 @@ void SwNumNamesDlg::SetUserNames(const OUString *pList[]) nSelect++; } } - m_xFormBox->select(nSelect); + m_xFormBox->select(std::min(nSelect, static_cast(m_xFormBox->n_children() - 1))); SelectHdl(*m_xFormBox); } -- cgit v1.2.3