[Libreoffice-commits] core.git: sw/source vcl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 18 11:32:00 UTC 2021


 sw/source/ui/misc/outline.cxx |    2 +-
 vcl/source/app/salvtables.cxx |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 36bc901426163aa38b551865d3dd57a3a3423910
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Mar 13 18:12:24 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Mar 18 12:31:11 2021 +0100

    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 <noel.grandin at collabora.co.uk>

diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index d9cc0113b696..9b65b575fbc4 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<sal_uInt16>(m_xFormBox->n_children() - 1)));
     SelectHdl(*m_xFormBox);
 }
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 7d309a7ebe13..9d47a3ec14a2 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3942,6 +3942,7 @@ void SalInstanceTreeView::select(int pos)
     else
     {
         SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
+        assert(pEntry && "bad pos?");
         m_xTreeView->Select(pEntry, true);
         m_xTreeView->MakeVisible(pEntry);
     }


More information about the Libreoffice-commits mailing list