diff options
-rw-r--r-- | include/svl/IndexedStyleSheets.hxx | 4 | ||||
-rw-r--r-- | svl/qa/unit/items/test_IndexedStyleSheets.cxx | 2 | ||||
-rw-r--r-- | svl/source/items/IndexedStyleSheets.cxx | 2 | ||||
-rw-r--r-- | svl/source/items/style.cxx | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/include/svl/IndexedStyleSheets.hxx b/include/svl/IndexedStyleSheets.hxx index 2513f9aaa6d3..7422dcda5a01 100644 --- a/include/svl/IndexedStyleSheets.hxx +++ b/include/svl/IndexedStyleSheets.hxx @@ -124,14 +124,14 @@ public: std::vector<unsigned> FindPositionsByName(const rtl::OUString& name) const; - enum SearchBehavior { RETURN_ALL, RETURN_FIRST }; + enum class SearchBehavior { ReturnAll, ReturnFirst }; /** Obtain the positions of all styles which have a certain name and fulfill a certain condition. * * This method is fast because it can use the name-based index */ std::vector<unsigned> FindPositionsByNameAndPredicate(const rtl::OUString& name, StyleSheetPredicate& predicate, - SearchBehavior behavior = RETURN_ALL) const; + SearchBehavior behavior = SearchBehavior::ReturnAll) const; /** Obtain the positions of all styles which fulfill a certain condition. * diff --git a/svl/qa/unit/items/test_IndexedStyleSheets.cxx b/svl/qa/unit/items/test_IndexedStyleSheets.cxx index da86044d2fe3..6560e7de6832 100644 --- a/svl/qa/unit/items/test_IndexedStyleSheets.cxx +++ b/svl/qa/unit/items/test_IndexedStyleSheets.cxx @@ -203,7 +203,7 @@ void IndexedStyleSheetsTest::OnlyOneStyleSheetIsReturnedWhenReturnFirstIsUsed() DummyPredicate predicate; // returns always true, i.e., all style sheets match the predicate. std::vector<unsigned> v = iss.FindPositionsByNameAndPredicate(name, predicate, - IndexedStyleSheets::RETURN_FIRST); + IndexedStyleSheets::SearchBehavior::ReturnFirst); CPPUNIT_ASSERT_EQUAL_MESSAGE("Only one style sheet is returned.", static_cast<size_t>(1), v.size()); std::vector<unsigned> w = iss.FindPositionsByNameAndPredicate(name, predicate); diff --git a/svl/source/items/IndexedStyleSheets.cxx b/svl/source/items/IndexedStyleSheets.cxx index 6bc4ad0a56d1..b327315b8a2c 100644 --- a/svl/source/items/IndexedStyleSheets.cxx +++ b/svl/source/items/IndexedStyleSheets.cxx @@ -142,7 +142,7 @@ IndexedStyleSheets::FindPositionsByNameAndPredicate(const rtl::OUString& name, SfxStyleSheetBase *ssheet = mStyleSheets.at(pos).get(); if (predicate.Check(*ssheet)) { r.push_back(pos); - if (behavior == RETURN_FIRST) { + if (behavior == SearchBehavior::ReturnFirst) { break; } } diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 8ec244c2c014..e71f9375493c 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -541,7 +541,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Find(const OUString& rStr) std::vector<unsigned> positions = pBasePool->pImpl->mxIndexedStyleSheets->FindPositionsByNameAndPredicate(rStr, predicate, - svl::IndexedStyleSheets::RETURN_FIRST); + svl::IndexedStyleSheets::SearchBehavior::ReturnFirst); if (positions.empty()) { return nullptr; } |