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

Michael Stahl mstahl at redhat.com
Fri Feb 22 08:20:27 PST 2013


 dbaccess/source/core/misc/dsntypes.cxx |   26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

New commits:
commit 5677e3f2514d5b797c239d99edce0189d5cf364b
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Feb 22 17:15:16 2013 +0100

    fix strings more in 1da3af5f1eb6a32fd0ab10da7cf2f8ddb298a3a1
    
    Change-Id: I7d4cf698721fcf972bf35babb6d53369719eed18

diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index 29ac584..e9c48e2 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -337,19 +337,21 @@ ODsnTypeCollection::TypeIterator ODsnTypeCollection::end() const
 DATASOURCE_TYPE ODsnTypeCollection::determineType(const OUString& _rDsn) const
 {
     OUString sDsn(comphelper::string::stripEnd(_rDsn, '*'));
-    sal_uInt16 nSeparator = sDsn.indexOf((sal_Unicode)':');
-    if (STRING_NOTFOUND == nSeparator)
+    sal_Int32 nSeparator = sDsn.indexOf(static_cast<sal_Unicode>(':'));
+    if (-1 == nSeparator)
     {
         // there should be at least one such separator
         OSL_FAIL("ODsnTypeCollection::implDetermineType : missing the colon !");
         return DST_UNKNOWN;
     }
     // find first :
-    sal_uInt16 nOracleSeparator = sDsn.indexOf((sal_Unicode)':', nSeparator + 1);
-    if ( nOracleSeparator != STRING_NOTFOUND )
+    sal_Int32 nOracleSeparator =
+        sDsn.indexOf(static_cast<sal_Unicode>(':'), nSeparator + 1);
+    if (-1 != nOracleSeparator)
     {
-        nOracleSeparator = sDsn.indexOf((sal_Unicode)':', nOracleSeparator + 1);
-        if (nOracleSeparator != STRING_NOTFOUND && sDsn.equalsIgnoreAsciiCaseAsciiL("jdbc:oracle:thin", nOracleSeparator))
+        nOracleSeparator =
+            sDsn.indexOf(static_cast<sal_Unicode>(':'), nOracleSeparator + 1);
+        if (-1 != nOracleSeparator && sDsn.equalsIgnoreAsciiCaseAsciiL("jdbc:oracle:thin", nOracleSeparator))
             return DST_ORACLE_JDBC;
     }
 
@@ -360,8 +362,8 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const OUString& _rDsn) const
         return DST_EMBEDDED_HSQLDB;
 
     // find second :
-    nSeparator = sDsn.indexOf((sal_Unicode)':', nSeparator + 1);
-    if (STRING_NOTFOUND == nSeparator)
+    nSeparator = sDsn.indexOf(static_cast<sal_Unicode>(':'), nSeparator + 1);
+    if (-1 == nSeparator)
     {
         // at the moment only jdbc is allowed to have just one separator
         OSL_FAIL("ODsnTypeCollection::implDetermineType : missing the second colon !");
@@ -370,11 +372,11 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const OUString& _rDsn) const
 
     if (sDsn.equalsIgnoreAsciiCaseAsciiL("sdbc:ado:", nSeparator))
     {
-        nSeparator = sDsn.indexOf((sal_Unicode)':', nSeparator + 1);
-        if (STRING_NOTFOUND != nSeparator && sDsn.equalsIgnoreAsciiCaseAsciiL("sdbc:ado:access", nSeparator) )
+        nSeparator = sDsn.indexOf(static_cast<sal_Unicode>(':'), nSeparator + 1);
+        if (-1 != nSeparator && sDsn.equalsIgnoreAsciiCaseAsciiL("sdbc:ado:access", nSeparator) )
         {
-            nSeparator = sDsn.indexOf((sal_Unicode)';', nSeparator + 1);
-            if (STRING_NOTFOUND != nSeparator && sDsn.equalsIgnoreAsciiCaseAsciiL("sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0", nSeparator) )
+            nSeparator = sDsn.indexOf(static_cast<sal_Unicode>(';'), nSeparator + 1);
+            if (-1 != nSeparator && sDsn.equalsIgnoreAsciiCaseAsciiL("sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0", nSeparator) )
                 return DST_MSACCESS_2007;
 
             return DST_MSACCESS;


More information about the Libreoffice-commits mailing list