summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-02-20 18:34:13 +0100
committerLuboš Luňák <l.lunak@collabora.com>2022-02-20 20:46:58 +0100
commit0d402556af53790adb06380b4b04ea421d14d09e (patch)
tree307331f7aefd027b55d0b0bcff70b7f3d3f57234 /svl
parente81400196cd9c24be32552a19851da4162d51c7a (diff)
fix usage of std::lower_bound() in SfxItemPool (tdf#81765)
The function expects elements starting from smallest to the biggest, and finds the first one that is not smaller than the one searched for. That means that all items remaining will not be smaller, and thus end of search is when items compare larger. Comparing remaining items as smaller means searching until the end. Change-Id: If5cf5c18951abf987ddbbf201f49cfb195e36d32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130220 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/inc/poolio.hxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx
index b2819cc46bd5..1080672b09ff 100644
--- a/svl/source/inc/poolio.hxx
+++ b/svl/source/inc/poolio.hxx
@@ -86,7 +86,7 @@ public:
{
if (it == maSortablePoolItems.end())
return nullptr;
- if (**it < *pNeedle)
+ if (*pNeedle < **it)
return nullptr;
if (*pNeedle == **it)
return *it;
@@ -130,7 +130,7 @@ public:
assert(false && "did not find item?");
break;
}
- if (**sortIt < *pNeedle)
+ if (*pNeedle < **sortIt)
{
assert(false && "did not find item?");
break;