diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-06-01 09:09:46 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-06-01 10:49:20 +0200 |
commit | e89e3a8b5a7639f14833d066e8a6c445dca97cc0 (patch) | |
tree | 6cabe68756d6491658a7789deca6f0a3e3afdc16 /svx | |
parent | 6dbccf3d9344be0c2ba162a8df5fc0bf425cb84e (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 'svx')
-rw-r--r-- | svx/source/fmcomp/fmgridif.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 5ff7ddccae7d..bce6303d291f 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -55,6 +55,7 @@ #include <comphelper/types.hxx> #include <cppuhelper/supportsservice.hxx> #include <cppuhelper/queryinterface.hxx> +#include <o3tl/safeint.hxx> #include <vcl/unohelp.hxx> #include <vcl/svapp.hxx> #include <tools/debug.hxx> @@ -2784,7 +2785,7 @@ IMPL_LINK(FmXGridPeer, OnExecuteGridSlot, DbGridControlNavigationBarState, nSlot const std::vector<DbGridControlNavigationBarState>& aSlots = getSupportedGridSlots(); - DBG_ASSERT(static_cast<sal_Int32>(aSlots.size()) == aUrls.getLength(), "FmXGridPeer::OnExecuteGridSlot : inconsistent data returned by getSupportedURLs/getSupportedGridSlots!"); + DBG_ASSERT(aSlots.size() == o3tl::make_unsigned(aUrls.getLength()), "FmXGridPeer::OnExecuteGridSlot : inconsistent data returned by getSupportedURLs/getSupportedGridSlots!"); for (size_t i=0; i<aSlots.size(); ++i, ++pUrls) { |