summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-03-13 22:44:44 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2019-03-14 06:16:23 +0100
commit362082b57b2d6e9119acb3fb033aefcbce8cf8bb (patch)
treed913efdef9556e1d8c90e1b3a1141f43618038a4 /svl
parented901c336ff0b99291ffe53be6bd762abcccf55c (diff)
Only return elements with both name and predicate matching arguments
... otherwise, after first stylesheet with matching name but failing predicate, next stylesheet that matches predicate is returned, regardless what is its name. See commit b37b299d5228beeecb913980780f463756c5a878. Change-Id: I965ddcd0f8f578b60a46b3c7412d33973aa7a2aa Reviewed-on: https://gerrit.libreoffice.org/69228 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/IndexedStyleSheets.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/svl/source/items/IndexedStyleSheets.cxx b/svl/source/items/IndexedStyleSheets.cxx
index c3b8ad6706c2..233c10e56093 100644
--- a/svl/source/items/IndexedStyleSheets.cxx
+++ b/svl/source/items/IndexedStyleSheets.cxx
@@ -127,8 +127,8 @@ IndexedStyleSheets::FindPositionsByNameAndPredicate(const OUString& name,
StyleSheetPredicate& predicate, SearchBehavior behavior) const
{
std::vector<unsigned> r;
- MapType::const_iterator it = mPositionsByName.find(name);
- for (/**/; it != mPositionsByName.end(); ++it) {
+ auto range = mPositionsByName.equal_range(name);
+ for (auto it = range.first; it != range.second; ++it) {
unsigned pos = it->second;
SfxStyleSheetBase *ssheet = mStyleSheets.at(pos).get();
if (predicate.Check(*ssheet)) {