diff options
author | Jens Carl <j.carl43@gmx.de> | 2019-05-11 10:30:57 -0700 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-05-14 10:24:47 +0200 |
commit | 19573d94074a3ce296bacf35a21242ff8b75cad4 (patch) | |
tree | 98cd7f6366b836deca57a83a3493bf04b9b334d4 /connectivity | |
parent | 17ecffa91065f453b0799dcc869901f2ecde09dd (diff) |
tdf#43157 Clean up OSL_VERIFY (replace with SAL_WARN)
Replace OSL_VERIFY with if-statement and SAL_WARN.
Change-Id: Icf6a0b81aca489b25520c9f6837d1b482179cad5
Reviewed-on: https://gerrit.libreoffice.org/72155
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/odbc/OConnection.cxx | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx index b385538d8da0..f024e156c597 100644 --- a/connectivity/source/drivers/odbc/OConnection.cxx +++ b/connectivity/source/drivers/odbc/OConnection.cxx @@ -31,6 +31,8 @@ #include <connectivity/FValue.hxx> #include <connectivity/dbexception.hxx> +#include <sal/log.hxx> + #include <string.h> using namespace connectivity::odbc; @@ -185,49 +187,68 @@ SQLRETURN OConnection::Construct(const OUString& url,const Sequence< PropertyVal for(;pBegin != pEnd;++pBegin) { if( pBegin->Name == "Timeout") - OSL_VERIFY( pBegin->Value >>= nTimeout ); + { + if( ! (pBegin->Value >>= nTimeout) ) + SAL_WARN("connectivity.odbc", "Construct: unable to get property Timeout"); + } else if( pBegin->Name == "Silent") - OSL_VERIFY( pBegin->Value >>= bSilent ); + { + if( ! (pBegin->Value >>= bSilent) ) + SAL_WARN("connectivity.odbc", "Construct: unable to get property Silent"); + } else if( pBegin->Name == "IgnoreDriverPrivileges") - OSL_VERIFY( pBegin->Value >>= m_bIgnoreDriverPrivileges ); + { + if( ! (pBegin->Value >>= m_bIgnoreDriverPrivileges) ) + SAL_WARN("connectivity.odbc", "Construct: unable to get property IgnoreDriverPrivileges"); + } else if( pBegin->Name == "PreventGetVersionColumns") - OSL_VERIFY( pBegin->Value >>= m_bPreventGetVersionColumns ); + { + if( ! (pBegin->Value >>= m_bPreventGetVersionColumns) ) + SAL_WARN("connectivity.odbc", "Construct: unable to get property PreventGetVersionColumns"); + } else if( pBegin->Name == "IsAutoRetrievingEnabled") { bool bAutoRetrievingEnabled = false; - OSL_VERIFY( pBegin->Value >>= bAutoRetrievingEnabled ); + if( ! (pBegin->Value >>= bAutoRetrievingEnabled) ) + SAL_WARN("connectivity.odbc", "Construct: unable to get property IsAutoRetrievingEnabled"); enableAutoRetrievingEnabled(bAutoRetrievingEnabled); } else if( pBegin->Name == "AutoRetrievingStatement") { OUString sGeneratedValueStatement; - OSL_VERIFY( pBegin->Value >>= sGeneratedValueStatement ); + if( ! (pBegin->Value >>= sGeneratedValueStatement) ) + SAL_WARN("connectivity.odbc", "Construct: unable to get property AutoRetrievingStatement"); setAutoRetrievingStatement(sGeneratedValueStatement); } else if( pBegin->Name == "user") { - OSL_VERIFY( pBegin->Value >>= aUID ); + if( ! (pBegin->Value >>= aUID) ) + SAL_WARN("connectivity.odbc", "Construct: unable to get property user"); aDSN = aDSN + ";UID=" + aUID; } else if( pBegin->Name == "password") { - OSL_VERIFY( pBegin->Value >>= aPWD ); + if( ! (pBegin->Value >>= aPWD) ) + SAL_WARN("connectivity.odbc", "Construct: unable to get property password"); aDSN = aDSN + ";PWD=" + aPWD; } else if( pBegin->Name == "UseCatalog") { - OSL_VERIFY( pBegin->Value >>= m_bUseCatalog ); + if( !( pBegin->Value >>= m_bUseCatalog) ) + SAL_WARN("connectivity.odbc", "Construct: unable to get property UseCatalog"); } else if( pBegin->Name == "SystemDriverSettings") { - OSL_VERIFY( pBegin->Value >>= aSysDrvSettings ); + if( ! (pBegin->Value >>= aSysDrvSettings) ) + SAL_WARN("connectivity.odbc", "Construct: unable to get property SystemDriverSettings"); aDSN += ";"; aDSN += aSysDrvSettings; } else if( pBegin->Name == "CharSet") { OUString sIanaName; - OSL_VERIFY( pBegin->Value >>= sIanaName ); + if( ! (pBegin->Value >>= sIanaName) ) + SAL_WARN("connectivity.odbc", "Construct: unable to get property CharSet"); ::dbtools::OCharsetMap aLookupIanaName; ::dbtools::OCharsetMap::const_iterator aLookup = aLookupIanaName.findIanaName(sIanaName); |