diff options
author | Noel Grandin <noel@peralex.com> | 2014-03-12 15:36:41 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-03-13 08:39:26 +0200 |
commit | 39c7532933bb4f1630e821a2a38b213eb05dcc59 (patch) | |
tree | 728ba3d9190cd42fd8f3b24c2d9b65bece528bbd /basic | |
parent | fdo#75977: Clear sheet deleted flags for affected references when undoing. (diff) | |
download | core-39c7532933bb4f1630e821a2a38b213eb05dcc59.tar.gz core-39c7532933bb4f1630e821a2a38b213eb05dcc59.zip |
basic: prefer passing OUString and OString by reference
Change-Id: I8121204cdb37d4e1d8967397f3e45bdab6aaddad
Diffstat (limited to 'basic')
-rw-r--r-- | basic/qa/cppunit/basic_coverage.cxx | 8 | ||||
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 10 | ||||
-rw-r--r-- | basic/source/classes/image.cxx | 2 | ||||
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 2 | ||||
-rw-r--r-- | basic/source/inc/image.hxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxform.cxx | 23 |
7 files changed, 25 insertions, 24 deletions
diff --git a/basic/qa/cppunit/basic_coverage.cxx b/basic/qa/cppunit/basic_coverage.cxx index f05771cc4de4..8e145d0aea16 100644 --- a/basic/qa/cppunit/basic_coverage.cxx +++ b/basic/qa/cppunit/basic_coverage.cxx @@ -24,8 +24,8 @@ private: int m_nb_tests_ok; int m_nb_tests_skipped; OUString m_sCurrentTest; - void process_directory(OUString sDirName); - void run_test(OUString sFileName); + void process_directory(const OUString& sDirName); + void run_test(const OUString& sFileName); void test_failed(void); void test_success(void); StringVec get_subdirnames( const OUString& sDirName ); @@ -70,7 +70,7 @@ void Coverage::test_success() fprintf(stderr,"%s,PASS\n", OUStringToOString( m_sCurrentTest, RTL_TEXTENCODING_UTF8 ).getStr() ); } -void Coverage::run_test(OUString sFileURL) +void Coverage::run_test(const OUString& sFileURL) { m_sCurrentTest = sFileURL; bool result = false; @@ -113,7 +113,7 @@ Coverage::StringVec Coverage::get_subdirnames( const OUString& sDirName ) } return sSubDirNames; } -void Coverage::process_directory(OUString sDirName) +void Coverage::process_directory(const OUString& sDirName) { osl::Directory aDir(sDirName); osl::DirectoryItem aItem; diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 0718391941e7..3c0e9366d0e3 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -146,14 +146,14 @@ class BasMgrContainerListenerImpl: public ContainerListenerHelper OUString maLibName; // empty -> no lib, but lib container public: - BasMgrContainerListenerImpl( BasicManager* pMgr, OUString aLibName ) + BasMgrContainerListenerImpl( BasicManager* pMgr, const OUString& aLibName ) : mpMgr( pMgr ) , maLibName( aLibName ) {} static void insertLibraryImpl( const uno::Reference< script::XLibraryContainer >& xScriptCont, BasicManager* pMgr, - uno::Any aLibAny, OUString aLibName ); + uno::Any aLibAny, const OUString& aLibName ); static void addLibraryModulesImpl( BasicManager* pMgr, uno::Reference< container::XNameAccess > xLibNameAccess, - OUString aLibName ); + const OUString& aLibName ); // XEventListener @@ -175,7 +175,7 @@ public: void BasMgrContainerListenerImpl::insertLibraryImpl( const uno::Reference< script::XLibraryContainer >& xScriptCont, - BasicManager* pMgr, uno::Any aLibAny, OUString aLibName ) + BasicManager* pMgr, uno::Any aLibAny, const OUString& aLibName ) { Reference< container::XNameAccess > xLibNameAccess; aLibAny >>= xLibNameAccess; @@ -208,7 +208,7 @@ void BasMgrContainerListenerImpl::insertLibraryImpl( const uno::Reference< scrip void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr, - uno::Reference< container::XNameAccess > xLibNameAccess, OUString aLibName ) + uno::Reference< container::XNameAccess > xLibNameAccess, const OUString& aLibName ) { uno::Sequence< OUString > aModuleNames = xLibNameAccess->getElementNames(); sal_Int32 nModuleCount = aModuleNames.getLength(); diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index 6445dd203eca..ae016b152704 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -484,7 +484,7 @@ OUString SbiImage::GetString( short nId ) const return OUString(); } -const SbxObject* SbiImage::FindType (OUString aTypeName) const +const SbxObject* SbiImage::FindType (const OUString& aTypeName) const { return rTypes.Is() ? (SbxObject*)rTypes->Find(aTypeName,SbxCLASS_OBJECT) : NULL; } diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 910f3233bbf6..ae393d755dc8 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -524,7 +524,7 @@ sal_Bool SbModule::IsCompiled() const return sal_Bool( pImage != 0 ); } -const SbxObject* SbModule::FindType( OUString aTypeName ) const +const SbxObject* SbModule::FindType( const OUString& aTypeName ) const { return pImage ? pImage->FindType( aTypeName ) : NULL; } diff --git a/basic/source/inc/image.hxx b/basic/source/inc/image.hxx index 81e369ddc908..095c715b1516 100644 --- a/basic/source/inc/image.hxx +++ b/basic/source/inc/image.hxx @@ -75,7 +75,7 @@ public: OUString& GetSource32() { return aOUSource; } sal_uInt16 GetBase() const { return nDimBase; } OUString GetString( short nId ) const; - const SbxObject* FindType (OUString aTypeName) const; + const SbxObject* FindType (const OUString& aTypeName) const; SbxArrayRef GetEnums() { return rEnums; } diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 4f456199fa7e..0cc3db1a02fc 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2800,7 +2800,7 @@ inline sal_Bool implCheckWildcard( const OUString& rName, SbiRTLData* pRTLData ) } -bool isRootDir( OUString aDirURLStr ) +bool isRootDir( const OUString& aDirURLStr ) { INetURLObject aDirURLObj( aDirURLStr ); bool bRoot = false; diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx index dbc11a5bc805..5b059e325633 100644 --- a/basic/source/sbx/sbxform.cxx +++ b/basic/source/sbx/sbxform.cxx @@ -104,14 +104,14 @@ double get_number_of_digits( double dNumber ) SbxBasicFormater::SbxBasicFormater( sal_Unicode _cDecPoint, sal_Unicode _cThousandSep, - OUString _sOnStrg, - OUString _sOffStrg, - OUString _sYesStrg, - OUString _sNoStrg, - OUString _sTrueStrg, - OUString _sFalseStrg, - OUString _sCurrencyStrg, - OUString _sCurrencyFormatStrg ) + const OUString& _sOnStrg, + const OUString& _sOffStrg, + const OUString& _sYesStrg, + const OUString& _sNoStrg, + const OUString& _sTrueStrg, + const OUString& _sFalseStrg, + const OUString& _sCurrencyStrg, + const OUString& _sCurrencyFormatStrg ) : cDecPoint(_cDecPoint) , cThousandSep(_cThousandSep) , sOnStrg(_sOnStrg) @@ -954,7 +954,7 @@ void SbxBasicFormater::ScanFormatString( double dNumber, sReturnStrgFinal = sReturnStrg.makeStringAndClear(); } -OUString SbxBasicFormater::BasicFormatNull( OUString sFormatStrg ) +OUString SbxBasicFormater::BasicFormatNull( const OUString& sFormatStrg ) { sal_Bool bNullFormatFound; OUString sNullFormatStrg = GetNullFormatString( sFormatStrg, bNullFormatFound ); @@ -966,9 +966,10 @@ OUString SbxBasicFormater::BasicFormatNull( OUString sFormatStrg ) return OUString("null"); } -OUString SbxBasicFormater::BasicFormat( double dNumber, OUString sFormatStrg ) +OUString SbxBasicFormater::BasicFormat( double dNumber, const OUString& _sFormatStrg ) { sal_Bool bPosFormatFound,bNegFormatFound,b0FormatFound; + OUString sFormatStrg = _sFormatStrg; // analyse format-string concerning predefined formats: if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_GENERALNUMBER ) ) @@ -1071,7 +1072,7 @@ OUString SbxBasicFormater::BasicFormat( double dNumber, OUString sFormatStrg ) return sReturnStrg; } -sal_Bool SbxBasicFormater::isBasicFormat( OUString sFormatStrg ) +sal_Bool SbxBasicFormater::isBasicFormat( const OUString& sFormatStrg ) { if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_GENERALNUMBER ) ) { |