summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-06-01 09:09:46 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-06-01 10:49:20 +0200
commite89e3a8b5a7639f14833d066e8a6c445dca97cc0 (patch)
tree6cabe68756d6491658a7789deca6f0a3e3afdc16 /chart2
parent6dbccf3d9344be0c2ba162a8df5fc0bf425cb84e (diff)
The return value of those getLength functions is guaranteed to be non-negative
...so use o3tl::make_unsigned when comparing it against an expression of unsigned integer type, instead of casting that expression to a signed type Change-Id: Ic47c6d96919b2aba2d16ce6d1a2a8e4c5761a480 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135219 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/tools/ObjectIdentifier.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx
index a8622e3ff4c4..6b8b9e2809cc 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -439,7 +439,7 @@ OUString ObjectIdentifier::createClassifiedIdentifierForParticles(
OUStringBuffer aRet( m_aProtocol );
aRet.append( lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString ));
- if(aRet.getLength() > static_cast<sal_Int32>(std::size(m_aProtocol)-1))
+ if(o3tl::make_unsigned(aRet.getLength()) >= std::size(m_aProtocol))
aRet.append("/");
if(!rParentParticle.empty())
@@ -563,7 +563,7 @@ OUString ObjectIdentifier::createClassifiedIdentifierWithParent(
OUStringBuffer aRet( m_aProtocol );
aRet.append( lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString ));
- if(aRet.getLength() > static_cast<sal_Int32>(std::size(m_aProtocol)-1))
+ if(o3tl::make_unsigned(aRet.getLength()) >= std::size(m_aProtocol))
aRet.append("/");
aRet.append(rParentPartical);
if(!rParentPartical.empty())