Kaydet (Commit) 19573d94 authored tarafından Jens Carl's avatar Jens Carl Kaydeden (comit) Stephan Bergmann

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: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 17ecffa9
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include <connectivity/FValue.hxx> #include <connectivity/FValue.hxx>
#include <connectivity/dbexception.hxx> #include <connectivity/dbexception.hxx>
#include <sal/log.hxx>
#include <string.h> #include <string.h>
using namespace connectivity::odbc; using namespace connectivity::odbc;
...@@ -185,49 +187,68 @@ SQLRETURN OConnection::Construct(const OUString& url,const Sequence< PropertyVal ...@@ -185,49 +187,68 @@ SQLRETURN OConnection::Construct(const OUString& url,const Sequence< PropertyVal
for(;pBegin != pEnd;++pBegin) for(;pBegin != pEnd;++pBegin)
{ {
if( pBegin->Name == "Timeout") 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") 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") 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") 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") else if( pBegin->Name == "IsAutoRetrievingEnabled")
{ {
bool bAutoRetrievingEnabled = false; bool bAutoRetrievingEnabled = false;
OSL_VERIFY( pBegin->Value >>= bAutoRetrievingEnabled ); if( ! (pBegin->Value >>= bAutoRetrievingEnabled) )
SAL_WARN("connectivity.odbc", "Construct: unable to get property IsAutoRetrievingEnabled");
enableAutoRetrievingEnabled(bAutoRetrievingEnabled); enableAutoRetrievingEnabled(bAutoRetrievingEnabled);
} }
else if( pBegin->Name == "AutoRetrievingStatement") else if( pBegin->Name == "AutoRetrievingStatement")
{ {
OUString sGeneratedValueStatement; OUString sGeneratedValueStatement;
OSL_VERIFY( pBegin->Value >>= sGeneratedValueStatement ); if( ! (pBegin->Value >>= sGeneratedValueStatement) )
SAL_WARN("connectivity.odbc", "Construct: unable to get property AutoRetrievingStatement");
setAutoRetrievingStatement(sGeneratedValueStatement); setAutoRetrievingStatement(sGeneratedValueStatement);
} }
else if( pBegin->Name == "user") 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; aDSN = aDSN + ";UID=" + aUID;
} }
else if( pBegin->Name == "password") 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; aDSN = aDSN + ";PWD=" + aPWD;
} }
else if( pBegin->Name == "UseCatalog") 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") 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 += ";";
aDSN += aSysDrvSettings; aDSN += aSysDrvSettings;
} }
else if( pBegin->Name == "CharSet") else if( pBegin->Name == "CharSet")
{ {
OUString sIanaName; 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 aLookupIanaName;
::dbtools::OCharsetMap::const_iterator aLookup = aLookupIanaName.findIanaName(sIanaName); ::dbtools::OCharsetMap::const_iterator aLookup = aLookupIanaName.findIanaName(sIanaName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment