[Libreoffice-commits] core.git: basic/source
nadith
nadmalinda at gmail.com
Fri Jul 15 08:40:17 UTC 2016
basic/source/sbx/sbxobj.cxx | 12 +++---------
basic/source/uno/namecont.cxx | 16 ++++------------
basic/source/uno/scriptcont.cxx | 16 ++++------------
3 files changed, 11 insertions(+), 33 deletions(-)
New commits:
commit 054cf21948e86cbe5b809fa61c7a99d27fc8cf5d
Author: nadith <nadmalinda at gmail.com>
Date: Fri Jul 15 00:09:57 2016 +0530
tdf#100726: Improve readability of OUString concatenation in basic module
Change-Id: I96c3215cf9f8932127e681aaaaee649774cac2e4
Reviewed-on: https://gerrit.libreoffice.org/27229
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index 9cdd777..29803ad 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -695,9 +695,7 @@ static bool CollectAttrs( const SbxBase* p, OUString& rRes )
}
if( !aAttrs.isEmpty() )
{
- rRes = " (";
- rRes += aAttrs;
- rRes += ")";
+ rRes = " (" + aAttrs + ")";
return true;
}
else
@@ -763,9 +761,7 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill )
SbxVariable* pVar = r;
if( pVar )
{
- OUString aLine( aIndent );
- aLine += " - ";
- aLine += pVar->GetName( SbxNAME_SHORT_TYPES );
+ OUString aLine = aIndent + " - " + pVar->GetName( SbxNAME_SHORT_TYPES );
OUString aAttrs2;
if( CollectAttrs( pVar, aAttrs2 ) )
{
@@ -802,9 +798,7 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill )
SbxVariable* pVar = r;
if( pVar )
{
- OUString aLine( aIndent );
- aLine += " - ";
- aLine += pVar->GetName( SbxNAME_SHORT_TYPES );
+ OUString aLine = aIndent + " - " + pVar->GetName( SbxNAME_SHORT_TYPES );
OUString aAttrs3;
if( CollectAttrs( pVar, aAttrs3 ) )
{
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index c50d460..a1cf85e 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -613,10 +613,7 @@ static void createVariableURL( OUString& rStr, const OUString& rLibName,
{
rStr = "$(INST)/" LIBO_SHARE_FOLDER "/basic/";
}
- rStr += rLibName;
- rStr += "/";
- rStr += rInfoFileName;
- rStr += ".xlb/";
+ rStr += rLibName + "/" + rInfoFileName + ".xlb/";
}
void SfxLibraryContainer::init( const OUString& rInitialDocumentURL, const uno::Reference< embed::XStorage >& rxInitialStorage )
@@ -730,9 +727,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
if ( xLibrariesStor.is() )
{
- aFileName = maInfoFileName;
- aFileName += "-lc.xml";
-
+ aFileName = maInfoFileName + "-lc.xml";
try
{
xStream = xLibrariesStor->openStreamElement( aFileName, embed::ElementModes::READ );
@@ -745,9 +740,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
mbOldInfoFormat = true;
// Check old version
- aFileName = maOldInfoFileName;
- aFileName += ".xml";
-
+ aFileName = maOldInfoFileName + ".xml";
try
{
xStream = xLibrariesStor->openStreamElement( aFileName, embed::ElementModes::READ );
@@ -758,8 +751,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
if( !xStream.is() )
{
// Check for EA2 document version with wrong extensions
- aFileName = maOldInfoFileName;
- aFileName += ".xli";
+ aFileName = maOldInfoFileName + ".xli";
xStream = xLibrariesStor->openStreamElement( aFileName, embed::ElementModes::READ );
}
}
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index 9740471..38fff90 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -620,9 +620,7 @@ bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, cons
SbModule* pMod = pBasicLib->FindModule( aElementName );
if( pMod )
{
- OUString aCodeStreamName = aElementName;
- aCodeStreamName += ".bin";
-
+ OUString aCodeStreamName = aElementName + ".bin";
try
{
uno::Reference< io::XStream > xCodeStream = xStorage->openStreamElement(
@@ -668,9 +666,7 @@ bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, cons
continue;
}
- OUString aSourceStreamName = aElementName;
- aSourceStreamName += ".xml";
-
+ OUString aSourceStreamName = aElementName + ".xml";
try
{
uno::Reference< io::XStream > xSourceStream = xStorage->openStreamElement(
@@ -945,9 +941,7 @@ bool SfxScriptLibraryContainer::implLoadPasswordLibrary
pBasicLib->SetModified( false );
}
- OUString aCodeStreamName= aElementName;
- aCodeStreamName += ".bin";
-
+ OUString aCodeStreamName= aElementName + ".bin";
try
{
uno::Reference< io::XStream > xCodeStream = xLibraryStor->openStreamElement(
@@ -981,9 +975,7 @@ bool SfxScriptLibraryContainer::implLoadPasswordLibrary
if( bLoadSource || bVerifyPasswordOnly )
{
// Access encrypted source stream
- OUString aSourceStreamName = aElementName;
- aSourceStreamName += ".xml";
-
+ OUString aSourceStreamName = aElementName + ".xml";
try
{
uno::Reference< io::XStream > xSourceStream = xLibraryStor->openEncryptedStreamElement(
More information about the Libreoffice-commits
mailing list