diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-11-27 16:40:38 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-11-27 20:16:42 +0100 |
commit | 31d4db12d91d26f245ac40fc0adbb27ff1f93d6f (patch) | |
tree | faa56aad55ac2aed35ab3abd3ba48878d4c5782e /sw | |
parent | 026d6e08fada78f095cd32a580f3debe20708982 (diff) |
cid#1517059 disentangle Improper use of negative value
Change-Id: I907f54cd93d78fe3638e407c70253b94f849eac3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143351
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/vba/vbacontentcontrols.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/ui/vba/vbacontentcontrols.cxx b/sw/source/ui/vba/vbacontentcontrols.cxx index c33b80bb4264..4ef73f5d196e 100644 --- a/sw/source/ui/vba/vbacontentcontrols.cxx +++ b/sw/source/ui/vba/vbacontentcontrols.cxx @@ -41,10 +41,10 @@ lcl_getContentControl(std::u16string_view sName, std::u16string_view sTag, SwTextContentControl* pControl = nullptr; std::vector<OUString> vElementNames; SwContentControlManager& rManager = pDoc->GetContentControlManager(); - size_t i = static_cast<size_t>(rIndex); const size_t nLen = rManager.GetCount(); if (!pElementNames && rIndex > 0 && sName.empty() && sTag.empty() && sTitle.empty()) { + size_t i = static_cast<size_t>(rIndex); // This is the normal get-by-index/getCount mode - no need for fancy filtering. if (i < nLen) pControl = rManager.Get(i); @@ -55,7 +55,7 @@ lcl_getContentControl(std::u16string_view sName, std::u16string_view sTag, { // loop through everything collecting names, filtering by Tag/Title sal_Int32 nCounter = 0; - for (i = 0; i < nLen; ++i) + for (size_t i = 0; i < nLen; ++i) { pControl = rManager.Get(i); if (!sTag.empty() |