diff options
-rw-r--r-- | comphelper/source/property/propertycontainerhelper.cxx | 4 | ||||
-rw-r--r-- | include/comphelper/propertycontainerhelper.hxx | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/comphelper/source/property/propertycontainerhelper.cxx b/comphelper/source/property/propertycontainerhelper.cxx index 7ff224bec741..ee81100ae617 100644 --- a/comphelper/source/property/propertycontainerhelper.cxx +++ b/comphelper/source/property/propertycontainerhelper.cxx @@ -270,7 +270,7 @@ bool OPropertyContainerHelper::convertFastPropertyValue( if (PropertyDescription::LocationType::HoldMyself == aPos->eLocated) { - OSL_ENSURE(aPos->aLocation.nOwnClassVectorIndex < static_cast<sal_Int32>(m_aHoldProperties.size()), + OSL_ENSURE(aPos->aLocation.nOwnClassVectorIndex < m_aHoldProperties.size(), "OPropertyContainerHelper::convertFastPropertyValue: invalid position !"); auto aIter = m_aHoldProperties.begin() + aPos->aLocation.nOwnClassVectorIndex; pPropContainer = &(*aIter); @@ -408,7 +408,7 @@ void OPropertyContainerHelper::getFastPropertyValue(Any& _rValue, sal_Int32 _nHa switch (aPos->eLocated) { case PropertyDescription::LocationType::HoldMyself: - OSL_ENSURE(aPos->aLocation.nOwnClassVectorIndex < static_cast<sal_Int32>(m_aHoldProperties.size()), + OSL_ENSURE(aPos->aLocation.nOwnClassVectorIndex < m_aHoldProperties.size(), "OPropertyContainerHelper::convertFastPropertyValue: invalid position !"); _rValue = m_aHoldProperties[aPos->aLocation.nOwnClassVectorIndex]; break; diff --git a/include/comphelper/propertycontainerhelper.hxx b/include/comphelper/propertycontainerhelper.hxx index eb213e4541ec..73a0ce513289 100644 --- a/include/comphelper/propertycontainerhelper.hxx +++ b/include/comphelper/propertycontainerhelper.hxx @@ -22,6 +22,8 @@ #include <com/sun/star/uno/Type.hxx> #include <com/sun/star/beans/Property.hpp> +#include <cstddef> +#include <limits> #include <vector> #include <comphelper/comphelperdllapi.h> @@ -44,7 +46,7 @@ struct COMPHELPER_DLLPUBLIC PropertyDescription union LocationAccess { void* pDerivedClassMember; // a pointer to a member of an object of a derived class - sal_Int32 nOwnClassVectorIndex; // an index within m_aHoldProperties + std::size_t nOwnClassVectorIndex; // an index within m_aHoldProperties }; css::beans::Property aProperty; @@ -55,7 +57,7 @@ struct COMPHELPER_DLLPUBLIC PropertyDescription :aProperty( OUString(), -1, css::uno::Type(), 0 ) ,eLocated( LocationType::HoldMyself ) { - aLocation.nOwnClassVectorIndex = -1; + aLocation.nOwnClassVectorIndex = std::numeric_limits<std::size_t>::max(); } }; |