[Libreoffice-commits] core.git: basctl/source basic/source

nadith nadmalinda at gmail.com
Thu Aug 4 05:54:12 UTC 2016


 basctl/source/basicide/baside3.cxx  |    4 +---
 basctl/source/basicide/basobj3.cxx  |    3 +--
 basctl/source/basicide/moduldlg.cxx |    3 +--
 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 ++++++-------------
 8 files changed, 15 insertions(+), 33 deletions(-)

New commits:
commit c85a3ac70d813eef9baa9a5592c0a2d724bb9038
Author: nadith <nadmalinda at gmail.com>
Date:   Fri Jul 29 11:47:40 2016 +0530

    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 <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 185dba4..5929df1 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -763,9 +763,7 @@ void DialogWindow::SaveDialog()
                 aURLObj.removeSegment();
                 OUString aURL( aURLObj.GetMainURL( INetURLObject::NO_DECODE ) );
                 bool bReadOnly = false;
-                OUString aComment( "# " );
-                aComment += aDialogName;
-                aComment += " strings" ;
+                OUString aComment = "# " + aDialogName + " strings" ;
                 Reference< task::XInteractionHandler > xDummyHandler;
 
                 // Remove old properties files in case of overwriting Dialog files
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index 360b72f..ad9626e 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -72,8 +72,7 @@ SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName )
             sal_Int32 nMacro = 1;
             while ( !bValid )
             {
-                aMacroName = "Macro";
-                aMacroName += OUString::number( nMacro );
+                aMacroName = "Macro" + OUString::number( nMacro );
                 // test whether existing...
                 bValid = pModule->FindMethod( aMacroName, SbxClassType::Method ) == nullptr;
                 nMacro++;
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index cf4e557..71bdc91 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -953,8 +953,7 @@ void LibDialog::dispose()
 
 void LibDialog::SetStorageName( const OUString& rName )
 {
-    OUString aName( IDE_RESSTR(RID_STR_FILENAME) );
-    aName += rName;
+    OUString aName = IDE_RESSTR(RID_STR_FILENAME) + rName;
     m_pStorageFrame->set_label(aName);
 }
 
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 5978764..88e38fd 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 4ed7ed0..ac09888 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 55e93f1..59325bd 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 2a8684e..ec6d3c6 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 a1cf85e..b374fd2 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 );


More information about the Libreoffice-commits mailing list