From b7bf1ba2136b3d1e031673e7b541c6181e95ff61 Mon Sep 17 00:00:00 2001 From: Gökhan Gurbetoğlu Date: Wed, 24 Aug 2016 17:41:12 +0300 Subject: 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 Reviewed-by: Michael Stahl --- svtools/source/config/extcolorcfg.cxx | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'svtools/source/config/extcolorcfg.cxx') diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx index 381767f889ac..2267f3efeeb3 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(); -- cgit