[Libreoffice-commits] core.git: scripting/source sd/source sfx2/source stoc/source svl/source svtools/source

Gökhan Gurbetoğlu gokhan.gurbetoglu at pardus.org.tr
Thu Aug 25 14:55:05 UTC 2016


 scripting/source/dlgprov/dlgprov.cxx      |    6 +----
 sd/source/filter/eppt/pptexanimations.cxx |   28 +++++++++++------------
 sfx2/source/dialog/templdlg.cxx           |    4 +--
 stoc/source/javavm/javavm.cxx             |   36 +++++++++++-------------------
 svl/source/config/itemholder2.cxx         |    8 +++---
 svtools/source/config/colorcfg.cxx        |   11 ++++-----
 svtools/source/config/extcolorcfg.cxx     |   29 ++++++++++--------------
 svtools/source/config/itemholder2.cxx     |    8 +++---
 8 files changed, 58 insertions(+), 72 deletions(-)

New commits:
commit b7bf1ba2136b3d1e031673e7b541c6181e95ff61
Author: Gökhan Gurbetoğlu <gokhan.gurbetoglu at pardus.org.tr>
Date:   Wed Aug 24 17:41:12 2016 +0300

    tdf#100726 - Improve readability of OUString concatanations
    
    Improved readability of OUString concatanations. Also removed unused
    OUStrings "sColor" and "sEntry" from the code.
    
    Change-Id: Ie9792f499cd880be72229f8a8c71f05ff8e258b6
    Reviewed-on: https://gerrit.libreoffice.org/28375
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 30d8b23..4adfd13 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -280,10 +280,8 @@ static const char aResourceResolverPropName[] = "ResourceResolver";
             uriRef.set( xFac->parse( aURL ), UNO_QUERY );
             if ( !uriRef.is() )
             {
-                OUString errorMsg("DialogProviderImpl::getDialogModel: failed to parse URI: ");
-                errorMsg += aURL;
-                throw IllegalArgumentException( errorMsg,
-                                                Reference< XInterface >(), 1 );
+                OUString errorMsg = "DialogProviderImpl::getDialogModel: failed to parse URI: " + aURL;
+                throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 1 );
             }
             Reference < uri::XVndSunStarExpandUrl > sxUri( uriRef, UNO_QUERY );
             if( !sxUri.is() )
diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx
index 4a839c2..adf8661 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -1429,23 +1429,23 @@ Any AnimationExporter::convertAnimateValue( const Any& rSourceValue, const OUStr
         OUString aP( "," );
         if ( rSourceValue >>= aHSL )
         {
-            aDest += "hsl(";
-            aDest += OUString::number( (sal_Int32)( aHSL[ 0 ] / ( 360.0 / 255 ) ) );
-            aDest += aP;
-            aDest += OUString::number( (sal_Int32)( aHSL[ 1 ] * 255.0 ) );
-            aDest += aP;
-            aDest += OUString::number( (sal_Int32)( aHSL[ 2 ] * 255.0 ) );
-            aDest += ")";
+            aDest += "hsl("
+                  +  OUString::number( (sal_Int32)( aHSL[ 0 ] / ( 360.0 / 255 ) ) )
+                  +  aP
+                  +  OUString::number( (sal_Int32)( aHSL[ 1 ] * 255.0 ) )
+                  +  aP
+                  +  OUString::number( (sal_Int32)( aHSL[ 2 ] * 255.0 ) )
+                  +  ")";
         }
         else if ( rSourceValue >>= nColor )
         {
-            aDest += "rgb(";
-            aDest += OUString::number( ( (sal_Int8)nColor ) );
-            aDest += aP;
-            aDest += OUString::number( ( (sal_Int8)( nColor >> 8 ) ) );
-            aDest += aP;
-            aDest += OUString::number( ( (sal_Int8)( nColor >> 16 ) ) );
-            aDest += ")";
+            aDest += "rgb("
+                  +  OUString::number( ( (sal_Int8)nColor ) )
+                  +  aP
+                  +  OUString::number( ( (sal_Int8)( nColor >> 8 ) ) )
+                  +  aP
+                  +  OUString::number( ( (sal_Int8)( nColor >> 16 ) ) )
+                  +  ")";
         }
     }
     else if ( rAttributeName == "FillStyle" )
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 4096986..8e0d421 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1912,8 +1912,8 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl()
         SvTreeListEntry* pEntry = pTreeBox ? pTreeBox->FirstSelected() : aFmtLb->FirstSelected();
         const SfxStyleFamilyItem* pItem = GetFamilyItem_Impl();
 
