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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Feb 13 06:38:56 UTC 2019


 svtools/source/config/extcolorcfg.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit f4a75a254dbc172e07cac18b7bb8edc965f378d7
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Sat Feb 9 18:11:32 2019 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Wed Feb 13 07:38:29 2019 +0100

    Avoid index for single getToken() call
    
    Change-Id: Ia95c9f78978c2299382ffdec603e44b06299549e
    Reviewed-on: https://gerrit.libreoffice.org/67625
    Tested-by: Jenkins
    Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>

diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx
index 9c5408111185..6f195039d4a1 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -243,8 +243,7 @@ void ExtendedColorConfig_Impl::Load(const OUString& rScheme)
         OUString sComponentDisplayName;
         if ( aComponentDisplayNamesValue.getLength() && (aComponentDisplayNamesValue[0] >>= sComponentDisplayName) )
         {
-            sal_Int32 nIndex = 0;
-            m_aComponentDisplayNames.emplace(componentName.getToken(1,'/',nIndex),sComponentDisplayName);
+            m_aComponentDisplayNames.emplace(componentName.getToken(1, '/'),sComponentDisplayName);
         }
 
         componentName += "/Entries";
@@ -347,8 +346,7 @@ void ExtendedColorConfig_Impl::FillComponentColors(uno::Sequence < OUString >& _
                     OUString sTemp = sName.copy(0,sName.lastIndexOf(sColor));
 
                     TDisplayNames::const_iterator aFind = _rDisplayNames.find(sTemp);
-                    nIndex = 0;
-                    sName = sName.getToken(2,'/',nIndex);
+                    sName = sName.getToken(2, '/');
                     OSL_ENSURE(aFind != _rDisplayNames.end(),"DisplayName is not in EntryNames config list!");
                     if ( aFind != _rDisplayNames.end() )
                         sDisplayName = aFind->second;


More information about the Libreoffice-commits mailing list