From c85a3ac70d813eef9baa9a5592c0a2d724bb9038 Mon Sep 17 00:00:00 2001 From: nadith Date: Fri, 29 Jul 2016 11:47:40 +0530 Subject: tdf#100726: Improve readability of OUString concatenation all most all of the places in the basic basctl modules this bug fixed Change-Id: I1a4a03e207c1b520449c31a05265585120da07f6 Reviewed-on: https://gerrit.libreoffice.org/27662 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basic/source/runtime/runtime.cxx | 4 +--- basic/source/sbx/sbxdate.cxx | 3 +-- basic/source/sbx/sbxform.cxx | 3 +-- basic/source/uno/dlgcont.cxx | 9 +++------ basic/source/uno/namecont.cxx | 19 ++++++------------- 5 files changed, 12 insertions(+), 26 deletions(-) (limited to 'basic') diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 5978764ed89d..88e38fd6d62a 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -3576,9 +3576,7 @@ SbxBase* SbiRuntime::FindElementExtern( const OUString& rName ) if ( !pElem && pMeth ) { // for statics, set the method's name in front - OUString aMethName = pMeth->GetName(); - aMethName += ":"; - aMethName += rName; + OUString aMethName = pMeth->GetName() + ":" + rName; pElem = pMod->Find(aMethName, SbxClassType::DontCare); } diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx index 4ed7ed034ca5..ac098881395a 100644 --- a/basic/source/sbx/sbxdate.cxx +++ b/basic/source/sbx/sbxdate.cxx @@ -126,8 +126,7 @@ double ImpGetDate( const SbxValues* p ) case YMD: aDateStr = "YYYY/MM/DD"; break; } - OUString aStr( aDateStr ); - aStr += " HH:MM:SS"; + OUString aStr = aDateStr + " HH:MM:SS"; pFormatter->PutandConvertEntry( aStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH_US, eLangType ); diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx index 55e93f11e7c3..59325bd7f3f5 100644 --- a/basic/source/sbx/sbxform.cxx +++ b/basic/source/sbx/sbxform.cxx @@ -1026,8 +1026,7 @@ OUString SbxBasicFormater::BasicFormat( double dNumber, const OUString& _sFormat { if( sNegFormatStrg.isEmpty() && bPosFormatFound ) { - sTempStrg = "-"; - sTempStrg += sPosFormatStrg; + sTempStrg = "-" + sPosFormatStrg; } else { diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index 2a8684e494bb..ec6d3c6815d2 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -359,8 +359,7 @@ Reference< css::resource::XStringResourcePersistence > // get ui locale ::com::sun ::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale(); - OUString aComment(aResourceFileCommentBase); - aComment += aLibName; + OUString aComment= aResourceFileCommentBase + aLibName; bool bStorage = mxStorage.is(); if( bStorage ) @@ -531,8 +530,7 @@ void SfxDialogLibrary::storeResourcesAsURL void SfxDialogLibrary::storeResourcesToURL( const OUString& URL, const Reference< task::XInteractionHandler >& xHandler ) { - OUString aComment(aResourceFileCommentBase); - aComment += m_aName; + OUString aComment = aResourceFileCommentBase + m_aName; if( m_xStringResourcePersistence.is() ) { @@ -543,8 +541,7 @@ void SfxDialogLibrary::storeResourcesToURL( const OUString& URL, void SfxDialogLibrary::storeResourcesToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage ) { - OUString aComment(aResourceFileCommentBase); - aComment += m_aName; + OUString aComment = aResourceFileCommentBase + m_aName; if( m_xStringResourcePersistence.is() ) { diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index a1cf85e491fc..b374fd26e439 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -1424,8 +1424,7 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib, for( sal_Int32 i = 0 ; i < nNameCount ; i++ ) { OUString aElementName = pNames[ i ]; - OUString aStreamName = aElementName; - aStreamName += ".xml"; + OUString aStreamName = aElementName + ".xml"; if( !isLibraryElementValid( pLib->getByName( aElementName ) ) ) { @@ -1578,8 +1577,7 @@ void SfxLibraryContainer::implStoreLibraryIndexFile( SfxLibrary* pLib, uno::Reference< io::XStream > xInfoStream; if( bStorage ) { - OUString aStreamName( maInfoFileName ); - aStreamName += "-lb.xml"; + OUString aStreamName = maInfoFileName + "-lb.xml"; try { @@ -1681,8 +1679,7 @@ bool SfxLibraryContainer::implLoadLibraryIndexFile( SfxLibrary* pLib, OUString aLibInfoPath; if( bStorage ) { - aLibInfoPath = maInfoFileName; - aLibInfoPath += "-lb.xml"; + aLibInfoPath = maInfoFileName + "-lb.xml"; try { @@ -2100,8 +2097,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto uno::Reference< io::XStream > xInfoStream; if( bStorage ) { - OUString aStreamName( maInfoFileName ); - aStreamName += "-lc.xml"; + OUString aStreamName = maInfoFileName + "-lc.xml"; try { @@ -2447,8 +2443,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name ) { uno::Reference< io::XStream > xElementStream; - aFile = aElementName; - aFile += ".xml"; + aFile = aElementName + ".xml"; try { @@ -2460,9 +2455,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name ) if( !xElementStream.is() ) { // Check for EA2 document version with wrong extensions - aFile = aElementName; - aFile += "."; - aFile += maLibElementFileExtension; + aFile = aElementName + "." + maLibElementFileExtension; try { xElementStream = xLibraryStor->openStreamElement( aFile, embed::ElementModes::READ ); -- cgit