summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-02-22 17:15:16 +0100
committerMichael Stahl <mstahl@redhat.com>2013-02-22 17:18:29 +0100
commit5677e3f2514d5b797c239d99edce0189d5cf364b (patch)
tree5c567809192b848a8b4c28027e575959ab715398 /dbaccess
parent5f3dacaeef60bec80689ed7b529b3c8bf7823139 (diff)
Change-Id: I7d4cf698721fcf972bf35babb6d53369719eed18
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/misc/dsntypes.cxx26
1 files changed, 14 insertions, 12 deletions
diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index 29ac5847ca5b..e9c48e2b81d0 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;