summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/dlg/odbcconfig.cxx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-11-11 16:00:08 +0100
committerJulien Nabet <serval2412@yahoo.fr>2021-11-11 19:41:46 +0100
commitbe73c64d11fd330f76b08fc75354164aba3ecc88 (patch)
treee3f8a9732c44ecb36742c3574a5d9bbec7bb45ce /dbaccess/source/ui/dlg/odbcconfig.cxx
parentce64e3feb72dbe8f14a5b22a6a02722b02b391b0 (diff)
Replace some macros in dbaccess part 7
Remove FIRST_USER_DEFINED_FEATURE and LAST_USER_DEFINED_FEATURE + GRANT_REVOKE_RIGHT + ALL_STRING + ALL_INT + NSQLAllocHandle + NSQLFreeHandle + NSQLSetEnvAttr + NSQLDataSources + LbText + LbPos + CHECK_INVARIANTS + OUT_LF + TAG_OFF_LF + TAG_ON_LF + TAG_OFF + TAG_ON Change-Id: I07261ea0eafcc9f0630f92e47bf5c2f694661933 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125065 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'dbaccess/source/ui/dlg/odbcconfig.cxx')
-rw-r--r--dbaccess/source/ui/dlg/odbcconfig.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/dbaccess/source/ui/dlg/odbcconfig.cxx b/dbaccess/source/ui/dlg/odbcconfig.cxx
index f3de8ba7037f..b2f3a45ff90d 100644
--- a/dbaccess/source/ui/dlg/odbcconfig.cxx
+++ b/dbaccess/source/ui/dlg/odbcconfig.cxx
@@ -61,10 +61,6 @@ typedef SQLRETURN (SQL_API* TSQLSetEnvAttr) (SQLHENV EnvironmentHandle, SQLINTEG
typedef SQLRETURN (SQL_API* TSQLDataSources) (SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR* ServerName,
SQLSMALLINT BufferLength1, SQLSMALLINT* NameLength1Ptr, SQLCHAR* Description, SQLSMALLINT BufferLength2, SQLSMALLINT* NameLength2Ptr);
-#define NSQLAllocHandle(a,b,c) (*reinterpret_cast<TSQLAllocHandle>(m_pAllocHandle))(a,b,c)
-#define NSQLFreeHandle(a,b) (*reinterpret_cast<TSQLFreeHandle>(m_pFreeHandle))(a,b)
-#define NSQLSetEnvAttr(a,b,c,d) (*reinterpret_cast<TSQLSetEnvAttr>(m_pSetEnvAttr))(a,b,c,d)
-#define NSQLDataSources(a,b,c,d,e,f,g,h) (*reinterpret_cast<TSQLDataSources>(m_pDataSources))(a,b,c,d,e,f,g,h)
#endif
// OOdbcLibWrapper
@@ -164,12 +160,12 @@ bool OOdbcEnumeration::allocEnv()
if (m_pImpl->hEnvironment)
// nothing to do
return true;
- SQLRETURN nResult = NSQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &m_pImpl->hEnvironment);
+ SQLRETURN nResult = (*reinterpret_cast<TSQLAllocHandle>(m_pAllocHandle))(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &m_pImpl->hEnvironment);
if (SQL_SUCCESS != nResult)
// can't do anything without environment
return false;
- NSQLSetEnvAttr(m_pImpl->hEnvironment, SQL_ATTR_ODBC_VERSION, reinterpret_cast<SQLPOINTER>(SQL_OV_ODBC3), SQL_IS_INTEGER);
+ (*reinterpret_cast<TSQLSetEnvAttr>(m_pSetEnvAttr))(m_pImpl->hEnvironment, SQL_ATTR_ODBC_VERSION, reinterpret_cast<SQLPOINTER>(SQL_OV_ODBC3),SQL_IS_INTEGER);
return true;
#else
return sal_False;
@@ -180,7 +176,7 @@ void OOdbcEnumeration::freeEnv()
{
#ifdef HAVE_ODBC_SUPPORT
if (m_pImpl->hEnvironment)
- NSQLFreeHandle(SQL_HANDLE_ENV, m_pImpl->hEnvironment);
+ (*reinterpret_cast<TSQLFreeHandle>(m_pFreeHandle))(SQL_HANDLE_ENV, m_pImpl->hEnvironment);
m_pImpl->hEnvironment = nullptr;
#endif
}
@@ -206,9 +202,11 @@ void OOdbcEnumeration::getDatasourceNames(std::set<OUString>& _rNames)
SQLRETURN nResult = SQL_SUCCESS;
rtl_TextEncoding nTextEncoding = osl_getThreadTextEncoding();
- for ( nResult = NSQLDataSources(m_pImpl->hEnvironment, SQL_FETCH_FIRST, szDSN, sizeof(szDSN), &pcbDSN, szDescription, sizeof(szDescription)-1, &pcbDescription);
+ for ( nResult = (*reinterpret_cast<TSQLDataSources>(m_pDataSources))(m_pImpl->hEnvironment, SQL_FETCH_FIRST, szDSN,
+ sizeof(szDSN), &pcbDSN, szDescription, sizeof(szDescription)-1, &pcbDescription);
;
- nResult = NSQLDataSources(m_pImpl->hEnvironment, SQL_FETCH_NEXT, szDSN, sizeof(szDSN), &pcbDSN, szDescription, sizeof(szDescription)-1, &pcbDescription)
+ nResult = (*reinterpret_cast<TSQLDataSources>(m_pDataSources))(m_pImpl->hEnvironment, SQL_FETCH_NEXT, szDSN,
+ sizeof(szDSN), &pcbDSN, szDescription, sizeof(szDescription)-1, &pcbDescription)
)
{
if (nResult != SQL_SUCCESS)