diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-11-09 20:23:37 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-11-10 22:04:09 +0100 |
commit | 3e10b9b8dfafdc80f1b77769a18dea8dbf1af0eb (patch) | |
tree | 50d87184552b02b1ee50498955eee44b5b66240f /dbaccess/source | |
parent | 9c4659266de6368adb50864e86cccbda50207a62 (diff) |
Avoid getToken to just get last token
Change-Id: I74669145a1341ff2a715cdec32676dfdd290d1f3
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/core/misc/dsntypes.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
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=") ) |