comphelper/source/property/propagg.cxx |    5 +++--
 include/comphelper/propagg.hxx         |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 6f26b6aeca827329dd8d55f344e509fcf7685172
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Tue May 31 10:23:17 2022 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Tue May 31 14:53:25 2022 +0200

    Use more appropriate type for comphelper::internal::OPropertyAccessor::nPos
    
    Change-Id: Ia7055dcc3832002fd10ae23a35fd08df5a98ae40
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135177
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/comphelper/source/property/propagg.cxx 
b/comphelper/source/property/propagg.cxx
index fb2db9589c8e..0d8ea6a10bb9 100644
--- a/comphelper/source/property/propagg.cxx
+++ b/comphelper/source/property/propagg.cxx
@@ -27,6 +27,7 @@
 #include <o3tl/sorted_vector.hxx>
 #include <typeinfo>
 #include <algorithm>
+#include <cstddef>
 #include <unordered_set>
 #include <memory>
 
@@ -83,7 +84,7 @@ 
OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper(
     std::unordered_set< sal_Int32 > existingHandles;
     existingHandles.reserve( m_aProperties.size() );
     sal_Int32 nAggregateHandle = _nFirstAggregateId;
-    for ( sal_Int32 nMPLoop = 0; nMPLoop < static_cast< sal_Int32 >( 
m_aProperties.size() ); ++nMPLoop )
+    for ( std::size_t nMPLoop = 0; nMPLoop < m_aProperties.size(); ++nMPLoop )
     {
         auto &prop = m_aProperties[ nMPLoop ];
         if ( aDelegatorProps.find( prop.Name ) != aDelegatorProps.end() )
@@ -209,7 +210,7 @@ bool 
OPropertyArrayAggregationHelper::fillAggregatePropertyInfoByHandle(
             *_pOriginalHandle = (*i).second.nOriginalHandle;
         if (_pPropName)
         {
-            OSL_ENSURE((*i).second.nPos < 
static_cast<sal_Int32>(m_aProperties.size()),"Invalid index for sequence!");
+            OSL_ENSURE((*i).second.nPos < m_aProperties.size(),"Invalid index 
for sequence!");
             const css::beans::Property& rProperty = 
m_aProperties[(*i).second.nPos];
             *_pPropName = rProperty.Name;
         }
diff --git a/include/comphelper/propagg.hxx b/include/comphelper/propagg.hxx
index f7e47298b88b..949251892623 100644
--- a/include/comphelper/propagg.hxx
+++ b/include/comphelper/propagg.hxx
@@ -29,6 +29,7 @@
 #include <comphelper/propstate.hxx>
 #include <comphelper/comphelperdllapi.h>
 
+#include <cstddef>
 #include <map>
 #include <memory>
 #include <vector>
@@ -49,10 +50,10 @@ namespace internal
     struct OPropertyAccessor
     {
         sal_Int32   nOriginalHandle;
-        sal_Int32   nPos;
+        std::size_t nPos;
         bool        bAggregate;
 
-        OPropertyAccessor(sal_Int32 _nOriginalHandle, sal_Int32 _nPos, bool 
_bAggregate)
+        OPropertyAccessor(sal_Int32 _nOriginalHandle, std::size_t _nPos, bool 
_bAggregate)
             :nOriginalHandle(_nOriginalHandle) ,nPos(_nPos) 
,bAggregate(_bAggregate) { }
 
         bool operator==(const OPropertyAccessor& rOb) const { return nPos == 
rOb.nPos; }

Reply via email to