accessibility/source/standard/vclxaccessiblelist.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
New commits: commit 0f6bbde666382f1517e8ba7d94e692a86ebca28b Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Sun Jan 26 14:53:23 2020 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Sun Jan 26 15:51:15 2020 +0100 Use properly typed variable for iteration ...avoiding explicit casts to smaller sal_uInt16 from larger sal_Int32. (Adding a o3tl::make_unsigned to silence a resulting -Werror,-Wsign-compare.) Change-Id: Iff1636e961db6edfac274cf8f7440369e841f9c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87441 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index 2077fcdf874b..b549c6d0c008 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/accessibility/AccessibleRelationType.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> +#include <o3tl/safeint.hxx> #include <vcl/svapp.hxx> #include <vcl/combobox.hxx> #include <vcl/lstbox.hxx> @@ -620,11 +621,11 @@ void VCLXAccessibleList::UpdateEntryRange_Impl() UpdateVisibleLineCount(); sal_Int32 nBegin = std::min( m_nLastTopEntry, nTop ); sal_Int32 nEnd = std::max( m_nLastTopEntry + m_nVisibleLineCount, nTop + m_nVisibleLineCount ); - for (sal_uInt16 i = static_cast<sal_uInt16>(nBegin); (i <= static_cast<sal_uInt16>(nEnd)); ++i) + for (sal_Int32 i = nBegin; (i <= nEnd); ++i) { bool bVisible = ( i >= nTop && i < ( nTop + m_nVisibleLineCount ) ); Reference< XAccessible > xHold; - if ( i < m_aAccessibleChildren.size() ) + if ( o3tl::make_unsigned(i) < m_aAccessibleChildren.size() ) xHold = m_aAccessibleChildren[i]; else if ( bVisible ) xHold = CreateChild(i); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits