[Libreoffice-commits] core.git: 21 commits - basic/source cui/source dbaccess/source sfx2/source svx/source sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Nov 10 21:09:25 UTC 2018


 basic/source/classes/eventatt.cxx                     |    2 
 cui/source/customize/cfgutil.cxx                      |    2 
 dbaccess/source/core/misc/dsntypes.cxx                |    6 -
 dbaccess/source/ui/dlg/TextConnectionHelper.cxx       |   63 ++++++-----
 dbaccess/source/ui/querydesign/QueryDesignView.cxx    |    2 
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx |   20 ++-
 sfx2/source/appl/newhelp.cxx                          |   97 +++++-------------
 sfx2/source/bastyp/sfxhtml.cxx                        |    7 -
 svx/source/xml/xmlgrhlp.cxx                           |    4 
 sw/source/core/fields/cellfml.cxx                     |    2 
 sw/source/ui/misc/glossary.cxx                        |    7 -
 sw/source/uibase/app/appenv.cxx                       |    3 
 sw/source/uibase/uiview/view.cxx                      |    2 
 13 files changed, 95 insertions(+), 122 deletions(-)

New commits:
commit 41b09c0ed154aed0caf325a1ab0b7f7ffa688a35
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 22:05:20 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:11 2018 +0100

    Fix typo in comment
    
    Change-Id: I4a3614461740bc921ef99d71e2d057f5a17a75a9

diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index 72ac817d2341..290cb0543941 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -1060,7 +1060,7 @@ void SwTableFormula::SplitMergeBoxNm_( const SwTable& rTable, OUStringBuffer& rN
     const sal_Int32 nLastBoxLen = pTableNmBox->getLength();
     const sal_Int32 nSeparator = pTableNmBox->indexOf('.');
     if ( nSeparator>=0 &&
-        // If there are dots in the name, than these appear in pairs (e.g. A1.1.1)!
+        // If there are dots in the name, then these appear in pairs (e.g. A1.1.1)!
         (comphelper::string::getTokenCount(*pTableNmBox, '.') - 1) & 1 )
     {
         sTableNm = pTableNmBox->copy( 0, nSeparator );
commit 50a3b871c7d02d50a812ce9d532bcdbceef1f33d
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 22:01:39 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:11 2018 +0100

    Fix whitespaces
    
    Change-Id: I3d160c71ac4874a66f036e3d91910e00cf47836d

diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index f5aad359c771..8f0ac0a735b8 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -638,7 +638,8 @@ void IndexTabPage_Impl::InitializeIndex()
                             if ( (tmp = it->second++) != 0)
                                 m_pIndexCB->InsertEntry(aTempString + OUString(append, tmp));
                             else
-                                m_pIndexCB->InsertEntry(aTempString);                        }
+                                m_pIndexCB->InsertEntry(aTempString);
+                        }
                     }
                     else
                         aIndex.clear();
commit a1f1a640b65b2d0ff36155899f9c1dc2fc9381d8
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 21:59:02 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:10 2018 +0100

    Optimize OUStrings
    
    Change-Id: I67e8e9e2ecd7ec89d51bd9597b54be53c3203d46

diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 61f63cd3538f..f5aad359c771 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -312,9 +312,8 @@ void ContentListBox_Impl::dispose()
 
 void ContentListBox_Impl::InitRoot()
 {
-    OUString const aHelpTreeviewURL( "vnd.sun.star.hier://com.sun.star.help.TreeView/" );
     std::vector< OUString > aList =
-        SfxContentHelper::GetHelpTreeViewContents( aHelpTreeviewURL );
+        SfxContentHelper::GetHelpTreeViewContents( "vnd.sun.star.hier://com.sun.star.help.TreeView/" );
 
     for(const OUString & aRow : aList)
     {
@@ -350,9 +349,8 @@ void ContentListBox_Impl::RequestingChildren( SvTreeListEntry* pParent )
         {
             if ( pParent->GetUserData() )
             {
-                OUString aTmpURL( static_cast<ContentEntry_Impl*>(pParent->GetUserData())->aURL );
                 std::vector<OUString > aList =
-                    SfxContentHelper::GetHelpTreeViewContents( aTmpURL );
+                    SfxContentHelper::GetHelpTreeViewContents( static_cast<ContentEntry_Impl*>(pParent->GetUserData())->aURL );
 
                 for (const OUString & aRow : aList)
                 {
@@ -816,11 +814,10 @@ bool IndexTabPage_Impl::HasKeywordIgnoreCase()
     if ( !sKeyword.isEmpty() )
     {
         sal_Int32 nEntries = m_pIndexCB->GetEntryCount();
-        OUString sIndexItem;
         const vcl::I18nHelper& rI18nHelper = GetSettings().GetLocaleI18nHelper();
         for ( sal_Int32 n = 0; n < nEntries; n++)
         {
-            sIndexItem = m_pIndexCB->GetEntry( n );
+            const OUString sIndexItem {m_pIndexCB->GetEntry( n )};
             if (rI18nHelper.MatchString( sIndexItem, sKeyword ))
             {
                 sKeyword = sIndexItem;
@@ -1159,9 +1156,8 @@ void BookmarksBox_Impl::dispose()
     const sal_Int32 nCount = GetEntryCount();
     for ( sal_Int32 i = 0; i < nCount; ++i )
     {
-        OUString aTitle = GetEntry(i);
         OUString* pURL = static_cast<OUString*>(GetEntryData(i));
-        aHistOpt.AppendItem(eHELPBOOKMARKS, *pURL, "", aTitle, boost::none);
+        aHistOpt.AppendItem(eHELPBOOKMARKS, *pURL, "", GetEntry(i), boost::none);
         delete pURL;
     }
     ListBox::dispose();
@@ -1187,9 +1183,7 @@ void BookmarksBox_Impl::DoAction( sal_uInt16 nAction )
                 {
                     OUString* pURL = static_cast<OUString*>(GetEntryData( nPos ));
                     RemoveEntry( nPos );
-                    OUString aImageURL = IMAGE_URL;
-                    aImageURL += INetURLObject( *pURL ).GetHost();
-                    nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( INetURLObject(aImageURL) ) );
+                    nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( INetURLObject(IMAGE_URL+INetURLObject( *pURL ).GetHost()) ) );
                     SetEntryData( nPos, new OUString( *pURL ) );
                     SelectEntryPos( nPos );
                     delete pURL;
@@ -1336,8 +1330,7 @@ OUString BookmarksTabPage_Impl::GetSelectedEntry() const
 
 void BookmarksTabPage_Impl::AddBookmarks( const OUString& rTitle, const OUString& rURL )
 {
-    OUString aImageURL = IMAGE_URL;
-    aImageURL += INetURLObject( rURL ).GetHost();
+    const OUString aImageURL {IMAGE_URL + INetURLObject( rURL ).GetHost()};
     const sal_Int32 nPos = m_pBookmarksBox->InsertEntry( rTitle, SvFileInformationManager::GetImage( INetURLObject(aImageURL) ) );
     m_pBookmarksBox->SetEntryData( nPos, new OUString( rURL ) );
 }
@@ -1995,9 +1988,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox()
     sCurrentFactory = SfxHelp::GetCurrentModuleIdentifier();
 
     Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
-    OUString sPath( PATH_OFFICE_FACTORIES );
-    sPath += sCurrentFactory;
-    OUString sKey( KEY_HELP_ON_OPEN );
+    const OUString sPath { PATH_OFFICE_FACTORIES + sCurrentFactory };
 
     // Attention: This check boy knows two states:
     // 1) Reading of the config key fails with an exception or by getting an empty Any (!) => check box must be hidden
@@ -2011,7 +2002,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox()
             xContext, PACKAGE_SETUP, EConfigurationModes::Standard );
         if ( xConfiguration.is() )
         {
-            Any aAny = ConfigurationHelper::readRelativeKey( xConfiguration, sPath, sKey );
+            Any aAny = ConfigurationHelper::readRelativeKey( xConfiguration, sPath, KEY_HELP_ON_OPEN );
             if (aAny >>= bHelpAtStartup)
                 bHideBox = false;
         }
@@ -2031,10 +2022,9 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox()
         if ( xConfiguration.is() )
         {
             OUString sTemp;
-            sKey = KEY_UI_NAME;
             try
             {
-                Any aAny = ConfigurationHelper::readRelativeKey( xConfiguration, sPath, sKey );
+                Any aAny = ConfigurationHelper::readRelativeKey( xConfiguration, sPath, KEY_UI_NAME );
                 aAny >>= sTemp;
             }
             catch( Exception& )
@@ -2047,9 +2037,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox()
         if ( !sModuleName.isEmpty() )
         {
             // set module name in checkbox text
-            OUString sText( aOnStartupText );
-            sText = sText.replaceFirst( "%MODULENAME", sModuleName );
-            aOnStartupCB->SetText( sText );
+            aOnStartupCB->SetText( aOnStartupText.replaceFirst( "%MODULENAME", sModuleName ) );
             // and show it
             aOnStartupCB->Show();
             // set check state
@@ -2057,9 +2045,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox()
             aOnStartupCB->SaveValue();
 
             // calculate and set optimal width of the onstartup checkbox
-            OUString sCBText( "XXX" );
-            sCBText += aOnStartupCB->GetText();
-            long nTextWidth = aOnStartupCB->GetTextWidth( sCBText );
+            long nTextWidth = aOnStartupCB->GetTextWidth( "XXX" + aOnStartupCB->GetText() );
             Size aSize = aOnStartupCB->GetSizePixel();
             aSize.setWidth( nTextWidth );
             aOnStartupCB->SetSizePixel( aSize );
@@ -2167,8 +2153,7 @@ IMPL_LINK_NOARG(SfxHelpTextWindow_Impl, SelectHdl, Timer *, void)
                 if ( bIsFullWordSearch )
                     xSrchDesc->setPropertyValue( "SearchWords", makeAny( true ) );
 
-                OUString sSearchString = sfx2::PrepareSearchString( aSearchText, GetBreakIterator(), false );
-                xSrchDesc->setSearchString( sSearchString );
+                xSrchDesc->setSearchString( sfx2::PrepareSearchString( aSearchText, GetBreakIterator(), false ) );
                 Reference< XIndexAccess > xSelection = xSearchable->findAll( xSrchDesc );
 
                 // then select all found words
@@ -2205,7 +2190,6 @@ void SfxHelpTextWindow_Impl::FindHdl(sfx2::SearchDialog* pDlg)
     if ( bWrapAround )
         pDlg = m_xSrchDlg.get();
     DBG_ASSERT( pDlg, "invalid search dialog" );
-    OUString sSearchText = pDlg->GetSearchText();
     try
     {
         // select the words, which are equal to the search text of the search page
@@ -2221,7 +2205,7 @@ void SfxHelpTextWindow_Impl::FindHdl(sfx2::SearchDialog* pDlg)
                 xSrchDesc->setPropertyValue( "SearchWords", makeAny(pDlg->IsOnlyWholeWords()) );
                 xSrchDesc->setPropertyValue( "SearchCaseSensitive", makeAny(pDlg->IsMarchCase()) );
                 xSrchDesc->setPropertyValue( "SearchBackwards", makeAny(pDlg->IsSearchBackwards()) );
-                xSrchDesc->setSearchString( sSearchText );
+                xSrchDesc->setSearchString( pDlg->GetSearchText() );
                 Reference< XInterface > xSelection;
                 Reference< XTextRange > xCursor = getCursor();
 
@@ -2289,12 +2273,10 @@ IMPL_LINK( SfxHelpTextWindow_Impl, CheckHdl, Button*, pButton, void )
     if ( xConfiguration.is() )
     {
         bool bChecked = pBox->IsChecked();
-        OUString sPath( PATH_OFFICE_FACTORIES );
-        sPath += sCurrentFactory;
         try
         {
             ConfigurationHelper::writeRelativeKey(
-                xConfiguration, sPath, KEY_HELP_ON_OPEN, makeAny( bChecked ) );
+                xConfiguration, PATH_OFFICE_FACTORIES + sCurrentFactory, KEY_HELP_ON_OPEN, makeAny( bChecked ) );
             ConfigurationHelper::flush( xConfiguration );
         }
         catch( Exception& )
@@ -2716,12 +2698,10 @@ void SfxHelpWindow_Impl::LoadConfig()
     if ( aViewOpt.Exists() )
     {
         bIndex = aViewOpt.IsVisible();
-        OUString aUserData;
         Any aUserItem = aViewOpt.GetUserItem( USERITEM_NAME );
-        OUString aTemp;
-        if ( aUserItem >>= aTemp )
+        OUString aUserData;
+        if ( aUserItem >>= aUserData )
         {
-            aUserData = aTemp;
             DBG_ASSERT( comphelper::string::getTokenCount(aUserData, ';') == 6, "invalid user data" );
             sal_Int32 nIdx = 0;
             nIndexSize = aUserData.getToken( 0, ';', nIdx ).toInt32();
@@ -2760,20 +2740,15 @@ void SfxHelpWindow_Impl::SaveConfig()
     }
 
     aViewOpt.SetVisible( bIndex );
-    OUString aUserData = OUString::number( nIndexSize );
-    aUserData += ";";
-    aUserData += OUString::number( nTextSize );
-    aUserData += ";";
-    aUserData += OUString::number( nW );
-    aUserData += ";";
-    aUserData += OUString::number( nH );
 
     VclPtr<vcl::Window> pScreenWin = VCLUnoHelper::GetWindow( xWindow );
     aWinPos = pScreenWin->GetWindowExtentsRelative( nullptr ).TopLeft();
-    aUserData += ";";
-    aUserData += OUString::number( aWinPos.X() );
-    aUserData += ";";
-    aUserData += OUString::number( aWinPos.Y() );
+    const OUString aUserData = OUString::number( nIndexSize )
+        + ";" + OUString::number( nTextSize )
+        + ";" + OUString::number( nW )
+        + ";" + OUString::number( nH )
+        + ";" + OUString::number( aWinPos.X() )
+        + ";" + OUString::number( aWinPos.Y() );
 
     aViewOpt.SetUserItem( USERITEM_NAME, makeAny( aUserData ) );
 }
@@ -2781,10 +2756,7 @@ void SfxHelpWindow_Impl::SaveConfig()
 
 void SfxHelpWindow_Impl::ShowStartPage()
 {
-    OUString sHelpURL = SfxHelpWindow_Impl::buildHelpURL(pIndexWin->GetFactory(),
-                                                                "/start",
-                                                                OUString());
-    loadHelpContent(sHelpURL);
+    loadHelpContent(SfxHelpWindow_Impl::buildHelpURL(pIndexWin->GetFactory(), "/start", OUString()));
 }
 
 
@@ -2824,12 +2796,7 @@ IMPL_LINK_NOARG(SfxHelpWindow_Impl, OpenHdl, Control*, bool)
         else
             aId = aEntry;
 
-        aEntry  = "/";
-        aEntry += aId;
-
-        sHelpURL = SfxHelpWindow_Impl::buildHelpURL(pIndexWin->GetFactory(),
-                                                    aEntry,
-                                                    aAnchor);
+        sHelpURL = SfxHelpWindow_Impl::buildHelpURL(pIndexWin->GetFactory(), "/" + aId, aAnchor);
     }
 
     loadHelpContent(sHelpURL);
@@ -2843,11 +2810,9 @@ IMPL_LINK( SfxHelpWindow_Impl, SelectFactoryHdl, SfxHelpIndexWindow_Impl* , pWin
     if ( sTitle.isEmpty() )
         sTitle = GetParent()->GetText();
 
-    OUString aNewTitle = sTitle + " - " + pIndexWin->GetActiveFactoryTitle();
-
     Reference< XTitle > xTitle(xFrame, UNO_QUERY);
     if (xTitle.is ())
-        xTitle->setTitle (aNewTitle);
+        xTitle->setTitle(sTitle + " - " + pIndexWin->GetActiveFactoryTitle());
 
     if ( pWin )
         ShowStartPage();
@@ -3090,13 +3055,11 @@ void SfxHelpWindow_Impl::DoAction( sal_uInt16 nActionId )
                         OUString aValue;
                         if ( aAny >>= aValue )
                         {
-                            OUString aTitle(aValue);
                             SfxAddHelpBookmarkDialog_Impl aDlg(GetFrameWeld(), false);
-                            aDlg.SetTitle(aTitle);
+                            aDlg.SetTitle(aValue);
                             if (aDlg.run() == RET_OK )
                             {
-                                aTitle = aDlg.GetTitle();
-                                pIndexWin->AddBookmarks( aTitle, aURL );
+                                pIndexWin->AddBookmarks( aDlg.GetTitle(), aURL );
                             }
                         }
                     }
commit 4ede22cf97879e71a6df0eeaea128752844835e0
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 20:32:23 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:10 2018 +0100

    Avoid getTokenCount
    
    Change-Id: If4dcd0a3f316bd9812ffb12b8e64489d25ce89ca

diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 06e82ae4ec4e..8d2fa256bbb1 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -2607,11 +2607,14 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef const & _pEntry)
                 m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(1, ';', nIdx)); // 2nd token: COUNT
             else
             {
-                sal_Int32 nCount = comphelper::string::getTokenCount(m_aFunctionStrings, ';');
-                if ( _pEntry->isNumeric() )
-                    --nCount;
-                for( sal_Int32 nTok = 1; nTok < nCount; ++nTok )
-                    m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(0, ';', nIdx));
+                const bool bSkipLastToken {_pEntry->isNumeric()};
+                while (nIdx>0)
+                {
+                    const OUString sTok {m_aFunctionStrings.getToken(0, ';', nIdx)};
+                    if (bSkipLastToken && nIdx<0)
+                        break;
+                    m_pFunctionCell->InsertEntry(sTok);
+                }
             }
 
             if ( _pEntry->IsGroupBy() )
commit a8f78db2d8114f80b9a4b6614a7f466b66b62dd8
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 20:29:42 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:09 2018 +0100

    Use indexed getToken
    
    Change-Id: I336924c43b6680c3742ca8c83801cbff3f346968

diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index e62fdceaa065..06e82ae4ec4e 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -2599,18 +2599,19 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef const & _pEntry)
         // Aggregate functions in general only available with Core SQL
         if ( lcl_SupportsCoreSQLGrammar(xConnection) )
         {
+            sal_Int32 nIdx {0};
             // if we have an asterisk, no other function than count is allowed
             m_pFunctionCell->Clear();
-            m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(0, ';'));
+            m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(0, ';', nIdx));
             if ( isFieldNameAsterisk(_pEntry->GetField()) )
-                m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(2, ';')); // 2 -> COUNT
+                m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(1, ';', nIdx)); // 2nd token: COUNT
             else
             {
                 sal_Int32 nCount = comphelper::string::getTokenCount(m_aFunctionStrings, ';');
                 if ( _pEntry->isNumeric() )
                     --nCount;
-                for( sal_Int32 nIdx = 1; nIdx < nCount; nIdx++ )
-                    m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(nIdx, ';'));
+                for( sal_Int32 nTok = 1; nTok < nCount; ++nTok )
+                    m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(0, ';', nIdx));
             }
 
             if ( _pEntry->IsGroupBy() )
