diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-01-26 14:53:23 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-01-26 15:51:15 +0100 |
commit | 0f6bbde666382f1517e8ba7d94e692a86ebca28b (patch) | |
tree | 4682c32a0fd0e164c4a60c78c87aa96b38a2438d /accessibility | |
parent | 4cb5dae9f2c703bc2b2af0817dea2d808dc646b9 (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/standard/vclxaccessiblelist.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
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); |