From a8314f77a4735d50b51dacddc810a3790faf35dc Mon Sep 17 00:00:00 2001
From: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed, 10 Jul 2024 11:39:11 +0200
Subject: icon choice ctrl a11y: Drop extra check

`AccessibleIconChoiceCtrl::getAccessibleChildCount`
returns the the number of elements in the
`SvxIconChoiceCtrl_Impl::maEntries` vector, and
`SvtIconChoiceCtrl->GetEntry` returns the
the element at the given index.

Given the index check above, a valid entry
should always be there, so drop the extra check
that would throw a RuntimeException
in `AccessibleIconChoiceCtrl::getAccessibleChild`.
The `pEntry` isn't otherwise used right here anyway.

Change-Id: I446b6d8d92780d484ebf5fc531bfa51a7c87cac7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170372
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
---
 accessibility/source/extended/accessibleiconchoicectrl.cxx | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index 950e5aa62b7d..84283e20ee2c 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -160,12 +160,6 @@ namespace accessibility
             throw IndexOutOfBoundsException();
 
         VclPtr<SvtIconChoiceCtrl> pCtrl = getCtrl();
-        SvxIconChoiceCtrlEntry* pEntry = pCtrl->GetEntry(i);
-        if ( !pEntry )
-            throw RuntimeException("getAccessibleChild: Entry "
-                                   + OUString::number(i) + " not found",
-                getXWeak());
-
         return new AccessibleIconChoiceCtrlEntry( *pCtrl, i, this );
     }
 
-- 
cgit