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

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


 sfx2/source/appl/newhelp.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit f528ad715834d4ffb0c762f7af9c19d5dce2dadd
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Sun Feb 10 16:03:12 2019 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Wed Feb 13 07:54:35 2019 +0100

    Take advantage of indexed getToken()
    
    Change-Id: Iac7b4caf58706e153981be7994cba1929520f44c
    Reviewed-on: https://gerrit.libreoffice.org/67636
    Tested-by: Jenkins
    Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>

diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 0035877b1bff..d4e774b1f775 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1472,9 +1472,8 @@ void SfxHelpIndexWindow_Impl::Initialize()
     for (const OUString & rRow : aFactories)
     {
         sal_Int32 nIdx = 0;
-        OUString aTitle = rRow.getToken( 0, '\t', nIdx );
-        nIdx = 0;
-        OUString aURL = rRow.getToken( 2, '\t', nIdx );
+        OUString aTitle = rRow.getToken( 0, '\t', nIdx ); // token 0
+        OUString aURL = rRow.getToken( 1, '\t', nIdx ); // token 2
         OUString* pFactory = new OUString( INetURLObject( aURL ).GetHost() );
         const sal_Int32 nPos = m_pActiveLB->InsertEntry( aTitle );
         m_pActiveLB->SetEntryData( nPos, pFactory );
@@ -2794,8 +2793,9 @@ IMPL_LINK_NOARG(SfxHelpWindow_Impl, OpenHdl, Control*, bool)
         OUString aAnchor = OUString('#');
         if ( comphelper::string::getTokenCount(aEntry, '#') == 2 )
         {
-            aId = aEntry.getToken( 0, '#' );
-            aAnchor += aEntry.getToken( 1, '#' );
+            sal_Int32 nIdx{ 0 };
+            aId = aEntry.getToken( 0, '#', nIdx );
+            aAnchor += aEntry.getToken( 0, '#', nIdx );
         }
         else
             aId = aEntry;


More information about the Libreoffice-commits mailing list