diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-21 11:23:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-21 18:29:54 +0200 |
commit | f41868a5dcdb1982c1e3064dd985d894eaba0074 (patch) | |
tree | 322694725a9f435d3d5dd9877d74f3ad973cb9cb /sw | |
parent | 318a7961fc3542724cb85e31edfbf3b898e2a4f3 (diff) |
use more string_view in editeng
Change-Id: I7e434076750ebdf4aeee621151fbe6dfc929c60f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140337
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/acmplwrd.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/acmplwrd.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sw/inc/acmplwrd.hxx b/sw/inc/acmplwrd.hxx index 78b62b4be607..935a92076ef9 100644 --- a/sw/inc/acmplwrd.hxx +++ b/sw/inc/acmplwrd.hxx @@ -70,7 +70,7 @@ public: void CheckChangedList(const editeng::SortedAutoCompleteStrings& rNewLst); // Returns all words matching a given prefix aMatch. - bool GetWordsMatching(const OUString& aMatch, std::vector<OUString>& aWords) const; + bool GetWordsMatching(std::u16string_view aMatch, std::vector<OUString>& aWords) const; }; #endif diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 65eb9193b679..d566f188d7cc 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -244,7 +244,7 @@ bool SwAutoCompleteWord::InsertWord( const OUString& rWord, SwDoc& rDoc ) std::pair<editeng::SortedAutoCompleteStrings::const_iterator, bool> aInsPair = m_WordList.insert(pNew); - m_LookupTree.insert( aNewWord.copy(0, nWrdLen) ); + m_LookupTree.insert( aNewWord.subView(0, nWrdLen) ); if (aInsPair.second) { @@ -330,7 +330,7 @@ void SwAutoCompleteWord::SetMinWordLen( sal_uInt16 n ) * @param aMatch the prefix to search for * @param rWords the words found matching */ -bool SwAutoCompleteWord::GetWordsMatching(const OUString& aMatch, std::vector<OUString>& rWords) const +bool SwAutoCompleteWord::GetWordsMatching(std::u16string_view aMatch, std::vector<OUString>& rWords) const { assert(rWords.empty()); m_LookupTree.findSuggestions(aMatch, rWords); |