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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 28 16:04:21 UTC 2018


 connectivity/source/drivers/hsqldb/HDriver.cxx |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 86daabed8b36820e6c6e3a48f8221aadec2c81a3
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Sun Dec 9 21:26:59 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Fri Dec 28 17:03:58 2018 +0100

    Use indexed getToken()
    
    Change-Id: I30c4a26a5873beca4c0ba88040174dd7b6b8ece4
    Reviewed-on: https://gerrit.libreoffice.org/65671
    Tested-by: Jenkins
    Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>

diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index be2d1040c8dc..a6ee1e714b62 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -266,8 +266,9 @@ namespace connectivity
                                 {
                                     if ( sLine.isEmpty() )
                                         continue;
-                                    const OString sIniKey = sLine.getToken(0, '=');
-                                    const OString sValue = sLine.getToken(1, '=');
+                                    sal_Int32 nIdx {0};
+                                    const OString sIniKey = sLine.getToken(0, '=', nIdx);
+                                    const OString sValue = sLine.getToken(0, '=', nIdx);
                                     if( sIniKey == "hsqldb.compatible_version" )
                                     {
                                         sVersionString = sValue;
@@ -282,9 +283,10 @@ namespace connectivity
                                 }
                                 if (!sVersionString.isEmpty())
                                 {
-                                    const sal_Int32 nMajor = sVersionString.getToken(0, '.').toInt32();
-                                    const sal_Int32 nMinor = sVersionString.getToken(1, '.').toInt32();
-                                    const sal_Int32 nMicro = sVersionString.getToken(2, '.').toInt32();
+                                    sal_Int32 nIdx {0};
+                                    const sal_Int32 nMajor = sVersionString.getToken(0, '.', nIdx).toInt32();
+                                    const sal_Int32 nMinor = sVersionString.getToken(0, '.', nIdx).toInt32();
+                                    const sal_Int32 nMicro = sVersionString.getToken(0, '.', nIdx).toInt32();
                                     if (     nMajor > 1
                                         || ( nMajor == 1 && nMinor > 8 )
                                         || ( nMajor == 1 && nMinor == 8 && nMicro > 0 ) )


More information about the Libreoffice-commits mailing list