commit 3e10b9b8dfafdc80f1b77769a18dea8dbf1af0eb
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 20:23:37 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:09 2018 +0100

    Avoid getToken to just get last token
    
    Change-Id: I74669145a1341ff2a715cdec32676dfdd290d1f3

diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index 28de7a44640d..644aa6e526cd 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -209,7 +209,7 @@ void ODsnTypeCollection::extractHostNamePort(const OUString& _rDsn,OUString& _sD
         }
         if ( !_rsHostname.isEmpty() )
             _rsHostname = _rsHostname.copy(_rsHostname.lastIndexOf('@')+1);
-        _sDatabaseName = sUrl.getToken(nUrlTokens - 1, ':');
+        _sDatabaseName = sUrl.copy(sUrl.lastIndexOf(':')+1);
     }
     else if ( _rDsn.startsWithIgnoreAsciiCase("sdbc:address:ldap:") )
     {
@@ -223,7 +223,7 @@ void ODsnTypeCollection::extractHostNamePort(const OUString& _rDsn,OUString& _sD
         const sal_Int32 nUrlTokens {comphelper::string::getTokenCount(sUrl, '/')};
         if ( _nPortNumber == -1 && _rsHostname.isEmpty() && nUrlTokens == 2 )
             _rsHostname = sUrl.getToken(0,'/');
-        _sDatabaseName = sUrl.getToken(nUrlTokens - 1, '/');
+        _sDatabaseName = sUrl.copy(sUrl.lastIndexOf('/')+1);
     }
     else if ( _rDsn.startsWithIgnoreAsciiCase("sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=")
            || _rDsn.startsWithIgnoreAsciiCase("sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=") )
commit 9c4659266de6368adb50864e86cccbda50207a62
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 20:20:29 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:08 2018 +0100

    Avoid getToken to just get last token
    
    Change-Id: I56aa03bd727b8cdea38de7948a4dad4532ee214c

diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index e906b3e40128..50ee47fdaba9 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -1077,7 +1077,7 @@ void SfxConfigGroupListBox::SelectMacro( const OUString& rBasic,
 {
     const OUString aBasicName(rBasic + " " + xImp->m_sMacros);
     const sal_Int32 nCount = comphelper::string::getTokenCount(rMacro, '.');
-    const OUString aMethod( rMacro.getToken( nCount-1, '.' ) );
+    const OUString aMethod( rMacro.copy(rMacro.lastIndexOf('.')+1) );
     OUString aLib;
     OUString aModule;
     if ( nCount > 2 )
commit 94f79b3bf11a16d3fd020ed98bd5d17147520a67
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 20:17:46 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:08 2018 +0100

    Remove unneeded cast
    
    Change-Id: I04279faaf11bd1249bcea0d07d60facefb5186d8

diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 8524d0470674..313d4a9f9ae1 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -186,7 +186,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any
         if( comphelper::string::getTokenCount(aMacro, '.') == 3 )
         {
             sal_Int32 nLast = 0;
-            OUString aFullLibName = aMacro.getToken( sal_Int32(0), '.', nLast );
+            OUString aFullLibName = aMacro.getToken( 0, '.', nLast );
 
             sal_Int32 nIndex = aFullLibName.indexOf( ':' );
             if (nIndex >= 0)
commit 90f2d688ecfb6c7daf21bc202d2c87ba2531a7b8
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 20:01:33 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:08 2018 +0100

    Take advantage of already calculated index
    
    Change-Id: I6c367b00024e96aa4eef5490b3b296617851016f

diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 2accd6aabc29..61f63cd3538f 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1034,8 +1034,7 @@ IMPL_LINK_NOARG(SearchTabPage_Impl, SearchHdl, LinkParamNone*, void)
         {
             sal_Int32 nIdx = 0;
             OUString aTitle = rRow.getToken( 0, '\t', nIdx );
-            nIdx = 0;
-            OUString* pURL = new OUString( rRow.getToken( 2, '\t', nIdx ) );
+            OUString* pURL = new OUString( rRow.getToken( 1, '\t', nIdx ) );
             const sal_Int32 nPos = m_pResultsLB->InsertEntry( aTitle );
             m_pResultsLB->SetEntryData( nPos, pURL );
         }
commit 2206aaa72cc678ab3f04ad318dc5049f580c8d09
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 19:54:57 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:07 2018 +0100

    Loop only if string length is the desired one
    
    Change-Id: I5e03fceb83a22b590a62b605c4ada279b937730a

diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index 55c8e227eebb..6abb1cddb698 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -389,19 +389,21 @@ namespace dbaui
 
     void OTextConnectionHelper::SetSeparator( weld::ComboBox& rBox, const OUString& rList, const OUString& rVal )
     {
-        for(sal_Int32 nIdx {0}; nIdx>=0;)
+        if (rVal.getLength()==1)
         {
-            sal_Int32 nPrevIdx {nIdx};
-            OUString sTVal {static_cast< sal_Unicode >( rList.getToken(1, '\t', nIdx).toInt32() )};
-
-            if( sTVal == rVal )
+            const sal_Unicode nVal {rVal[0]};
+            for(sal_Int32 nIdx {0}; nIdx>=0;)
             {
-                rBox.set_entry_text(rList.getToken(0, '\t', nPrevIdx));
-                return;
+                sal_Int32 nPrevIdx {nIdx};
+                if (static_cast<sal_Unicode>(rList.getToken(1, '\t', nIdx).toInt32()) == nVal)
+                {
+                    rBox.set_entry_text(rList.getToken(0, '\t', nPrevIdx));
+                    return;
+                }
             }
+            rBox.set_entry_text( rVal );
         }
-
-        if ( m_xTextSeparator.get() == &rBox && rVal.isEmpty() )
+        else if ( m_xTextSeparator.get() == &rBox && rVal.isEmpty() )
             rBox.set_entry_text(m_aTextNone);
         else
             rBox.set_entry_text(rVal.copy(0, 1));
commit 5b5b58186eb197aac3898580317581dbabd71bdd
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 19:23:16 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:07 2018 +0100

    Avoid getTokenCount()
    
    Change-Id: Ifc509b3c31f6dbfd4d620aa451fd85b82b0ddb90

diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index f57b34d352b6..55c8e227eebb 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -389,18 +389,14 @@ namespace dbaui
 
     void OTextConnectionHelper::SetSeparator( weld::ComboBox& rBox, const OUString& rList, const OUString& rVal )
     {
-        char    nTok = '\t';
-        sal_Int32   nCnt = comphelper::string::getTokenCount(rList, nTok);
-        sal_Int32 i;
-
-        for( i=0 ; i<nCnt ; i+=2 )
+        for(sal_Int32 nIdx {0}; nIdx>=0;)
         {
-            OUString  sTVal(
-                static_cast< sal_Unicode >( rList.getToken( (i+1), nTok ).toInt32() ));
+            sal_Int32 nPrevIdx {nIdx};
+            OUString sTVal {static_cast< sal_Unicode >( rList.getToken(1, '\t', nIdx).toInt32() )};
 
             if( sTVal == rVal )
             {
-                rBox.set_entry_text(rList.getToken(i, nTok));
+                rBox.set_entry_text(rList.getToken(0, '\t', nPrevIdx));
                 return;
             }
         }
commit 71ef91f00d621b5ddc76d6611eb91bb8b0c26c97
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 19:15:26 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:06 2018 +0100

    Early bailout
    
    Change-Id: I0ffcbbfe2380755ff21532b314961c317ce0c69d

diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index 22f3bd5c5eff..f57b34d352b6 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -401,17 +401,14 @@ namespace dbaui
             if( sTVal == rVal )
             {
                 rBox.set_entry_text(rList.getToken(i, nTok));
-                break;
+                return;
             }
         }
 
-        if ( i >= nCnt )
-        {
-            if ( m_xTextSeparator.get() == &rBox && rVal.isEmpty() )
-                rBox.set_entry_text(m_aTextNone);
-            else
-                rBox.set_entry_text(rVal.copy(0, 1));
-        }
+        if ( m_xTextSeparator.get() == &rBox && rVal.isEmpty() )
+            rBox.set_entry_text(m_aTextNone);
+        else
+            rBox.set_entry_text(rVal.copy(0, 1));
     }
 }
 
commit 9d2bf6f6d62c8e99b2bffe45d2d9aa05f29d625e
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 19:10:55 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:06 2018 +0100

    Avoid getTokenCount()
    
    Change-Id: Ia71e4822ce863a296c7c0eb137c164538f9a0d27

diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index 1c8051852a91..22f3bd5c5eff 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -51,8 +51,26 @@
 #include <unotools/pathoptions.hxx>
 #include <svtools/roadmapwizard.hxx>
 
+namespace
+{
+
+OUString lcl_getListEntry(const OUString& rStr, sal_Int32& rIdx)
+{
+    const OUString sTkn {rStr.getToken( 0, '\t', rIdx )};
+    if (rIdx>=0)
+    {
+        rIdx = rStr.indexOf('\t', rIdx);
+        if (rIdx>=0 && ++rIdx>=rStr.getLength())
+            rIdx = -1;
+    }
+    return sTkn;
+}
+
+}
+
 namespace dbaui
 {
+
     OTextConnectionHelper::OTextConnectionHelper(weld::Widget* pParent, const short _nAvailableSections)
         : m_aFieldSeparatorList      (DBA_RES(STR_AUTOFIELDSEPARATORLIST))
         , m_aTextSeparatorList       (STR_AUTOTEXTSEPARATORLIST)
@@ -80,15 +98,11 @@ namespace dbaui
         , m_xCharSetLabel(m_xBuilder->weld_label("charsetlabel"))
         , m_xCharSet(new CharSetListBox(m_xBuilder->weld_combo_box("charset")))
     {
-        sal_Int32 nCnt = comphelper::string::getTokenCount(m_aFieldSeparatorList, '\t');
-        sal_Int32 i;
-
-        for( i = 0 ; i < nCnt ; i += 2 )
-            m_xFieldSeparator->append_text( m_aFieldSeparatorList.getToken( i, '\t' ) );
+        for(sal_Int32 nIdx {0}; nIdx>=0;)
+            m_xFieldSeparator->append_text( lcl_getListEntry(m_aFieldSeparatorList, nIdx) );
 
-        nCnt = comphelper::string::getTokenCount(m_aTextSeparatorList, '\t');
-        for( i=0 ; i<nCnt ; i+=2 )
-            m_xTextSeparator->append_text( m_aTextSeparatorList.getToken( i, '\t' ) );
+        for(sal_Int32 nIdx {0}; nIdx>=0;)
+            m_xTextSeparator->append_text( lcl_getListEntry(m_aTextSeparatorList, nIdx) );
         m_xTextSeparator->append_text(m_aTextNone);
 
         m_xOwnExtension->connect_changed(LINK(this, OTextConnectionHelper, OnEditModified));
commit 030c27a0f35ad1515d22c386b2a343c4de1760df
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Fri Nov 9 19:04:10 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:06 2018 +0100

    Avoid temporary (that introduces downcast)
    
    Change-Id: I810172d045860f49819b9e25de8a2d5fe5f80dd8

diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx
index fe03e3793423..8815f6a97ee2 100644
--- a/sw/source/uibase/app/appenv.cxx
+++ b/sw/source/uibase/app/appenv.cxx
@@ -109,8 +109,7 @@ OUString InsertLabEnvText( SwWrtShell& rSh, SwFieldMgr& rFieldMgr, const OUStrin
 
                     // Database fields must contain at least 3 points!
                     OUString sDBName( sTmpText.copy( 1, sTmpText.getLength() - 2));
-                    sal_uInt16 nCnt = comphelper::string::getTokenCount(sDBName, '.');
-                    if (nCnt >= 3)
+                    if (comphelper::string::getTokenCount(sDBName, '.') >= 3)
                     {
                         sDBName = ::ReplacePoint(sDBName, true);
                         SwInsertField_Data aData(TYP_DBFLD, 0, sDBName, aEmptyOUStr, 0, &rSh );
commit 27f5860966f215da4d98c9af02e7f59d07809786
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Wed Nov 7 23:41:21 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:05 2018 +0100

    Use indexOf instead of getTokenCount for simple check
    
    Change-Id: I0a0068649fd688f311e1ba4865a51406c4ffd672

diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 8be9777c3311..046e851183c0 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -2923,7 +2923,7 @@ OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(const OTableFieldDesc
         if ( sFunction.isEmpty() )
             sFunction = pEntry->GetField();
 
-        if (comphelper::string::getTokenCount(sFunction, '(') > 1)
+        if (sFunction.indexOf('(')>=0) // sFunctions has at least 2 tokens
             sFunction = sFunction.getToken(0,'('); // this should be the name of the function
 
         sal_Int32 nType = ::connectivity::OSQLParser::getFunctionReturnType(sFunction,&rParser.getContext());
commit 1f2317b130d62614b10115527a4cbcfd0c8c3896
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Wed Nov 7 23:36:34 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:05 2018 +0100

    Use indexOf instead of getTokenCount for simple check
    
    Change-Id: Ic5397601267f1953379a13a3e1ac69813d363045

diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 39b1cb7081b3..2e048d72e617 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1160,7 +1160,7 @@ static bool lcl_IsOwnDocument( SwView& rView )
 
 void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
 {
-    if ( comphelper::string::getTokenCount(rUserData, ';') > 1 &&
+    if ( rUserData.indexOf(';')>=0 && // more than one token
         // For document without layout only in the onlinelayout or
         // while forward/backward
          (!m_pWrtShell->IsNewLayout() || m_pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse) )
commit ff7d968bd7c0d697ae23b9954918dbec1b641cd4
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Wed Nov 7 23:32:44 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:04 2018 +0100

    Avoid getTokenCount()
    
    Change-Id: I769660ab1832e76ed7ac272d0d2c973d14171c06

diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 9a5b7a4c6127..266739d03d8d 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -37,7 +37,6 @@
 #include <unocrsr.hxx>
 #include <unotools.hxx>
 #include <comphelper/processfactory.hxx>
-#include <comphelper/string.hxx>
 #include <ucbhelper/content.hxx>
 #include <com/sun/star/text/AutoTextContainer.hpp>
 #include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
@@ -606,12 +605,12 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl, Button*, void)
         //check if at least one glossary path is write enabled
         SvtPathOptions aPathOpt;
         const OUString& sGlosPath( aPathOpt.GetAutoTextPath() );
-        const sal_Int32 nPaths = comphelper::string::getTokenCount(sGlosPath, ';');
         bool bIsWritable = false;
-        for(sal_Int32 nPath = 0; nPath < nPaths; nPath++)
+        sal_Int32 nIdx {sGlosPath.isEmpty() ? -1 : 0};
+        while (nIdx>=0)
         {
             const OUString sPath = URIHelper::SmartRel2Abs(
-                INetURLObject(), sGlosPath.getToken(nPath, ';'),
+                INetURLObject(), sGlosPath.getToken(0, ';', nIdx),
                 URIHelper::GetMaybeFileHdl());
             try
             {
commit be6e05e8cc707ade764067e7c1f57828e547452b
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Wed Nov 7 23:29:47 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:04 2018 +0100

    Avoid getTokenCount() to check for single token
    
    Change-Id: Ic72837cbb345a26faf3fd7cbf8739ddb6dc76cf9

diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 27341ecd171d..05f8df8d72c3 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -20,7 +20,6 @@
 #include <sal/config.h>
 #include <sal/log.hxx>
 
-#include <comphelper/string.hxx>
 #include <sal/macros.h>
 #include <com/sun/star/embed/XTransactedObject.hpp>
 #include <com/sun/star/embed/ElementModes.hpp>
@@ -56,6 +55,7 @@ using namespace com::sun::star;
 using namespace com::sun::star::uno;
 using namespace com::sun::star::io;
 
+namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } } } }
 
 #define XML_GRAPHICSTORAGE_NAME     "Pictures"
 #define XML_GRAPHICOBJECT_URL_BASE  "vnd.sun.star.GraphicObject:"
@@ -396,7 +396,7 @@ bool SvXMLGraphicHelper::ImplGetStreamNames( const OUString& rURLStr,
 
     const OUString aURLStr {rURLStr.copy(rURLStr.lastIndexOf(':')+1)};
 
-    if( comphelper::string::getTokenCount(aURLStr, '/') == 1 )
+    if( !aURLStr.isEmpty() && aURLStr.indexOf('/')<0 ) // just one token?
     {
         rPictureStorageName = XML_GRAPHICSTORAGE_NAME;
         rPictureStreamName = aURLStr;
commit 81b507808baab2274e35f4602ebecf0913e81a74
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Wed Nov 7 22:45:56 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:04 2018 +0100

    Use already available start index of substring
    
    Change-Id: Ibaa2835e73dc42a7296e4749fdfbd05e282e04eb

diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index fc418a93d42a..f91bd5e59de2 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -324,10 +324,9 @@ double SfxHTMLParser::GetTableDataOptionsValNum( sal_uInt32& nNumForm,
     (void)rFormatter.IsNumberFormat(aValStr, nParseForm, fVal);
     if ( comphelper::string::getTokenCount(aNumStr, ';') > 2 )
     {
-        eNumLang = LanguageType(aNumStr.getToken( 1, ';' ).toInt32());
-        sal_Int32 nPos = aNumStr.indexOf( ';' );
-        nPos = aNumStr.indexOf( ';', nPos + 1 );
-        OUString aFormat( aNumStr.copy( nPos + 1 ) );
+        sal_Int32 nIdx {0};
+        eNumLang = LanguageType(aNumStr.getToken( 1, ';', nIdx ).toInt32());
+        OUString aFormat( aNumStr.copy( nIdx ) );
         sal_Int32 nCheckPos;
         SvNumFormatType nType;
         if ( eNumLang != LANGUAGE_SYSTEM )
commit e0c656aa3f6a1bb0783e059ad649c8a55edefc4b
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Wed Nov 7 22:28:55 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:03 2018 +0100

    Fix double ;
    
    Change-Id: I8009565c5ae2580d0cdbf3b323b95d61c25c0dcd

diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 97874d5f0c59..e62fdceaa065 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -185,7 +185,7 @@ void OSelectionBrowseBox::initialize()
             ,IParseContext::InternationalKeyCode::Intersection
         };
 
-        OUString sGroup = m_aFunctionStrings.copy(m_aFunctionStrings.lastIndexOf(';')+1);;
+        OUString sGroup = m_aFunctionStrings.copy(m_aFunctionStrings.lastIndexOf(';')+1);
         m_aFunctionStrings = m_aFunctionStrings.getToken(0, ';');
 
         for (IParseContext::InternationalKeyCode eFunction : eFunctions)
commit c6665a1afef58e99d56b07a776964445689c22ca
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Wed Nov 7 22:26:47 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Nov 10 22:04:03 2018 +0100

    Avoid getTokenCount()
    
    Change-Id: I1f6468e1050924b0c6f6971ad6276932a3c91f75

diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index a3ba367f4f9a..28de7a44640d 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -208,7 +208,7 @@ void ODsnTypeCollection::extractHostNamePort(const OUString& _rDsn,OUString& _sD
             _rsHostname = sUrl.getToken(0,':');
         }
         if ( !_rsHostname.isEmpty() )
-            _rsHostname = _rsHostname.getToken(comphelper::string::getTokenCount(_rsHostname, '@') - 1, '@');
+            _rsHostname = _rsHostname.copy(_rsHostname.lastIndexOf('@')+1);
         _sDatabaseName = sUrl.getToken(nUrlTokens - 1, ':');
     }
     else if ( _rDsn.startsWithIgnoreAsciiCase("sdbc:address:ldap:") )


More information about the Libreoffice-commits mailing list