diff options
author | Noel Grandin <noel@peralex.com> | 2014-03-14 15:14:28 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-03-17 09:00:07 +0200 |
commit | bd8ce8b959f6147a2175a8ce84fd212151ca05dc (patch) | |
tree | fef0085c85c2efd43b54e5dbf332a1b6d2f6bd71 | |
parent | d593f45886cbe6ee9d54af1cf84b11a9004efc61 (diff) |
sal,toolkit,unotools: prefer passing OUString by reference
Change-Id: Ie62a59fd9ff3d6f6a34240fd562fbc91a143bf3a
-rw-r--r-- | include/osl/profile.hxx | 2 | ||||
-rw-r--r-- | include/toolkit/controls/eventcontainer.hxx | 4 | ||||
-rw-r--r-- | include/unotools/compatibility.hxx | 2 | ||||
-rw-r--r-- | sal/qa/osl/file/osl_File.cxx | 18 | ||||
-rw-r--r-- | sal/qa/osl/module/osl_Module.cxx | 8 | ||||
-rw-r--r-- | unotools/source/config/compatibility.cxx | 6 |
6 files changed, 20 insertions, 20 deletions
diff --git a/include/osl/profile.hxx b/include/osl/profile.hxx index e2ae14529689..1c1e899337b1 100644 --- a/include/osl/profile.hxx +++ b/include/osl/profile.hxx @@ -44,7 +44,7 @@ namespace osl { /** Open or create a configuration profile. @return 0 if the profile could not be created, otherwise a handle to the profile. */ - Profile(const rtl::OUString strProfileName, oslProfileOption Options = Profile_DEFAULT ) + Profile(const rtl::OUString & strProfileName, oslProfileOption Options = Profile_DEFAULT ) { profile = osl_openProfile(strProfileName.pData, Options); if( ! profile ) diff --git a/include/toolkit/controls/eventcontainer.hxx b/include/toolkit/controls/eventcontainer.hxx index ebdacdaea473..20f622219c29 100644 --- a/include/toolkit/controls/eventcontainer.hxx +++ b/include/toolkit/controls/eventcontainer.hxx @@ -36,7 +36,7 @@ namespace toolkit // Hashtable to optimize struct hashName_Impl { - size_t operator()(const OUString Str) const + size_t operator()(const OUString& Str) const { return (size_t)Str.hashCode(); } @@ -44,7 +44,7 @@ struct hashName_Impl struct eqName_Impl { - bool operator()(const OUString Str1, const OUString Str2) const + bool operator()(const OUString& Str1, const OUString& Str2) const { return ( Str1 == Str2 ); } diff --git a/include/unotools/compatibility.hxx b/include/unotools/compatibility.hxx index a9afa0c9753d..1108307644b5 100644 --- a/include/unotools/compatibility.hxx +++ b/include/unotools/compatibility.hxx @@ -137,7 +137,7 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public utl::detail::Options void Clear(); - void SetDefault( OUString sName, bool bValue ); + void SetDefault( const OUString & sName, bool bValue ); /*-**************************************************************************************************** @short return complete specified list diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index 17607a6cff09..63b9bcbe714a 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -321,7 +321,7 @@ inline bool isURL( const sal_Char *pathname ) /** simple version to judge if a file name or directory name is a URL or a system path, just to see if it is start with "file:///";. */ -inline bool isURL( const ::rtl::OUString pathname ) +inline bool isURL( const ::rtl::OUString& pathname ) { return pathname.startsWith( aPreURL ); } @@ -346,7 +346,7 @@ inline void concatURL( ::rtl::OUString & pathname1, const ::rtl::OUString & path /** create a temp test file using OUString name of full qualified URL or system path. */ -inline void createTestFile( const ::rtl::OUString filename ) +inline void createTestFile( const ::rtl::OUString& filename ) { ::rtl::OUString aPathURL = filename.copy( 0 ); ::osl::FileBase::RC nError; @@ -367,7 +367,7 @@ inline void createTestFile( const ::rtl::OUString filename ) /** create a temp test file using OUString name of full qualified URL or system path in a base directory. */ -inline void createTestFile( const ::rtl::OUString basename, const ::rtl::OUString filename ) +inline void createTestFile( const ::rtl::OUString& basename, const ::rtl::OUString& filename ) { ::rtl::OUString aBaseURL = basename.copy( 0 ); @@ -377,7 +377,7 @@ inline void createTestFile( const ::rtl::OUString basename, const ::rtl::OUStrin /** detete a temp test file using OUString name. */ -inline void deleteTestFile( const ::rtl::OUString filename ) +inline void deleteTestFile( const ::rtl::OUString& filename ) { // LLA: printf("deleteTestFile\n"); ::rtl::OUString aPathURL = filename.copy( 0 ); @@ -395,7 +395,7 @@ inline void deleteTestFile( const ::rtl::OUString filename ) /** delete a temp test file using OUString name of full qualified URL or system path in a base directory. */ -inline void deleteTestFile( const ::rtl::OUString basename, const ::rtl::OUString filename ) +inline void deleteTestFile( const ::rtl::OUString& basename, const ::rtl::OUString& filename ) { ::rtl::OUString aBaseURL = basename.copy( 0 ); @@ -405,7 +405,7 @@ inline void deleteTestFile( const ::rtl::OUString basename, const ::rtl::OUStrin /** create a temp test directory using OUString name of full qualified URL or system path. */ -inline void createTestDirectory( const ::rtl::OUString dirname ) +inline void createTestDirectory( const ::rtl::OUString& dirname ) { ::rtl::OUString aPathURL = dirname.copy( 0 ); ::osl::FileBase::RC nError; @@ -420,7 +420,7 @@ inline void createTestDirectory( const ::rtl::OUString dirname ) /** create a temp test directory using OUString name of full qualified URL or system path in a base directory. */ -inline void createTestDirectory( const ::rtl::OUString basename, const ::rtl::OUString dirname ) +inline void createTestDirectory( const ::rtl::OUString& basename, const ::rtl::OUString& dirname ) { ::rtl::OUString aBaseURL = basename.copy( 0 ); @@ -430,7 +430,7 @@ inline void createTestDirectory( const ::rtl::OUString basename, const ::rtl::OU /** delete a temp test directory using OUString name of full qualified URL or system path. */ -inline void deleteTestDirectory( const ::rtl::OUString dirname ) +inline void deleteTestDirectory( const ::rtl::OUString& dirname ) { ::rtl::OUString aPathURL = dirname.copy( 0 ); ::osl::FileBase::RC nError; @@ -450,7 +450,7 @@ inline void deleteTestDirectory( const ::rtl::OUString dirname ) /** delete a temp test directory using OUString name of full qualified URL or system path in a base directory. */ -inline void deleteTestDirectory( const ::rtl::OUString basename, const ::rtl::OUString dirname ) +inline void deleteTestDirectory( const ::rtl::OUString& basename, const ::rtl::OUString& dirname ) { ::rtl::OUString aBaseURL = basename.copy( 0 ); diff --git a/sal/qa/osl/module/osl_Module.cxx b/sal/qa/osl/module/osl_Module.cxx index 84e851e6bc30..e93e29acd61e 100644 --- a/sal/qa/osl/module/osl_Module.cxx +++ b/sal/qa/osl/module/osl_Module.cxx @@ -69,14 +69,14 @@ inline ::rtl::OUString getDllURL( void ) return dllPath; } -inline bool isURL( const ::rtl::OUString pathname ) +inline bool isURL( const ::rtl::OUString& pathname ) { return pathname.startsWith( "file:///" ); } /** create a temp test directory using OUString name of full qualified URL or system path. */ -inline void createTestDirectory( const ::rtl::OUString dirname ) +inline void createTestDirectory( const ::rtl::OUString& dirname ) { ::rtl::OUString aPathURL = dirname.copy( 0 ); ::osl::FileBase::RC nError; @@ -89,7 +89,7 @@ inline void createTestDirectory( const ::rtl::OUString dirname ) /** delete a temp test directory using OUString name of full qualified URL or system path. */ -inline void deleteTestDirectory( const ::rtl::OUString dirname ) +inline void deleteTestDirectory( const ::rtl::OUString& dirname ) { ::rtl::OUString aPathURL = dirname.copy( 0 ); ::osl::FileBase::RC nError; @@ -127,7 +127,7 @@ inline bool ifFileExist( const ::rtl::OUString & str ) /** detete a temp test file using OUString name. */ -inline void deleteTestFile( const ::rtl::OUString filename ) +inline void deleteTestFile( const ::rtl::OUString& filename ) { ::rtl::OUString aPathURL = filename.copy( 0 ); ::osl::FileBase::RC nError; diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx index c56b579e611f..2fed816580f8 100644 --- a/unotools/source/config/compatibility.cxx +++ b/unotools/source/config/compatibility.cxx @@ -227,7 +227,7 @@ class SvtCompatibilityOptions_Impl : public ConfigItem SvtCompatibilityOptions_Impl(); ~SvtCompatibilityOptions_Impl(); - void SetDefault( OUString sName, bool bValue ); + void SetDefault( const OUString & sName, bool bValue ); // overloaded methods of baseclass @@ -426,7 +426,7 @@ SvtCompatibilityOptions_Impl::~SvtCompatibilityOptions_Impl() } } -void SvtCompatibilityOptions_Impl::SetDefault( OUString sName, bool bValue ) +void SvtCompatibilityOptions_Impl::SetDefault( const OUString & sName, bool bValue ) { if ( COMPATIBILITY_PROPERTYNAME_USEPRTMETRICS.equals( sName ) ) m_aDefOptions.SetUsePrtMetrics( bValue ); @@ -689,7 +689,7 @@ void SvtCompatibilityOptions::Clear() m_pDataContainer->Clear(); } -void SvtCompatibilityOptions::SetDefault( OUString sName, bool bValue ) +void SvtCompatibilityOptions::SetDefault( const OUString & sName, bool bValue ) { m_pDataContainer->SetDefault( sName, bValue ); } |