Kaydet (Commit) c58fe8c8 authored tarafından Noel Grandin's avatar Noel Grandin

codemaker,editeng: prefer passing OUString by reference

Change-Id: If3e2dd3905cc33f1e7fc9fbfbb9f2bb49a756a34
üst c0a6e9a1
...@@ -63,10 +63,10 @@ OString getTempDir(const OString& sFileName) ...@@ -63,10 +63,10 @@ OString getTempDir(const OString& sFileName)
} }
OString createFileNameFromType( const OString& destination, OString createFileNameFromType( const OString& destination,
const OString typeName, const OString& typeName,
const OString postfix, const OString& postfix,
bool bLowerCase, bool bLowerCase,
const OString prefix ) const OString& prefix )
{ {
OString type(typeName.replace('.', '/')); OString type(typeName.replace('.', '/'));
......
...@@ -691,7 +691,7 @@ void addTypeInfo( ...@@ -691,7 +691,7 @@ void addTypeInfo(
} }
void handleEnumType( void handleEnumType(
OUString name, rtl::Reference< unoidl::EnumTypeEntity > const & entity, const OUString& name, rtl::Reference< unoidl::EnumTypeEntity > const & entity,
JavaOptions const & options) JavaOptions const & options)
{ {
assert(entity.is()); assert(entity.is());
...@@ -1406,7 +1406,7 @@ void addPlainStructBaseArguments( ...@@ -1406,7 +1406,7 @@ void addPlainStructBaseArguments(
} }
void handlePlainStructType( void handlePlainStructType(
OUString name, const OUString& name,
rtl::Reference< unoidl::PlainStructTypeEntity > const & entity, rtl::Reference< unoidl::PlainStructTypeEntity > const & entity,
rtl::Reference< TypeManager > const & manager, JavaOptions const & options, rtl::Reference< TypeManager > const & manager, JavaOptions const & options,
Dependencies * dependencies) Dependencies * dependencies)
...@@ -1491,7 +1491,7 @@ void handlePlainStructType( ...@@ -1491,7 +1491,7 @@ void handlePlainStructType(
} }
void handlePolyStructType( void handlePolyStructType(
OUString name, const OUString& name,
rtl::Reference< unoidl::PolymorphicStructTypeTemplateEntity > const & rtl::Reference< unoidl::PolymorphicStructTypeTemplateEntity > const &
entity, entity,
rtl::Reference< TypeManager > const & manager, JavaOptions const & options, rtl::Reference< TypeManager > const & manager, JavaOptions const & options,
...@@ -1626,7 +1626,7 @@ void addExceptionBaseArguments( ...@@ -1626,7 +1626,7 @@ void addExceptionBaseArguments(
} }
void handleExceptionType( void handleExceptionType(
OUString name, rtl::Reference< unoidl::ExceptionTypeEntity > const & entity, const OUString& name, rtl::Reference< unoidl::ExceptionTypeEntity > const & entity,
rtl::Reference< TypeManager > const & manager, JavaOptions const & options, rtl::Reference< TypeManager > const & manager, JavaOptions const & options,
Dependencies * dependencies) Dependencies * dependencies)
{ {
...@@ -1797,7 +1797,7 @@ void createExceptionsAttribute( ...@@ -1797,7 +1797,7 @@ void createExceptionsAttribute(
} }
void handleInterfaceType( void handleInterfaceType(
OUString name, rtl::Reference< unoidl::InterfaceTypeEntity > const & entity, const OUString& name, rtl::Reference< unoidl::InterfaceTypeEntity > const & entity,
rtl::Reference< TypeManager > const & manager, JavaOptions const & options, rtl::Reference< TypeManager > const & manager, JavaOptions const & options,
Dependencies * dependencies) Dependencies * dependencies)
{ {
...@@ -1956,7 +1956,7 @@ void handleTypedef( ...@@ -1956,7 +1956,7 @@ void handleTypedef(
} }
void handleConstantGroup( void handleConstantGroup(
OUString name, rtl::Reference< unoidl::ConstantGroupEntity > const & entity, const OUString& name, rtl::Reference< unoidl::ConstantGroupEntity > const & entity,
rtl::Reference< TypeManager > const & manager, JavaOptions const & options, rtl::Reference< TypeManager > const & manager, JavaOptions const & options,
Dependencies * dependencies) Dependencies * dependencies)
{ {
...@@ -2208,7 +2208,7 @@ void addConstructor( ...@@ -2208,7 +2208,7 @@ void addConstructor(
} }
void handleService( void handleService(
OUString name, const OUString& name,
rtl::Reference< unoidl::SingleInterfaceBasedServiceEntity > const & entity, rtl::Reference< unoidl::SingleInterfaceBasedServiceEntity > const & entity,
rtl::Reference< TypeManager > const & manager, JavaOptions const & options, rtl::Reference< TypeManager > const & manager, JavaOptions const & options,
Dependencies * dependencies) Dependencies * dependencies)
...@@ -2307,7 +2307,7 @@ void handleService( ...@@ -2307,7 +2307,7 @@ void handleService(
} }
void handleSingleton( void handleSingleton(
OUString name, const OUString& name,
rtl::Reference< unoidl::InterfaceBasedSingletonEntity > const & entity, rtl::Reference< unoidl::InterfaceBasedSingletonEntity > const & entity,
rtl::Reference< TypeManager > const & manager, JavaOptions const & options, rtl::Reference< TypeManager > const & manager, JavaOptions const & options,
Dependencies * dependencies) Dependencies * dependencies)
......
...@@ -31,10 +31,10 @@ struct TrieNode ...@@ -31,10 +31,10 @@ struct TrieNode
void markWord(); void markWord();
TrieNode* findChild(sal_Unicode aCharacter); TrieNode* findChild(sal_Unicode aCharacter);
TrieNode* traversePath(OUString sPath); TrieNode* traversePath(const OUString& sPath);
void addNewChild(TrieNode* pChild); void addNewChild(TrieNode* pChild);
void collectSuggestions(OUString sPath, std::vector<OUString>& rSuggestionList); void collectSuggestions(const OUString& sPath, std::vector<OUString>& rSuggestionList);
void collectSuggestionsForCurrentNode(TrieNode* pCurrent, OUString sPath, vector<OUString>& rSuggestionList); void collectSuggestionsForCurrentNode(TrieNode* pCurrent, const OUString& sPath, vector<OUString>& rSuggestionList);
}; };
TrieNode::TrieNode(sal_Unicode aCharacter) : TrieNode::TrieNode(sal_Unicode aCharacter) :
...@@ -99,7 +99,7 @@ TrieNode* TrieNode::findChild(sal_Unicode aInputCharacter) ...@@ -99,7 +99,7 @@ TrieNode* TrieNode::findChild(sal_Unicode aInputCharacter)
return NULL; 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 // first traverse nodes for alphabet characters
for (int i=0; i<LATIN_ARRAY_SIZE; i++) for (int i=0; i<LATIN_ARRAY_SIZE; i++)
...@@ -119,7 +119,7 @@ void TrieNode::collectSuggestions(OUString sPath, vector<OUString>& rSuggestionL ...@@ -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); OUString aStringPath = sPath + OUString(pCurrent->mCharacter);
if(pCurrent->mMarker) if(pCurrent->mMarker)
...@@ -130,7 +130,7 @@ void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, OUString sPa ...@@ -130,7 +130,7 @@ void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, OUString sPa
pCurrent->collectSuggestions(aStringPath, rSuggestionList); pCurrent->collectSuggestions(aStringPath, rSuggestionList);
} }
TrieNode* TrieNode::traversePath(OUString sPath) TrieNode* TrieNode::traversePath(const OUString& sPath)
{ {
TrieNode* pCurrent = this; TrieNode* pCurrent = this;
...@@ -154,7 +154,7 @@ Trie::Trie() : ...@@ -154,7 +154,7 @@ Trie::Trie() :
Trie::~Trie() Trie::~Trie()
{} {}
void Trie::insert(OUString sInputString) const void Trie::insert(const OUString& sInputString) const
{ {
// adding an empty word is not allowed // adding an empty word is not allowed
if ( sInputString.isEmpty() ) if ( sInputString.isEmpty() )
...@@ -186,13 +186,13 @@ void Trie::insert(OUString sInputString) const ...@@ -186,13 +186,13 @@ void Trie::insert(OUString sInputString) const
pCurrent->markWord(); 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); TrieNode* pNode = mRoot->traversePath(sWordPart);
if (pNode != NULL) if (pNode != NULL)
{ {
pNode->collectSuggestions(sWordPart, rSuggesstionList); pNode->collectSuggestions(sWordPart, rSuggestionList);
} }
} }
......
...@@ -254,7 +254,7 @@ void OutlinerParaObject::ChangeStyleSheetName(SfxStyleFamily eFamily, ...@@ -254,7 +254,7 @@ void OutlinerParaObject::ChangeStyleSheetName(SfxStyleFamily eFamily,
mpImplOutlinerParaObject->mpEditTextObject->ChangeStyleSheetName(eFamily, rOldName, rNewName); 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 SfxStyleFamily& rNewFamily)
{ {
const sal_Int32 nCount(Count()); const sal_Int32 nCount(Count());
......
...@@ -105,10 +105,10 @@ private: ...@@ -105,10 +105,10 @@ private:
::rtl::OString getTempDir(const ::rtl::OString& sFileName); ::rtl::OString getTempDir(const ::rtl::OString& sFileName);
::rtl::OString createFileNameFromType(const ::rtl::OString& destination, ::rtl::OString createFileNameFromType(const ::rtl::OString& destination,
const ::rtl::OString type, const ::rtl::OString& type,
const ::rtl::OString postfix, const ::rtl::OString& postfix,
bool bLowerCase=false, bool bLowerCase=false,
const ::rtl::OString prefix=""); const ::rtl::OString& prefix="");
bool fileExists(const ::rtl::OString& fileName); bool fileExists(const ::rtl::OString& fileName);
bool makeValidTypeFile(const ::rtl::OString& targetFileName, bool makeValidTypeFile(const ::rtl::OString& targetFileName,
......
...@@ -30,8 +30,8 @@ public: ...@@ -30,8 +30,8 @@ public:
Trie(); Trie();
virtual ~Trie(); virtual ~Trie();
void insert(OUString sInputString) const; void insert(const OUString& sInputString) const;
void findSuggestions(OUString sWordPart, std::vector<OUString>& rSuggesstionList) const; void findSuggestions(const OUString& sWordPart, std::vector<OUString>& rSuggestionList) const;
void getAllEntries(std::vector<OUString>& entries); void getAllEntries(std::vector<OUString>& entries);
}; };
......
...@@ -75,7 +75,7 @@ public: ...@@ -75,7 +75,7 @@ public:
const OUString& rNewName, SfxStyleFamily eNewFamily); const OUString& rNewName, SfxStyleFamily eNewFamily);
void ChangeStyleSheetName(SfxStyleFamily eFamily, const OUString& rOldName, void ChangeStyleSheetName(SfxStyleFamily eFamily, const OUString& rOldName,
const OUString& rNewName); const OUString& rNewName);
void SetStyleSheets(sal_uInt16 nLevel, const OUString rNewName, void SetStyleSheets(sal_uInt16 nLevel, const OUString& rNewName,
const SfxStyleFamily& rNewFamily); const SfxStyleFamily& rNewFamily);
}; };
......
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