sc/source/ui/cctrl/checklistmenu.cxx |    4 +++-
 sc/source/ui/optdlg/tpusrlst.cxx     |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 8a5942c37465a88c761c52ed74f84073d54bcb0e
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Dec 21 20:19:22 2025 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Dec 22 10:17:29 2025 +0100

    cid#1676288 Improper use of negative value
    
    Change-Id: I9faefa9357d4bbcdb1c7b93f2c3fa331fad0effb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196054
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 9194ebc4cbd4..a1d935a8f9ad 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -573,7 +573,7 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, weld::Button&, rBtn, 
void )
         {
             sal_Int32 nSelList = mxLbLists->get_selected_index();
 
-            OSL_ENSURE( nSelList != -1 , "Modify without List :-/" );
+            assert(nSelList != -1 && "Modify without List :-/");
 
             if ( !theEntriesStr.isEmpty() )
             {
commit 1696f01afd2420acf2940cf6e2ec2df287074805
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Dec 21 20:17:12 2025 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Dec 22 10:17:21 2025 +0100

    cid#1676287 Improper use of negative value
    
    Change-Id: Ib0762ae5a1f64959703926c6e3c14c9ad1089002
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196053
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 31b7db762457..f6e3c2c16e32 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -71,7 +71,9 @@ IMPL_LINK_NOARG(ScCheckListMenuControl::SubMenuItemData, 
TimeoutHdl, Timer *, vo
 
 IMPL_LINK_NOARG(ScCheckListMenuControl, RowActivatedHdl, weld::TreeView&, bool)
 {
-    executeMenuItem(mxMenu->get_selected_index());
+    int nSelectedIndex = mxMenu->get_selected_index();
+    assert(nSelectedIndex >= 0 && "nothing selected");
+    executeMenuItem(nSelectedIndex);
     return true;
 }
 

Reply via email to