-        OUString aMsg = SfxResId(STR_DELETE_STYLE_USED).toString();
-        aMsg += SfxResId(STR_DELETE_STYLE).toString();
+        OUString aMsg = SfxResId(STR_DELETE_STYLE_USED).toString()
+                      + SfxResId(STR_DELETE_STYLE).toString();
 
         while (pEntry)
         {
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index e37023b..dcba929 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -286,14 +286,12 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
         // read ftp proxy name
         css::uno::Reference<css::registry::XRegistryKey> ftpProxy_name = xRegistryRootKey->openKey("Settings/ooInetFTPProxyName");
         if(ftpProxy_name.is() && !ftpProxy_name->getStringValue().isEmpty()) {
-            OUString ftpHost = "ftp.proxyHost=";
-            ftpHost += ftpProxy_name->getStringValue();
+            OUString ftpHost = "ftp.proxyHost=" + ftpProxy_name->getStringValue();
 
             // read ftp proxy port
             css::uno::Reference<css::registry::XRegistryKey> ftpProxy_port = xRegistryRootKey->openKey("Settings/ooInetFTPProxyPort");
             if(ftpProxy_port.is() && ftpProxy_port->getLongValue()) {
-                OUString ftpPort = "ftp.proxyPort=";
-                ftpPort += OUString::number(ftpProxy_port->getLongValue());
+                OUString ftpPort = "ftp.proxyPort=" + OUString::number(ftpProxy_port->getLongValue());
 
                 pjvm->pushProp(ftpHost);
                 pjvm->pushProp(ftpPort);
@@ -303,14 +301,12 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
         // read http proxy name
         css::uno::Reference<css::registry::XRegistryKey> httpProxy_name = xRegistryRootKey->openKey("Settings/ooInetHTTPProxyName");
         if(httpProxy_name.is() && !httpProxy_name->getStringValue().isEmpty()) {
-            OUString httpHost = "http.proxyHost=";
-            httpHost += httpProxy_name->getStringValue();
+            OUString httpHost = "http.proxyHost=" + httpProxy_name->getStringValue();
 
             // read http proxy port
             css::uno::Reference<css::registry::XRegistryKey> httpProxy_port = xRegistryRootKey->openKey("Settings/ooInetHTTPProxyPort");
             if(httpProxy_port.is() && httpProxy_port->getLongValue()) {
-                OUString httpPort = "http.proxyPort=";
-                httpPort += OUString::number(httpProxy_port->getLongValue());
+                OUString httpPort = "http.proxyPort=" + OUString::number(httpProxy_port->getLongValue());
 
                 pjvm->pushProp(httpHost);
                 pjvm->pushProp(httpPort);
@@ -320,14 +316,12 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
         // read https proxy name
         css::uno::Reference<css::registry::XRegistryKey> httpsProxy_name = xRegistryRootKey->openKey("Settings/ooInetHTTPSProxyName");
         if(httpsProxy_name.is() && !httpsProxy_name->getStringValue().isEmpty()) {
-            OUString httpsHost = "https.proxyHost=";
-            httpsHost += httpsProxy_name->getStringValue();
+            OUString httpsHost = "https.proxyHost=" + httpsProxy_name->getStringValue();
 
             // read https proxy port
             css::uno::Reference<css::registry::XRegistryKey> httpsProxy_port = xRegistryRootKey->openKey("Settings/ooInetHTTPSProxyPort");
             if(httpsProxy_port.is() && httpsProxy_port->getLongValue()) {
-                OUString httpsPort = "https.proxyPort=";
-                httpsPort += OUString::number(httpsProxy_port->getLongValue());
+                OUString httpsPort = "https.proxyPort=" + OUString::number(httpsProxy_port->getLongValue());
 
                 pjvm->pushProp(httpsHost);
                 pjvm->pushProp(httpsPort);
@@ -337,14 +331,12 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
         // read  nonProxyHosts
         css::uno::Reference<css::registry::XRegistryKey> nonProxies_name = xRegistryRootKey->openKey("Settings/ooInetNoProxy");
         if(nonProxies_name.is() && !nonProxies_name->getStringValue().isEmpty()) {
-            OUString httpNonProxyHosts = "http.nonProxyHosts=";
-            OUString ftpNonProxyHosts = "ftp.nonProxyHosts=";
-            OUString value= nonProxies_name->getStringValue();
+            OUString value = nonProxies_name->getStringValue();
             // replace the separator ";" by "|"
-            value= value.replace((sal_Unicode)';', (sal_Unicode)'|');
+            value = value.replace((sal_Unicode)';', (sal_Unicode)'|');
 
-            httpNonProxyHosts += value;
-            ftpNonProxyHosts += value;
+            OUString httpNonProxyHosts = "http.nonProxyHosts=" + value;
+            OUString ftpNonProxyHosts = "ftp.nonProxyHosts=" + value;
 
             pjvm->pushProp(httpNonProxyHosts);
             pjvm->pushProp(ftpNonProxyHosts);
@@ -386,15 +378,15 @@ void getDefaultLocaleFromConfig(
             country = locale->getStringValue().copy(index + 1);
 
             if(!language.isEmpty()) {
-                OUString prop("user.language=");
-                prop += language;
+                OUString prop = "user.language="
+                              + language;
 
                 pjvm->pushProp(prop);
             }
 
             if(!country.isEmpty()) {
-                OUString prop("user.country=");
-                prop += country;
+                OUString prop = "user.country="
+                              + country;
 
                 pjvm->pushProp(prop);
             }
diff --git a/svl/source/config/itemholder2.cxx b/svl/source/config/itemholder2.cxx
index a3b5809..1c0d52b 100644
--- a/svl/source/config/itemholder2.cxx
+++ b/svl/source/config/itemholder2.cxx
@@ -50,10 +50,10 @@ ItemHolder2::ItemHolder2()
         if(bMessage)
         {
             bMessage = false;
-            OString sMsg("CreateInstance with arguments exception: ");
-            sMsg += OString(rEx.Message.getStr(),
-                        rEx.Message.getLength(),
-                        RTL_TEXTENCODING_ASCII_US);
+            OString sMsg = "CreateInstance with arguments exception: "
+                         + OString(rEx.Message.getStr(),
+                                   rEx.Message.getLength(),
+                                   RTL_TEXTENCODING_ASCII_US);
             OSL_FAIL(sMsg.getStr());
         }
     }
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx
index 1805465..f2ae591 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -166,17 +166,16 @@ uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme)
         { RTL_CONSTASCII_USTRINGPARAM("/SQLComment"),  false }
     };
     int nIndex = 0;
-    OUString sColor = cColor;
-    OUString sBase(cColorSchemes);
-    sBase += utl::wrapConfigurationElementName(rScheme);
+    OUString sBase = cColorSchemes
+                   + utl::wrapConfigurationElementName(rScheme);
     const int nCount = ColorConfigEntryCount;
     for(sal_Int32 i = 0; i < 4 * nCount; i+= 4)
     {
-        OUString sBaseName(sBase);
         sal_Int32 nPos = i / 4;
-        sBaseName += OUString(cNames[nPos].cName, cNames[nPos].nLength, cNames[nPos].eEncoding);
+        OUString sBaseName = sBase
+                           + OUString(cNames[nPos].cName, cNames[nPos].nLength, cNames[nPos].eEncoding);
         pNames[nIndex] += sBaseName;
-        pNames[nIndex++] += sColor;
+        pNames[nIndex++] += cColor;
         if(cNames[nPos].bCanBeVisible)
         {
             pNames[nIndex] += sBaseName;
diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx
index 381767f..2267f3e 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -253,8 +253,8 @@ void ExtendedColorConfig_Impl::Load(const OUString& rScheme)
     for(sal_Int32 i = 0;pIter != pEnd;++pIter,++i)
     {
         uno::Sequence < OUString > aComponentDisplayNames(1);
-        aComponentDisplayNames[0] = *pIter;
-        aComponentDisplayNames[0] += sDisplayName;
+        aComponentDisplayNames[0] = *pIter
+                                  + sDisplayName;
         uno::Sequence< uno::Any > aComponentDisplayNamesValue = GetProperties( aComponentDisplayNames );
         OUString sComponentDisplayName;
         if ( aComponentDisplayNamesValue.getLength() && (aComponentDisplayNamesValue[0] >>= sComponentDisplayName) )
@@ -295,8 +295,8 @@ void ExtendedColorConfig_Impl::Load(const OUString& rScheme)
     } // if(!sScheme.getLength())
 
     m_sLoadedScheme = sScheme;
-    OUString sBase("ExtendedColorScheme/ColorSchemes/");
-    sBase += sScheme;
+    OUString sBase = "ExtendedColorScheme/ColorSchemes/"
+                   + sScheme;
 
     bool bFound = ExistsScheme(sScheme);
     if ( bFound )
@@ -335,8 +335,8 @@ void ExtendedColorConfig_Impl::FillComponentColors(uno::Sequence < OUString >& _
         OUString sComponentName = pIter->copy(pIter->lastIndexOf('/')+1);
         if ( m_aConfigValues.find(sComponentName) == m_aConfigValues.end() )
         {
-            OUString sEntry = *pIter;
-            sEntry += sColorEntries;
+            OUString sEntry = *pIter
+                            + sColorEntries;
 
             uno::Sequence < OUString > aColorNames = GetPropertyNames(sEntry);
             uno::Sequence < OUString > aDefaultColorNames = aColorNames;
@@ -411,25 +411,22 @@ void ExtendedColorConfig_Impl::ImplCommit()
         return;
     const OUString sColorEntries("Entries");
     const OUString sColor("/Color");
-    OUString sBase("ExtendedColorScheme/ColorSchemes/");
+    OUString sBase = "ExtendedColorScheme/ColorSchemes/"
+                   + m_sLoadedScheme;
     const OUString s_sSep("/");
-    sBase += m_sLoadedScheme;
 
     TComponents::iterator aIter = m_aConfigValues.begin();
     TComponents::iterator aEnd = m_aConfigValues.end();
     for( ;aIter != aEnd;++aIter )
     {
-        OUString sEntry = aIter->first;
-        sEntry += sColorEntries;
-
         if ( ConfigItem::AddNode(sBase, aIter->first) )
         {
-            OUString sNode = sBase;
-            sNode += s_sSep;
-            sNode += aIter->first;
+            OUString sNode = sBase
+                           + s_sSep
+                           + aIter->first
             //ConfigItem::AddNode(sNode, sColorEntries);
-            sNode += s_sSep;
-            sNode += sColorEntries;
+                           + s_sSep
+                           + sColorEntries;
 
             uno::Sequence < beans::PropertyValue > aPropValues(aIter->second.first.size());
             beans::PropertyValue* pPropValues = aPropValues.getArray();
diff --git a/svtools/source/config/itemholder2.cxx b/svtools/source/config/itemholder2.cxx
index bf6c4d1..080c70f 100644
--- a/svtools/source/config/itemholder2.cxx
+++ b/svtools/source/config/itemholder2.cxx
@@ -59,10 +59,10 @@ ItemHolder2::ItemHolder2()
         if(bMessage)
         {
             bMessage = false;
-            OString sMsg("CreateInstance with arguments exception: ");
-            sMsg += OString(rEx.Message.getStr(),
-                        rEx.Message.getLength(),
-                        RTL_TEXTENCODING_ASCII_US);
+            OString sMsg = "CreateInstance with arguments exception: "
+                         + OString(rEx.Message.getStr(),
+                                   rEx.Message.getLength(),
+                                   RTL_TEXTENCODING_ASCII_US);
             OSL_FAIL(sMsg.getStr());
         }
     }


More information about the Libreoffice-commits mailing list