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

Muhammet Kara muhammet.kara at pardus.org.tr
Sun Jul 3 15:47:30 UTC 2016


 basctl/source/basicide/moduldl2.cxx       |   28 ++++++++++++++--------------
 basctl/source/basicide/scriptdocument.cxx |    4 ++--
 basctl/source/dlged/propbrw.cxx           |    4 ++--
 basic/qa/cppunit/test_vba.cxx             |   12 ++++++------
 basic/source/classes/sbunoobj.cxx         |   26 +++++++++++++-------------
 basic/source/classes/sbxmod.cxx           |   24 ++++++++++++------------
 basic/source/comp/symtbl.cxx              |    6 +++---
 7 files changed, 52 insertions(+), 52 deletions(-)

New commits:
commit d5784e91e9cd83336dc16392fd65cb11c5373c9c
Author: Muhammet Kara <muhammet.kara at pardus.org.tr>
Date:   Fri Jul 1 14:07:52 2016 +0300

    Improve readability of OUString concatanation in LibPage
    
    , ScriptDocument
    , PropBrw
    , VBATest
    , SbUnoClass
    , SbModule
    , and SbiSymPool
    
    It is more readable and more efficient as a bonus.
    See: https://goo.gl/jsVAwy:
    
    Change-Id: I73926989345193b133e538d5aeca36f12723162c
    Reviewed-on: https://gerrit.libreoffice.org/26853
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index a46595b..d7e9e56 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -747,18 +747,18 @@ void LibPage::InsertLib()
     // filter
     OUString aTitle(IDEResId(RID_STR_BASIC).toString());
     OUString aFilter;
-    aFilter =  "*.sbl;*.xlc;*.xlb" ;        // library files
-    aFilter += ";*.sdw;*.sxw;*.odt" ;       // text
-    aFilter += ";*.vor;*.stw;*.ott" ;       // text template
-    aFilter += ";*.sgl;*.sxg;*.odm" ;       // master document
-    aFilter += ";*.oth" ;                   // html document template
-    aFilter += ";*.sdc;*.sxc;*.ods" ;       // spreadsheet
-    aFilter += ";*.stc;*.ots" ;             // spreadsheet template
-    aFilter += ";*.sda;*.sxd;*.odg" ;       // drawing
-    aFilter += ";*.std;*.otg" ;             // drawing template
-    aFilter += ";*.sdd;*.sxi;*.odp" ;       // presentation
-    aFilter += ";*.sti;*.otp" ;             // presentation template
-    aFilter += ";*.sxm;*.odf" ;             // formula
+    aFilter =  OUString("*.sbl;*.xlc;*.xlb")        // library files
+            + ";*.sdw;*.sxw;*.odt"        // text
+            + ";*.vor;*.stw;*.ott"        // text template
+            + ";*.sgl;*.sxg;*.odm"        // master document
+            + ";*.oth"                    // html document template
+            + ";*.sdc;*.sxc;*.ods"        // spreadsheet
+            + ";*.stc;*.ots"              // spreadsheet template
+            + ";*.sda;*.sxd;*.odg"        // drawing
+            + ";*.std;*.otg"              // drawing template
+            + ";*.sdd;*.sxi;*.odp"        // presentation
+            + ";*.sti;*.otp"              // presentation template
+            + ";*.sxm;*.odf" ;            // formula
     xFP->appendFilter( aTitle, aFilter );
 
     // set display directory and filter
@@ -1271,8 +1271,8 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
         const OUString strFullPath = "FullPath" ;
         const OUString strBasicMediaType = "application/vnd.sun.star.basic-library" ;
 
-        OUString fullPath = aLibName;
-        fullPath += "/" ;
+        OUString fullPath = aLibName
+                          + "/" ;
         auto attribs(::comphelper::InitPropertySequence({
             { strFullPath, makeAny(fullPath) },
             { strMediaType, makeAny(strBasicMediaType) }
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx
index 11b7cf1..b66f264 100644
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@ -1269,8 +1269,8 @@ namespace basctl
         sal_Int32 i = 1;
         while ( !bValid )
         {
-            aObjectName = aBaseName;
-            aObjectName += OUString::number( i );
+            aObjectName = aBaseName
+                        + OUString::number( i );
 
             if ( aUsedNamesCheck.find( aObjectName ) == aUsedNamesCheck.end() )
                 bValid = true;
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx
index 0260d77..fea4b05 100644
--- a/basctl/source/dlged/propbrw.cxx
+++ b/basctl/source/dlged/propbrw.cxx
@@ -284,8 +284,8 @@ void PropBrw::implSetNewObjectSequence
     {
         xObjectInspector->inspect( _rObjectSeq );
 
-        OUString aText = IDE_RESSTR(RID_STR_BRWTITLE_PROPERTIES);
-        aText += IDE_RESSTR(RID_STR_BRWTITLE_MULTISELECT);
+        OUString aText = IDE_RESSTR(RID_STR_BRWTITLE_PROPERTIES)
+                       + IDE_RESSTR(RID_STR_BRWTITLE_MULTISELECT);
         SetText( aText );
     }
 }
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index 83d243d..7d145e8 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -69,8 +69,8 @@ void VBATest::testMiscVBAFunctions()
 
     for ( sal_uInt32  i=0; i<SAL_N_ELEMENTS( macroSource ); ++i )
     {
-        OUString sMacroURL( sMacroPathURL );
-        sMacroURL += OUString::createFromAscii( macroSource[ i ] );
+        OUString sMacroURL = sMacroPathURL
+                           + OUString::createFromAscii( macroSource[ i ] );
 
         MacroSnippet myMacro;
         myMacro.LoadSourceFromFile( sMacroURL );
@@ -133,16 +133,16 @@ void VBATest::testMiscOLEStuff()
 
     uno::Sequence< uno::Any > aArgs(1);
     // path to test document
-    OUString sPath = m_directories.getPathFromSrc("/basic/qa/vba_tests/data/");
-    sPath += "ADODBdata.xls";
+    OUString sPath = m_directories.getPathFromSrc("/basic/qa/vba_tests/data/")
+                   + "ADODBdata.xls";
     sPath = sPath.replaceAll( "/", "\\" );
 
     aArgs[ 0 ] = uno::makeAny( sPath );
 
     for ( sal_uInt32  i=0; i<SAL_N_ELEMENTS( macroSource ); ++i )
     {
-        OUString sMacroURL( sMacroPathURL );
-        sMacroURL += OUString::createFromAscii( macroSource[ i ] );
+        OUString sMacroURL = sMacroPathURL
+                           + OUString::createFromAscii( macroSource[ i ] );
         MacroSnippet myMacro;
         myMacro.LoadSourceFromFile( sMacroURL );
         SbxVariableRef pReturn = myMacro.Run( aArgs );
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 6622cde..cc1b6aa 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -3396,9 +3396,9 @@ SbxVariable* SbUnoClass::Find( const OUString& rName, SbxClassType )
         else
         {
             // expand fully qualified name
-            OUString aNewName = GetName();
-            aNewName += ".";
-            aNewName += rName;
+            OUString aNewName = GetName()
+                              + "."
+                              + rName;
 
             // get CoreReflection
             Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl();
@@ -3808,8 +3808,8 @@ void SbUnoSingleton::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
         Any aRetAny;
         if( xContextToUse.is() )
         {
-            OUString aSingletonName( "/singletons/" );
-            aSingletonName += GetName();
+            OUString aSingletonName = "/singletons/"
+                                    + GetName();
             Reference < XInterface > xRet;
             xContextToUse->getValueByName( aSingletonName ) >>= xRet;
             aRetAny <<= xRet;
@@ -4306,9 +4306,9 @@ void SAL_CALL ModuleInvocationProxy::setValue(const OUString& rProperty, const A
 
     SolarMutexGuard guard;
 
-    OUString aPropertyFunctionName( "Property Set " );
-    aPropertyFunctionName += m_aPrefix;
-    aPropertyFunctionName += rProperty;
+    OUString aPropertyFunctionName = "Property Set "
+                                   + m_aPrefix
+                                   + rProperty;
 
     SbxVariable* p = m_xScopeObj->Find( aPropertyFunctionName, SbxClassType::Method );
     SbMethod* pMeth = p != nullptr ? dynamic_cast<SbMethod*>( p ) : nullptr;
@@ -4345,9 +4345,9 @@ Any SAL_CALL ModuleInvocationProxy::getValue(const OUString& rProperty)
     }
     SolarMutexGuard guard;
 
-    OUString aPropertyFunctionName( "Property Get " );
-    aPropertyFunctionName += m_aPrefix;
-    aPropertyFunctionName += rProperty;
+    OUString aPropertyFunctionName = "Property Get "
+                                   + m_aPrefix
+                                   + rProperty;
 
     SbxVariable* p = m_xScopeObj->Find( aPropertyFunctionName, SbxClassType::Method );
     SbMethod* pMeth = p != nullptr ? dynamic_cast<SbMethod*>( p ) : nullptr;
@@ -4390,8 +4390,8 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const OUString& rFunction,
     {
         return aRet;
     }
-    OUString aFunctionName = m_aPrefix;
-    aFunctionName += rFunction;
+    OUString aFunctionName = m_aPrefix
+                           + rFunction;
 
     bool bSetRescheduleBack = false;
     bool bOldReschedule = true;
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index f36b9bf..1e59c13 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -742,8 +742,8 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
 
             if( pHint->GetId() == SBX_HINT_DATAWANTED )
             {
-                OUString aProcName("Property Get ");
-                aProcName += pProcProperty->GetName();
+                OUString aProcName = "Property Get "
+                                   + pProcProperty->GetName();
 
                 SbxVariable* pMethVar = Find( aProcName, SbxClassType::Method );
                 if( pMethVar )
@@ -784,14 +784,14 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
                 {
                     pProcProperty->setSet( false );
 
-                    OUString aProcName("Property Set ");
-                    aProcName += pProcProperty->GetName();
+                    OUString aProcName = "Property Set "
+                                       + pProcProperty->GetName();
                     pMethVar = Find( aProcName, SbxClassType::Method );
                 }
                 if( !pMethVar ) // Let
                 {
-                    OUString aProcName("Property Let " );
-                    aProcName += pProcProperty->GetName();
+                    OUString aProcName = "Property Let "
+                                       + pProcProperty->GetName();
                     pMethVar = Find( aProcName, SbxClassType::Method );
                 }
 
@@ -1871,8 +1871,8 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH
 
             if( pHint->GetId() == SBX_HINT_DATAWANTED )
             {
-                OUString aProcName("Property Get ");
-                aProcName += pProcProperty->GetName();
+                OUString aProcName = "Property Get "
+                                   + pProcProperty->GetName();
 
                 SbxVariable* pMeth = Find( aProcName, SbxClassType::Method );
                 if( pMeth )
@@ -1913,14 +1913,14 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH
                 {
                     pProcProperty->setSet( false );
 
-                    OUString aProcName("Property Set " );
-                    aProcName += pProcProperty->GetName();
+                    OUString aProcName = "Property Set "
+                                       + pProcProperty->GetName();
                     pMeth = Find( aProcName, SbxClassType::Method );
                 }
                 if( !pMeth )    // Let
                 {
-                    OUString aProcName("Property Let " );
-                    aProcName += pProcProperty->GetName();
+                    OUString aProcName = "Property Let "
+                                       + pProcProperty->GetName();
                     pMeth = Find( aProcName, SbxClassType::Method );
                 }
 
diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx
index f7e6016..578d035 100644
--- a/basic/source/comp/symtbl.cxx
+++ b/basic/source/comp/symtbl.cxx
@@ -160,9 +160,9 @@ void SbiSymPool::Add( SbiSymDef* pDef )
             OUString aName( pDef->aName );
             if( pDef->IsStatic() )
             {
-                aName = pParser->aGblStrings.Find( nProcId );
-                aName += ":";
-                aName += pDef->aName;
+                aName = pParser->aGblStrings.Find( nProcId )
+                      + ":"
+                      + pDef->aName;
             }
             pDef->nId = rStrings.Add( aName );
         }


More information about the Libreoffice-commits mailing list