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

Arnold Dumas arnold at dumas.at
Mon Jul 4 10:25:00 UTC 2016


 basctl/source/basicide/basides1.cxx |    4 +---
 basctl/source/basicide/basobj2.cxx  |   14 ++------------
 basctl/source/basicide/basobj3.cxx  |    5 +----
 basctl/source/basicide/macrodlg.cxx |    6 +-----
 4 files changed, 5 insertions(+), 24 deletions(-)

New commits:
commit aee49860ee413547e2779dbd622700343ce255b3
Author: Arnold Dumas <arnold at dumas.at>
Date:   Fri Jul 1 20:52:26 2016 +0200

    tdf#100726: Improve readability of OUString concatenations
    
    Change-Id: I7018f3c339ffcab7d46d97f1d3784da1be644f0a
    Reviewed-on: https://gerrit.libreoffice.org/26870
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 8bd711b..50ea0d6 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -916,9 +916,7 @@ void Shell::GetState(SfxItemSet &rSet)
                             else
                                 aLocale = pCurMgr->getStringResourceManager()->getDefaultLocale();
 
-                            aLangStr += aLocale.Language;
-                            aLangStr += aLocale.Country;
-                            aLangStr += aLocale.Variant;
+                            aLangStr += aLocale.Language + aLocale.Country + aLocale.Variant;
                         }
                         aItemStr = aLangStr;
                     }
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 29d9824..d344710 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -289,12 +289,7 @@ OUString ChooseMacro( const uno::Reference< frame::XModel >& rxLimitToDocument,
             }
 
             // name
-            OUString aName;
-            aName += pBasic->GetName();
-            aName += ".";
-            aName += pModule->GetName();
-            aName += ".";
-            aName += pMethod->GetName();
+            OUString aName = pBasic->GetName() + "." + pModule->GetName() + "." + pMethod->GetName();
 
             // location
             OUString aLocation;
@@ -342,12 +337,7 @@ OUString ChooseMacro( const uno::Reference< frame::XModel >& rxLimitToDocument,
             // script URL
             if ( !bError )
             {
-                aScriptURL = "vnd.sun.star.script:" ;
-                aScriptURL += aName;
-                aScriptURL += "?language=" ;
-                aScriptURL += "Basic";
-                aScriptURL += "&location=" ;
-                aScriptURL += aLocation;
+                aScriptURL = "vnd.sun.star.script:" + aName + "?language=Basic&location=" + aLocation;
             }
 
             if ( !rxLimitToDocument.is() )
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index 5aee287..70b85e4 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -96,10 +96,7 @@ SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName )
             aOUSource = aOUSource.copy( 0, nSourceLen-1 );
     }
 
-    OUString aSubStr;
-    aSubStr = "Sub " ;
-    aSubStr += aMacroName;
-    aSubStr += "\n\nEnd Sub" ;
+    OUString aSubStr = "Sub " + aMacroName + "\n\nEnd Sub";
 
     aOUSource += aSubStr;
 
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index a8ad232..3c15cbc 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -497,11 +497,7 @@ IMPL_LINK_TYPED( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox, void )
     m_pMacroBox->Clear();
     if ( pModule )
     {
-        OUString aStr = m_aMacrosInTxtBaseStr;
-        aStr += " " ;
-        aStr += pModule->GetName();
-
-        m_pMacrosInTxt->SetText( aStr );
+        m_pMacrosInTxt->SetText( m_aMacrosInTxtBaseStr + " " + pModule->GetName() );
 
         // The macros should be called in the same order that they
         // are written down in the module.


More information about the Libreoffice-commits mailing list