summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/dlg
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/dlg')
-rw-r--r--dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx5
-rw-r--r--dbaccess/source/ui/dlg/directsql.cxx48
-rw-r--r--dbaccess/source/ui/dlg/odbcconfig.cxx16
-rw-r--r--dbaccess/source/ui/dlg/queryfilter.cxx37
4 files changed, 67 insertions, 39 deletions
diff --git a/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx b/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx
index 41ed0e867c4b..df0d38e4ba87 100644
--- a/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx
+++ b/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx
@@ -11,9 +11,6 @@
#include <strings.hrc>
#include <core_resource.hxx>
-#define ALL_STRING DBA_RES(STR_QUERY_LIMIT_ALL)
-#define ALL_INT -1
-
namespace dbaui
{
@@ -27,7 +24,7 @@ QueryPropertiesDialog::QueryPropertiesDialog(
m_xRB_Distinct->set_active(bDistinct);
m_xRB_NonDistinct->set_active(!bDistinct);
- m_xLB_Limit->append(OUString::number(ALL_INT), ALL_STRING);
+ m_xLB_Limit->append(OUString::number(-1), DBA_RES(STR_QUERY_LIMIT_ALL)); // ALL_INT and ALL_STRING
/// Default values
sal_Int64 const aDefLimitAry[] =
{
diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx
index 709ac414fdfe..bcf8923abfaa 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -111,13 +111,25 @@ namespace dbaui
sal_Int32 DirectSQLDialog::getHistorySize() const
{
- CHECK_INVARIANTS("DirectSQLDialog::getHistorySize");
+ #ifdef DBG_UTIL
+ {
+ const char* pError = impl_CheckInvariants();
+ if (pError)
+ SAL_WARN("dbaccess.ui", "DirectSQLDialog::getHistorySize: " << pError);
+ }
+ #endif
return m_aStatementHistory.size();
}
void DirectSQLDialog::implEnsureHistoryLimit()
{
- CHECK_INVARIANTS("DirectSQLDialog::implEnsureHistoryLimit");
+ #ifdef DBG_UTIL
+ {
+ const char* pError = impl_CheckInvariants();
+ if (pError)
+ SAL_WARN("dbaccess.ui", "DirectSQLDialog::implEnsureHistoryLimit: " << pError);
+ }
+ #endif
if (getHistorySize() <= g_nHistoryLimit)
// nothing to do
@@ -134,7 +146,13 @@ namespace dbaui
void DirectSQLDialog::implAddToStatementHistory(const OUString& _rStatement)
{
- CHECK_INVARIANTS("DirectSQLDialog::implAddToStatementHistory");
+ #ifdef DBG_UTIL
+ {
+ const char* pError = impl_CheckInvariants();
+ if (pError)
+ SAL_WARN("dbaccess.ui", "DirectSQLDialog::implAddToStatementHistor: " << pError);
+ }
+ #endif
// add the statement to the history
m_aStatementHistory.push_back(_rStatement);
@@ -171,7 +189,13 @@ namespace dbaui
void DirectSQLDialog::implExecuteStatement(const OUString& _rStatement)
{
- CHECK_INVARIANTS("DirectSQLDialog::implExecuteStatement");
+ #ifdef DBG_UTIL
+ {
+ const char* pError = impl_CheckInvariants();
+ if (pError)
+ SAL_WARN("dbaccess.ui", "DirectSQLDialog::implExecuteStatement: " << pError);
+ }
+ #endif
::osl::MutexGuard aGuard(m_aMutex);
@@ -328,7 +352,13 @@ namespace dbaui
void DirectSQLDialog::executeCurrent()
{
- CHECK_INVARIANTS("DirectSQLDialog::executeCurrent");
+ #ifdef DBG_UTIL
+ {
+ const char* pError = impl_CheckInvariants();
+ if (pError)
+ SAL_WARN("dbaccess.ui", "DirectSQLDialog::executeCurrent: " << pError);
+ }
+ #endif
OUString sStatement = m_xSQL->GetText();
@@ -343,7 +373,13 @@ namespace dbaui
void DirectSQLDialog::switchToHistory(sal_Int32 _nHistoryPos)
{
- CHECK_INVARIANTS("DirectSQLDialog::switchToHistory");
+ #ifdef DBG_UTIL
+ {
+ const char* pError = impl_CheckInvariants();
+ if (pError)
+ SAL_WARN("dbaccess.ui", "DirectSQLDialog::switchToHistory: " << pError);
+ }
+ #endif
if ((_nHistoryPos >= 0) && (_nHistoryPos < getHistorySize()))
{
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)
diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx
index c5490bd959c1..2735acee5de4 100644
--- a/dbaccess/source/ui/dlg/queryfilter.cxx
+++ b/dbaccess/source/ui/dlg/queryfilter.cxx
@@ -180,9 +180,6 @@ DlgFilterCrit::~DlgFilterCrit()
{
}
-#define LbText(x) ((x).get_active_text())
-#define LbPos(x) ((x).get_active())
-
sal_Int32 DlgFilterCrit::GetOSQLPredicateType( std::u16string_view _rSelectedPredicate ) const
{
sal_Int32 nPredicateIndex = -1;
@@ -512,7 +509,7 @@ void DlgFilterCrit::SelectField(weld::ComboBox& rBox, std::u16string_view rField
void DlgFilterCrit::EnableLines()
{
// enabling/disabling of whole lines
- if( LbPos(*m_xLB_WHEREFIELD1) == 0 )
+ if( m_xLB_WHEREFIELD1->get_active() == 0 )
{
m_xLB_WHEREFIELD2->set_sensitive(false);
m_xLB_WHERECOND2->set_sensitive(false);
@@ -537,7 +534,7 @@ void DlgFilterCrit::EnableLines()
m_xET_WHEREVALUE3->set_sensitive(true);
}
- if( LbPos(*m_xLB_WHEREFIELD2) == 0 )
+ if( m_xLB_WHEREFIELD2->get_active() == 0 )
{
m_xLB_WHEREFIELD3->set_sensitive(false);
m_xLB_WHERECOND3->set_sensitive(false);
@@ -553,7 +550,7 @@ void DlgFilterCrit::EnableLines()
}
// comparison field equal to NOENTRY
- if( LbPos(*m_xLB_WHEREFIELD1) == 0 )
+ if( m_xLB_WHEREFIELD1->get_active() == 0 )
{
m_xLB_WHERECOMP1->set_sensitive(false);
m_xET_WHEREVALUE1->set_sensitive(false);
@@ -565,7 +562,7 @@ void DlgFilterCrit::EnableLines()
m_xET_WHEREVALUE1->set_sensitive(true);
}
- if( LbPos(*m_xLB_WHEREFIELD2) == 0 )
+ if( m_xLB_WHEREFIELD2->get_active() == 0 )
{
m_xLB_WHERECOND2->set_sensitive(false);
m_xLB_WHERECOMP2->set_sensitive(false);
@@ -579,7 +576,7 @@ void DlgFilterCrit::EnableLines()
m_xET_WHEREVALUE2->set_sensitive(true);
}
- if( LbPos(*m_xLB_WHEREFIELD3) == 0 )
+ if( m_xLB_WHEREFIELD3->get_active() == 0 )
{
m_xLB_WHERECOND3->set_sensitive(false);
m_xLB_WHERECOMP3->set_sensitive(false);
@@ -596,18 +593,18 @@ void DlgFilterCrit::EnableLines()
// comparison operator equal to ISNULL or ISNOTNULL
if(m_xLB_WHERECOMP1->get_count() > 2 &&
- ((LbPos(*m_xLB_WHERECOMP1) == m_xLB_WHERECOMP1->get_count()-1) ||
- (LbPos(*m_xLB_WHERECOMP1) == m_xLB_WHERECOMP1->get_count()-2)) )
+ ((m_xLB_WHERECOMP1->get_active() == m_xLB_WHERECOMP1->get_count()-1) ||
+ (m_xLB_WHERECOMP1->get_active() == m_xLB_WHERECOMP1->get_count()-2)) )
m_xET_WHEREVALUE1->set_sensitive(false);
if(m_xLB_WHERECOMP2->get_count() > 2 &&
- ((LbPos(*m_xLB_WHERECOMP2) == m_xLB_WHERECOMP2->get_count()-1) ||
- (LbPos(*m_xLB_WHERECOMP2) == m_xLB_WHERECOMP2->get_count()-2)) )
+ ((m_xLB_WHERECOMP2->get_active() == m_xLB_WHERECOMP2->get_count()-1) ||
+ (m_xLB_WHERECOMP2->get_active() == m_xLB_WHERECOMP2->get_count()-2)) )
m_xET_WHEREVALUE2->set_sensitive(false);
if(m_xLB_WHERECOMP3->get_count() > 2 &&
- ((LbPos(*m_xLB_WHERECOMP3) == m_xLB_WHERECOMP3->get_count()-1) ||
- (LbPos(*m_xLB_WHERECOMP3) == m_xLB_WHERECOMP3->get_count()-2)) )
+ ((m_xLB_WHERECOMP3->get_active() == m_xLB_WHERECOMP3->get_count()-1) ||
+ (m_xLB_WHERECOMP3->get_active() == m_xLB_WHERECOMP3->get_count()-2)) )
m_xET_WHEREVALUE3->set_sensitive(false);
}
@@ -617,17 +614,17 @@ IMPL_LINK( DlgFilterCrit, ListSelectHdl, weld::ComboBox&, rListBox, void )
weld::ComboBox* pComp;
if(&rListBox == m_xLB_WHEREFIELD1.get())
{
- aName = LbText(*m_xLB_WHEREFIELD1);
+ aName = m_xLB_WHEREFIELD1->get_active_text();
pComp = m_xLB_WHERECOMP1.get();
}
else if(&rListBox == m_xLB_WHEREFIELD2.get())
{
- aName = LbText(*m_xLB_WHEREFIELD2);
+ aName = m_xLB_WHEREFIELD2->get_active_text();
pComp = m_xLB_WHERECOMP2.get();
}
else
{
- aName = LbText(*m_xLB_WHEREFIELD3);
+ aName = m_xLB_WHEREFIELD3->get_active_text();
pComp = m_xLB_WHERECOMP3.get();
}
@@ -677,7 +674,7 @@ void DlgFilterCrit::BuildWherePart()
{
Sequence<Sequence<PropertyValue> > aFilter(1),aHaving(1);
- if( LbPos(*m_xLB_WHEREFIELD1) != 0 )
+ if( m_xLB_WHEREFIELD1->get_active() != 0 )
{
PropertyValue aValue;
if ( getCondition(*m_xLB_WHEREFIELD1,*m_xLB_WHERECOMP1,*m_xET_WHEREVALUE1,aValue) )
@@ -690,7 +687,7 @@ void DlgFilterCrit::BuildWherePart()
}
}
- if( LbPos(*m_xLB_WHEREFIELD2) != 0 )
+ if( m_xLB_WHEREFIELD2->get_active() != 0 )
{
PropertyValue aValue;
Sequence<Sequence<PropertyValue> >& _rValues = aFilter;
@@ -705,7 +702,7 @@ void DlgFilterCrit::BuildWherePart()
pValues[nPos].getArray()[nAndPos] = aValue;
}
- if( LbPos(*m_xLB_WHEREFIELD3) != 0 )
+ if( m_xLB_WHEREFIELD3->get_active() != 0 )
{
PropertyValue aValue;
Sequence<Sequence<PropertyValue> >& _rValues = aFilter;