Kaydet (Commit) 362082b5 authored tarafından Mike Kaganski's avatar Mike Kaganski

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 b37b299d.

Change-Id: I965ddcd0f8f578b60a46b3c7412d33973aa7a2aa
Reviewed-on: https://gerrit.libreoffice.org/69228
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst ed901c33
......@@ -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)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment