From c58fe8c85f159c6b456223b51981f411e312e33b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 14 Mar 2014 11:36:22 +0200 Subject: codemaker,editeng: prefer passing OUString by reference Change-Id: If3e2dd3905cc33f1e7fc9fbfbb9f2bb49a756a34 --- editeng/source/lookuptree/Trie.cxx | 18 +++++++++--------- editeng/source/outliner/outlobj.cxx | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'editeng') 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& rSuggestionList); - void collectSuggestionsForCurrentNode(TrieNode* pCurrent, OUString sPath, vector& rSuggestionList); + void collectSuggestions(const OUString& sPath, std::vector& rSuggestionList); + void collectSuggestionsForCurrentNode(TrieNode* pCurrent, const OUString& sPath, vector& rSuggestionList); }; TrieNode::TrieNode(sal_Unicode aCharacter) : @@ -99,7 +99,7 @@ TrieNode* TrieNode::findChild(sal_Unicode aInputCharacter) return NULL; } -void TrieNode::collectSuggestions(OUString sPath, vector& rSuggestionList) +void TrieNode::collectSuggestions(const OUString& sPath, vector& rSuggestionList) { // first traverse nodes for alphabet characters for (int i=0; i& rSuggestionL } } -void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, OUString sPath, vector& rSuggestionList) +void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, const OUString& sPath, vector& 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& rSuggesstionList) const +void Trie::findSuggestions(const OUString& sWordPart, vector& 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()); -- cgit