diff options
author | Noel Grandin <noel@peralex.com> | 2014-03-14 11:36:22 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-03-17 09:00:07 +0200 |
commit | c58fe8c85f159c6b456223b51981f411e312e33b (patch) | |
tree | ebef7d946d80be91e26f08c932aa628571b0d127 /editeng | |
parent | WaE: implicit conversion of literal of type 'sal_Bool' to 'bool' (diff) | |
download | core-c58fe8c85f159c6b456223b51981f411e312e33b.tar.gz core-c58fe8c85f159c6b456223b51981f411e312e33b.zip |
codemaker,editeng: prefer passing OUString by reference
Change-Id: If3e2dd3905cc33f1e7fc9fbfbb9f2bb49a756a34
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/lookuptree/Trie.cxx | 18 | ||||
-rw-r--r-- | editeng/source/outliner/outlobj.cxx | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/editeng/source/lookuptree/Trie.cxx b/editeng/source/lookuptree/Trie.cxx index 5ed7ea38f07f..7565513d0ee3 100644 --- a/editeng/source/lookuptree/Trie.cxx +++ b/editeng/source/lookuptree/Trie.cxx @@ -31,10 +31,10 @@ struct TrieNode void markWord(); TrieNode* findChild(sal_Unicode aCharacter); - TrieNode* traversePath(OUString sPath); + TrieNode* traversePath(const OUString& sPath); void addNewChild(TrieNode* pChild); - void collectSuggestions(OUString sPath, std::vector<OUString>& rSuggestionList); - void collectSuggestionsForCurrentNode(TrieNode* pCurrent, OUString sPath, vector<OUString>& rSuggestionList); + void collectSuggestions(const OUString& sPath, std::vector<OUString>& rSuggestionList); + void collectSuggestionsForCurrentNode(TrieNode* pCurrent, const OUString& sPath, vector<OUString>& rSuggestionList); }; TrieNode::TrieNode(sal_Unicode aCharacter) : @@ -99,7 +99,7 @@ TrieNode* TrieNode::findChild(sal_Unicode aInputCharacter) return NULL; } -void TrieNode::collectSuggestions(OUString sPath, vector<OUString>& rSuggestionList) +void TrieNode::collectSuggestions(const OUString& sPath, vector<OUString>& rSuggestionList) { // first traverse nodes for alphabet characters for (int i=0; i<LATIN_ARRAY_SIZE; i++) @@ -119,7 +119,7 @@ void TrieNode::collectSuggestions(OUString sPath, vector<OUString>& rSuggestionL } } -void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, OUString sPath, vector<OUString>& rSuggestionList) +void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, const OUString& sPath, vector<OUString>& rSuggestionList) { OUString aStringPath = sPath + OUString(pCurrent->mCharacter); if(pCurrent->mMarker) @@ -130,7 +130,7 @@ void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, OUString sPa pCurrent->collectSuggestions(aStringPath, rSuggestionList); } -TrieNode* TrieNode::traversePath(OUString sPath) +TrieNode* TrieNode::traversePath(const OUString& sPath) { TrieNode* pCurrent = this; @@ -154,7 +154,7 @@ Trie::Trie() : Trie::~Trie() {} -void Trie::insert(OUString sInputString) const +void Trie::insert(const OUString& sInputString) const { // adding an empty word is not allowed if ( sInputString.isEmpty() ) @@ -186,13 +186,13 @@ void Trie::insert(OUString sInputString) const pCurrent->markWord(); } -void Trie::findSuggestions(OUString sWordPart, vector<OUString>& rSuggesstionList) const +void Trie::findSuggestions(const OUString& sWordPart, vector<OUString>& rSuggestionList) const { TrieNode* pNode = mRoot->traversePath(sWordPart); if (pNode != NULL) { - pNode->collectSuggestions(sWordPart, rSuggesstionList); + pNode->collectSuggestions(sWordPart, rSuggestionList); } } diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx index 1eabd482664c..077d567889d9 100644 --- a/editeng/source/outliner/outlobj.cxx +++ b/editeng/source/outliner/outlobj.cxx @@ -254,7 +254,7 @@ void OutlinerParaObject::ChangeStyleSheetName(SfxStyleFamily eFamily, mpImplOutlinerParaObject->mpEditTextObject->ChangeStyleSheetName(eFamily, rOldName, rNewName); } -void OutlinerParaObject::SetStyleSheets(sal_uInt16 nLevel, const OUString rNewName, +void OutlinerParaObject::SetStyleSheets(sal_uInt16 nLevel, const OUString& rNewName, const SfxStyleFamily& rNewFamily) { const sal_Int32 nCount(Count()); |