summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-05-17 06:30:42 +0000
committerOcke Janssen <oj@openoffice.org>2001-05-17 06:30:42 +0000
commit812e74019f16d90aab085061f071c3d4e095fb50 (patch)
tree8c7d12e2cd29f8c886458088d46c713ecfd615e4 /connectivity
parent367e22c38163e4ae9a407c5ebdc1ff20c23f70d3 (diff)
#86528# size changes
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx120
-rw-r--r--connectivity/source/commontools/dbtools.cxx27
-rw-r--r--connectivity/source/drivers/adabas/BConnection.cxx16
-rw-r--r--connectivity/source/drivers/ado/AConnection.cxx72
-rw-r--r--connectivity/source/drivers/ado/ADatabaseMetaData.cxx26
-rw-r--r--connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx168
-rw-r--r--connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx74
-rw-r--r--connectivity/source/drivers/ado/APreparedStatement.cxx32
-rw-r--r--connectivity/source/drivers/ado/AResultSet.cxx244
-rw-r--r--connectivity/source/drivers/ado/AStatement.cxx108
-rw-r--r--connectivity/source/drivers/ado/ATable.cxx16
-rw-r--r--connectivity/source/drivers/ado/Awrapado.cxx433
-rw-r--r--connectivity/source/drivers/calc/CConnection.cxx22
-rw-r--r--connectivity/source/drivers/jdbc/JDriver.cxx12
-rw-r--r--connectivity/source/manager/mdrivermanager.cxx60
15 files changed, 923 insertions, 507 deletions
diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
index de6787d88e5f..b216e8d627c6 100644
--- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: FDatabaseMetaDataResultSet.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:53:31 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:27:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -191,14 +191,20 @@ void ODatabaseMetaDataResultSet::setRows(const ORows& _rRows)
sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed )
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
Reference< XResultSetMetaData > xMeta = getMetaData();
sal_Int32 nLen = xMeta->getColumnCount();
sal_Int32 i = 1;
for(;i<=nLen;++i)
- if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) : columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
+ if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
+#if SUPD > 630
+ columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i))
+#else
+ columnName.equalsIgnoreCase(xMeta->getColumnName(i))
+#endif
+ )
break;
return i;
}
@@ -206,8 +212,8 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const ::rtl::OUString
Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return NULL;
@@ -221,8 +227,8 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResult
Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResultSet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return NULL;
@@ -238,8 +244,8 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResult
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return sal_False;
@@ -253,8 +259,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::getBoolean( sal_Int32 columnIndex
sal_Int8 SAL_CALL ODatabaseMetaDataResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return 0;
@@ -269,8 +275,8 @@ sal_Int8 SAL_CALL ODatabaseMetaDataResultSet::getByte( sal_Int32 columnIndex ) t
Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return Sequence< sal_Int8 >();
@@ -286,8 +292,8 @@ Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 co
::com::sun::star::util::Date SAL_CALL ODatabaseMetaDataResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return ::com::sun::star::util::Date(0,0,0);
@@ -303,8 +309,8 @@ Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 co
double SAL_CALL ODatabaseMetaDataResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return 0.0;
@@ -320,8 +326,8 @@ double SAL_CALL ODatabaseMetaDataResultSet::getDouble( sal_Int32 columnIndex ) t
float SAL_CALL ODatabaseMetaDataResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return 0.0;
@@ -338,8 +344,8 @@ float SAL_CALL ODatabaseMetaDataResultSet::getFloat( sal_Int32 columnIndex ) thr
sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return 0;
@@ -357,8 +363,8 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getInt( sal_Int32 columnIndex ) t
sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
return m_nRowPos;
}
@@ -367,8 +373,8 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getRow( ) throw(SQLException, Ru
sal_Int64 SAL_CALL ODatabaseMetaDataResultSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return sal_Int64();
@@ -384,8 +390,8 @@ sal_Int64 SAL_CALL ODatabaseMetaDataResultSet::getLong( sal_Int32 columnIndex )
Reference< XResultSetMetaData > SAL_CALL ODatabaseMetaDataResultSet::getMetaData( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(!m_xMetaData.is())
m_xMetaData = new ODatabaseMetaDataResultSetMetaData(this);
@@ -396,8 +402,8 @@ Reference< XResultSetMetaData > SAL_CALL ODatabaseMetaDataResultSet::getMetaData
Reference< XArray > SAL_CALL ODatabaseMetaDataResultSet::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return NULL;
@@ -413,8 +419,8 @@ Reference< XArray > SAL_CALL ODatabaseMetaDataResultSet::getArray( sal_Int32 col
Reference< XClob > SAL_CALL ODatabaseMetaDataResultSet::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return NULL;
@@ -428,8 +434,8 @@ Reference< XClob > SAL_CALL ODatabaseMetaDataResultSet::getClob( sal_Int32 colum
Reference< XBlob > SAL_CALL ODatabaseMetaDataResultSet::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return NULL;
@@ -444,8 +450,8 @@ Reference< XBlob > SAL_CALL ODatabaseMetaDataResultSet::getBlob( sal_Int32 colum
Reference< XRef > SAL_CALL ODatabaseMetaDataResultSet::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return NULL;
@@ -460,8 +466,8 @@ Reference< XRef > SAL_CALL ODatabaseMetaDataResultSet::getRef( sal_Int32 columnI
Any SAL_CALL ODatabaseMetaDataResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return Any();
@@ -475,8 +481,8 @@ Any SAL_CALL ODatabaseMetaDataResultSet::getObject( sal_Int32 columnIndex, const
sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return 0;
@@ -491,8 +497,8 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
::rtl::OUString SAL_CALL ODatabaseMetaDataResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return ::rtl::OUString();
@@ -512,8 +518,8 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
::com::sun::star::util::Time SAL_CALL ODatabaseMetaDataResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return ::com::sun::star::util::Time(0,0,0,0);
@@ -531,8 +537,8 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
::com::sun::star::util::DateTime SAL_CALL ODatabaseMetaDataResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return ::com::sun::star::util::DateTime(0,0,0,0,0,0,0);
@@ -580,8 +586,8 @@ void SAL_CALL ODatabaseMetaDataResultSet::close( ) throw(SQLException, RuntimeE
{
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
}
dispose();
}
@@ -653,8 +659,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isBeforeFirst( ) throw(SQLExcepti
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::next( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_bBOF)
{
@@ -675,8 +681,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::next( ) throw(SQLException, Runti
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::wasNull( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
if(m_aRowsIter == m_aRows.end())
return sal_True;
@@ -687,16 +693,16 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::wasNull( ) throw(SQLException, Ru
void SAL_CALL ODatabaseMetaDataResultSet::refreshRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
}
// -------------------------------------------------------------------------
void SAL_CALL ODatabaseMetaDataResultSet::cancel( ) throw(RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
}
// -------------------------------------------------------------------------
void SAL_CALL ODatabaseMetaDataResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 98b44406597e..4c9df72aca16 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dbtools.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:53:31 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:27:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -572,7 +572,11 @@ SQLContext prependContextInfo(SQLException& _rException, const Reference< XInter
aSeparator = sCatalogSep[0];
sal_Int32 nIndex = 0;
- ::rtl::OUString aFirstToken = aTableName.getToken(0, aSeparator, nIndex);
+ ::rtl::OUString aFirstToken = aTableName.getToken(0, aSeparator
+#if SUPD > 630
+ , nIndex
+#endif
+ );
if( nIndex != -1 ) // one or more tokens follow
{
::rtl::OUString aDatabaseName( aFirstToken );
@@ -585,9 +589,17 @@ SQLContext prependContextInfo(SQLException& _rException, const Reference< XInter
if (_rxMeta->supportsSchemasInDataManipulation())
{
sal_Int32 nIndex = 0;
- ::rtl::OUString aFirstToken( aTableName.getToken( 0, aGenericSep, nIndex ) );
- ::rtl::OUString aSecondToken( nIndex != -1 ? aTableName.getToken( 1, aGenericSep, nIndex ) : ::rtl::OUString() );
- if (nIndex == -1 && aSecondToken.getLength())
+ ::rtl::OUString aFirstToken( aTableName.getToken( 0, aGenericSep
+#if SUPD > 630
+ , nIndex
+#endif
+ ) );
+ ::rtl::OUString aSecondToken( nIndex != -1 ? aTableName.getToken( 1, aGenericSep
+#if SUPD > 630
+ , nIndex
+#endif
+ ) : ::rtl::OUString() );
+ if (nIndex != -1 && aSecondToken.getLength())
{
static ::rtl::OUString s_aGenericSep(&aGenericSep, 1);
// need a method on the OUString to cancat a single unicode character ....
@@ -1261,6 +1273,9 @@ void showError(const SQLExceptionInfo& _rInfo,
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.25 2001/05/14 11:53:31 oj
+ * #86528# lower size need
+ *
* Revision 1.24 2001/05/11 17:25:49 pl
* rtl string api changes
*
diff --git a/connectivity/source/drivers/adabas/BConnection.cxx b/connectivity/source/drivers/adabas/BConnection.cxx
index 2efac251d535..da18c8707e0e 100644
--- a/connectivity/source/drivers/adabas/BConnection.cxx
+++ b/connectivity/source/drivers/adabas/BConnection.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: BConnection.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: oj $ $Date: 2001-05-04 09:58:40 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:27:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -244,8 +244,8 @@ void OAdabasConnection::disposing()
Reference< XDatabaseMetaData > SAL_CALL OAdabasConnection::getMetaData( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE2::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE2::rBHelper.bDisposed);
+
Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
if(!xMetaData.is())
@@ -266,8 +266,8 @@ sal_Bool OAdabasConnection::isStarted()
Reference< XStatement > SAL_CALL OAdabasConnection::createStatement( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE2::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE2::rBHelper.bDisposed);
+
Reference< XStatement > xReturn = new OAdabasStatement(this);
m_aStatements.push_back(WeakReferenceHelper(xReturn));
return xReturn;
@@ -276,8 +276,8 @@ Reference< XStatement > SAL_CALL OAdabasConnection::createStatement( ) throw(SQ
Reference< XPreparedStatement > SAL_CALL OAdabasConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE2::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE2::rBHelper.bDisposed);
+
if(m_aTypeInfo.empty())
buildTypeInfo();
diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx
index 407de502f738..9f7493c6423c 100644
--- a/connectivity/source/drivers/ado/AConnection.cxx
+++ b/connectivity/source/drivers/ado/AConnection.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AConnection.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:41:55 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:26:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -227,8 +227,8 @@ void SAL_CALL OConnection::release() throw(RuntimeException)
Reference< XStatement > SAL_CALL OConnection::createStatement( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
OStatement* pStmt = new OStatement(this);
Reference< XStatement > xStmt = pStmt;
m_aStatements.push_back(WeakReferenceHelper(*pStmt));
@@ -238,8 +238,8 @@ Reference< XStatement > SAL_CALL OConnection::createStatement( ) throw(SQLExcep
Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
OPreparedStatement* pStmt = new OPreparedStatement(this,m_aTypeInfo,sql);
Reference< XPreparedStatement > xPStmt = pStmt;
@@ -250,8 +250,8 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::
Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
OCallableStatement* pStmt = new OCallableStatement(this,m_aTypeInfo,sql);
Reference< XPreparedStatement > xPStmt = pStmt;
@@ -262,8 +262,8 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl::
::rtl::OUString SAL_CALL OConnection::nativeSQL( const ::rtl::OUString& _sql ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
::rtl::OUString sql = _sql;
ADOProperties* pProps=m_pAdoConnection->get_Properties();
@@ -291,8 +291,8 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl::
void SAL_CALL OConnection::setAutoCommit( sal_Bool autoCommit ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
m_bAutocommit = autoCommit;
if(!autoCommit)
@@ -304,8 +304,8 @@ void SAL_CALL OConnection::setAutoCommit( sal_Bool autoCommit ) throw(SQLExcepti
sal_Bool SAL_CALL OConnection::getAutoCommit( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
return m_bAutocommit;
}
@@ -313,8 +313,8 @@ sal_Bool SAL_CALL OConnection::getAutoCommit( ) throw(SQLException, RuntimeExce
void SAL_CALL OConnection::commit( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
m_pAdoConnection->CommitTrans();
}
@@ -322,8 +322,8 @@ void SAL_CALL OConnection::commit( ) throw(SQLException, RuntimeException)
void SAL_CALL OConnection::rollback( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
m_pAdoConnection->RollbackTrans();
}
@@ -338,8 +338,8 @@ sal_Bool SAL_CALL OConnection::isClosed( ) throw(SQLException, RuntimeException
Reference< XDatabaseMetaData > SAL_CALL OConnection::getMetaData( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
if(!xMetaData.is())
@@ -354,8 +354,8 @@ Reference< XDatabaseMetaData > SAL_CALL OConnection::getMetaData( ) throw(SQLEx
void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
m_pAdoConnection->put_Mode(adModeRead);
ADOS::ThrowException(*m_pAdoConnection,*this);
@@ -364,8 +364,8 @@ void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly ) throw(SQLException,
sal_Bool SAL_CALL OConnection::isReadOnly( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
return m_pAdoConnection->get_Mode() == adModeRead;
}
@@ -373,8 +373,8 @@ sal_Bool SAL_CALL OConnection::isReadOnly( ) throw(SQLException, RuntimeExcepti
void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
m_pAdoConnection->PutDefaultDatabase(catalog);
ADOS::ThrowException(*m_pAdoConnection,*this);
@@ -383,8 +383,8 @@ void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQ
::rtl::OUString SAL_CALL OConnection::getCatalog( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
return m_pAdoConnection->GetDefaultDatabase();
}
@@ -392,8 +392,8 @@ void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQ
void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 level ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
IsolationLevelEnum eIso;
switch(level)
@@ -424,8 +424,8 @@ void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 level ) throw(SQLE
sal_Int32 SAL_CALL OConnection::getTransactionIsolation( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
sal_Int32 nRet = 0;
switch(m_pAdoConnection->get_IsolationLevel())
@@ -455,8 +455,8 @@ sal_Int32 SAL_CALL OConnection::getTransactionIsolation( ) throw(SQLException,
Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OConnection::getTypeMap( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
return NULL;
}
@@ -470,8 +470,8 @@ void SAL_CALL OConnection::close( ) throw(SQLException, RuntimeException)
{
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
}
dispose();
}
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaData.cxx b/connectivity/source/drivers/ado/ADatabaseMetaData.cxx
index 8bd880db8c6b..32efad26a173 100644
--- a/connectivity/source/drivers/ado/ADatabaseMetaData.cxx
+++ b/connectivity/source/drivers/ado/ADatabaseMetaData.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ADatabaseMetaData.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: oj $ $Date: 2001-04-18 14:06:30 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:26:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -201,20 +201,23 @@ sal_Int32 ODatabaseMetaData::getMaxSize(sal_uInt32 _nId) throw(SQLException, Run
{
if(!m_aLiteralInfo.size())
fillLiterals();
+
+ sal_Int32 nSize = 0;
::std::map<sal_uInt32,LiteralInfo>::const_iterator aIter = m_aLiteralInfo.find(_nId);
if(aIter != m_aLiteralInfo.end() && (*aIter).second.fSupported)
- return ((*aIter).second.cchMaxLen == (-1)) ? 0 : (*aIter).second.cchMaxLen;
- return 0;
+ nSize = ((*aIter).second.cchMaxLen == (-1)) ? 0 : (*aIter).second.cchMaxLen;
+ return nSize;
}
// -------------------------------------------------------------------------
sal_Bool ODatabaseMetaData::isCapable(sal_uInt32 _nId) throw(SQLException, RuntimeException)
{
if(!m_aLiteralInfo.size())
fillLiterals();
+ sal_Bool bSupported = sal_False;
::std::map<sal_uInt32,LiteralInfo>::const_iterator aIter = m_aLiteralInfo.find(_nId);
if(aIter != m_aLiteralInfo.end())
- (*aIter).second.fSupported;
- return sal_False;
+ bSupported = (*aIter).second.fSupported;
+ return bSupported;
}
// -------------------------------------------------------------------------
@@ -222,10 +225,11 @@ sal_Bool ODatabaseMetaData::isCapable(sal_uInt32 _nId) throw(SQLException, Runti
{
if(!m_aLiteralInfo.size())
fillLiterals();
+ ::rtl::OUString sStr;
::std::map<sal_uInt32,LiteralInfo>::const_iterator aIter = m_aLiteralInfo.find(_nId);
if(aIter != m_aLiteralInfo.end() && (*aIter).second.fSupported)
- return (*aIter).second.pwszLiteralValue;
- return ::rtl::OUString();
+ sStr = (*aIter).second.pwszLiteralValue;
+ return sStr;
}
// -------------------------------------------------------------------------
sal_Int32 ODatabaseMetaData::getInt32Property(const ::rtl::OUString& _aProperty) throw(SQLException, RuntimeException)
@@ -602,11 +606,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns(
const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
{
- Reference< XResultSet > xRef = NULL;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(NULL);
- xRef = pResult;
- return xRef;
+ return new ODatabaseMetaDataResultSet(NULL);
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
index 7ab547ef5eb8..6e0b89270ea0 100644
--- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ADatabaseMetaDataResultSet.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: kz $ $Date: 2001-05-15 16:27:01 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:30:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -181,8 +181,8 @@ Any SAL_CALL ODatabaseMetaDataResultSet::queryInterface( const Type & rType ) th
sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed )
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
Reference< XResultSetMetaData > xMeta = getMetaData();
sal_Int32 nLen = xMeta->getColumnCount();
@@ -197,8 +197,8 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const ::rtl::OUString
Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -240,8 +240,8 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResult
Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResultSet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -253,8 +253,8 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResult
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -270,8 +270,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::getBoolean( sal_Int32 columnIndex
sal_Int8 SAL_CALL ODatabaseMetaDataResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -292,8 +292,8 @@ sal_Int8 SAL_CALL ODatabaseMetaDataResultSet::getByte( sal_Int32 columnIndex ) t
Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -309,8 +309,8 @@ Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 co
::com::sun::star::util::Date SAL_CALL ODatabaseMetaDataResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -326,8 +326,8 @@ Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 co
double SAL_CALL ODatabaseMetaDataResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -343,8 +343,8 @@ double SAL_CALL ODatabaseMetaDataResultSet::getDouble( sal_Int32 columnIndex ) t
float SAL_CALL ODatabaseMetaDataResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -360,8 +360,8 @@ float SAL_CALL ODatabaseMetaDataResultSet::getFloat( sal_Int32 columnIndex ) thr
sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -383,8 +383,8 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getInt( sal_Int32 columnIndex ) t
sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -395,8 +395,8 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getRow( ) throw(SQLException, Ru
sal_Int64 SAL_CALL ODatabaseMetaDataResultSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -409,8 +409,8 @@ sal_Int64 SAL_CALL ODatabaseMetaDataResultSet::getLong( sal_Int32 columnIndex )
Reference< XResultSetMetaData > SAL_CALL ODatabaseMetaDataResultSet::getMetaData( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -423,8 +423,8 @@ Reference< XResultSetMetaData > SAL_CALL ODatabaseMetaDataResultSet::getMetaData
Reference< XArray > SAL_CALL ODatabaseMetaDataResultSet::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -437,8 +437,8 @@ Reference< XArray > SAL_CALL ODatabaseMetaDataResultSet::getArray( sal_Int32 col
Reference< XClob > SAL_CALL ODatabaseMetaDataResultSet::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -449,8 +449,8 @@ Reference< XClob > SAL_CALL ODatabaseMetaDataResultSet::getClob( sal_Int32 colum
Reference< XBlob > SAL_CALL ODatabaseMetaDataResultSet::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -462,8 +462,8 @@ Reference< XBlob > SAL_CALL ODatabaseMetaDataResultSet::getBlob( sal_Int32 colum
Reference< XRef > SAL_CALL ODatabaseMetaDataResultSet::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -475,8 +475,8 @@ Reference< XRef > SAL_CALL ODatabaseMetaDataResultSet::getRef( sal_Int32 columnI
Any SAL_CALL ODatabaseMetaDataResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -488,8 +488,8 @@ Any SAL_CALL ODatabaseMetaDataResultSet::getObject( sal_Int32 columnIndex, const
sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -511,8 +511,8 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
::rtl::OUString SAL_CALL ODatabaseMetaDataResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -533,8 +533,8 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
::com::sun::star::util::Time SAL_CALL ODatabaseMetaDataResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -551,8 +551,8 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
::com::sun::star::util::DateTime SAL_CALL ODatabaseMetaDataResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -568,8 +568,8 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isAfterLast( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -581,8 +581,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isAfterLast( ) throw(SQLException
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isFirst( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -592,8 +592,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isFirst( ) throw(SQLException, Ru
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isLast( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -603,8 +603,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isLast( ) throw(SQLException, Run
void SAL_CALL ODatabaseMetaDataResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -615,8 +615,8 @@ void SAL_CALL ODatabaseMetaDataResultSet::beforeFirst( ) throw(SQLException, Ru
void SAL_CALL ODatabaseMetaDataResultSet::afterLast( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -630,8 +630,8 @@ void SAL_CALL ODatabaseMetaDataResultSet::close( ) throw(SQLException, RuntimeE
{
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
}
dispose();
}
@@ -640,8 +640,8 @@ void SAL_CALL ODatabaseMetaDataResultSet::close( ) throw(SQLException, RuntimeE
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::first( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
return sal_False;
@@ -656,8 +656,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::first( ) throw(SQLException, Runt
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::last( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed )
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
+
return m_pRecordSet ? SUCCEEDED(m_pRecordSet->MoveLast()) : sal_False;
}
@@ -665,8 +665,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::last( ) throw(SQLException, Runti
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(first())
{
@@ -683,8 +683,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::absolute( sal_Int32 row ) throw(SQ
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
return sal_False;
@@ -700,8 +700,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::relative( sal_Int32 row ) throw(SQ
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::previous( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
return sal_False;
@@ -721,8 +721,8 @@ Reference< XInterface > SAL_CALL ODatabaseMetaDataResultSet::getStatement( ) th
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowDeleted( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -733,8 +733,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowDeleted( ) throw(SQLException,
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowInserted( ) throw(SQLException, RuntimeException)
{ ::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -746,8 +746,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowInserted( ) throw(SQLException
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -760,8 +760,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowUpdated( ) throw(SQLException,
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
return sal_True;
@@ -775,8 +775,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isBeforeFirst( ) throw(SQLExcepti
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::next( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
return sal_False;
@@ -794,8 +794,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::next( ) throw(SQLException, Runti
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::wasNull( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -805,8 +805,8 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::wasNull( ) throw(SQLException, Ru
void SAL_CALL ODatabaseMetaDataResultSet::refreshRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
@@ -817,8 +817,8 @@ void SAL_CALL ODatabaseMetaDataResultSet::refreshRow( ) throw(SQLException, Run
void SAL_CALL ODatabaseMetaDataResultSet::cancel( ) throw(RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
+
if(!m_pRecordSet)
throw SQLException();
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx
index 107bcc627fee..5f5c6ddc5ae2 100644
--- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx
+++ b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ADatabaseMetaDataResultSetMetaData.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:26:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -96,26 +96,30 @@ ODatabaseMetaDataResultSetMetaData::~ODatabaseMetaDataResultSetMetaData()
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException)
{
+ sal_Int32 nSize = 0;
if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getColumnDisplaySize();
-
- if(!m_pRecordSet)
- return 0;
- ADO_GETFIELD(m_vMapping[column]);
- if(aField.IsValid())
- return aField.GetActualSize();
- return 0;
+ nSize = (*m_mColumnsIter).second.getColumnDisplaySize();
+ else if(m_pRecordSet)
+ {
+ ADO_GETFIELD(m_vMapping[column]);
+ if(aField.IsValid())
+ nSize = aField.GetActualSize();
+ }
+ return nSize;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException)
{
+ sal_Int32 nType = 0;
if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getColumnType();
- if(!m_pRecordSet)
- return 0;
- ADO_GETFIELD(m_vMapping[column]);
- return MapADOType2Jdbc(aField.GetADOType());
+ nType = (*m_mColumnsIter).second.getColumnType();
+ else if(m_pRecordSet)
+ {
+ ADO_GETFIELD(m_vMapping[column]);
+ nType = ADOS::MapADOType2Jdbc(aField.GetADOType());
+ }
+ return nType;
}
// -------------------------------------------------------------------------
@@ -333,46 +337,6 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isWritable( sal_Int32 colu
return isDefinitelyWritable(column);
}
// -------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaDataResultSetMetaData::MapADOType2Jdbc(DataTypeEnum eType)
-{
- switch (eType)
- {
- case adUnsignedSmallInt:
- case adSmallInt: return DataType::SMALLINT; break;
- case adUnsignedInt:
- case adInteger: return DataType::INTEGER; break;
- case adUnsignedBigInt:
- case adBigInt: return DataType::BIGINT; break;
- case adSingle: return DataType::FLOAT; break;
- case adDouble: return DataType::DOUBLE; break;
- case adCurrency: return DataType::DOUBLE; break;
- case adVarNumeric:
- case adNumeric: return DataType::NUMERIC; break;
- case adDecimal: return DataType::DECIMAL; break;
- case adDate:
- case adDBDate: return DataType::DATE; break;
- case adDBTime: return DataType::TIME; break;
- case adDBTimeStamp: return DataType::TIMESTAMP; break;
- case adBoolean: return DataType::BIT; break;
- case adBinary:
- case adGUID: return DataType::BINARY; break;
- case adBSTR:
- case adVarWChar:
- case adVarChar: return DataType::VARCHAR; break;
- case adLongVarWChar:
- case adLongVarChar: return DataType::LONGVARCHAR; break;
- case adVarBinary: return DataType::VARBINARY; break;
- case adLongVarBinary: return DataType::LONGVARBINARY; break;
- case adWChar:
- case adChar: return DataType::CHAR; break;
- case adUnsignedTinyInt:
- case adTinyInt: return DataType::TINYINT; break;
- default:
- OSL_ENSURE(0,"MapADOType2Jdbc: Unknown Type!");
- }
- return DataType::VARCHAR;
-}
-// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSetMetaData::setColumnPrivilegesMap()
{
m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("IS_GRANTABLE"),
diff --git a/connectivity/source/drivers/ado/APreparedStatement.cxx b/connectivity/source/drivers/ado/APreparedStatement.cxx
index 6ddaa52c2769..0e518285d4d8 100644
--- a/connectivity/source/drivers/ado/APreparedStatement.cxx
+++ b/connectivity/source/drivers/ado/APreparedStatement.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: APreparedStatement.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:26:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -160,8 +160,8 @@ void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
}
dispose();
@@ -171,8 +171,8 @@ void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException
sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
SQLWarning warning;
@@ -206,8 +206,8 @@ sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeExc
sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
ADORecordset* pSet=NULL;
CHECK_RETURN(m_Command.Execute(m_RecordsAffected,m_Parameters,adCmdUnknown,&pSet))
@@ -220,8 +220,8 @@ void OPreparedStatement::setParameter(sal_Int32 parameterIndex, const DataTypeEn
const sal_Int32& _nSize,const OLEVariant& _Val) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
sal_Int32 nCount = 0;
m_pParameters->get_Count(&nCount);
@@ -258,8 +258,8 @@ void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::r
Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
return (Reference< XConnection >)m_pConnection;
}
@@ -268,8 +268,8 @@ Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQ
Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
// first clear the old things
m_xMetaData = NULL;
@@ -435,8 +435,8 @@ void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, con
void SAL_CALL OPreparedStatement::clearParameters( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
if(m_pParameters)
{
diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx
index 878258cec5ac..ef4501c261ef 100644
--- a/connectivity/source/drivers/ado/AResultSet.cxx
+++ b/connectivity/source/drivers/ado/AResultSet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AResultSet.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: kz $ $Date: 2001-05-15 16:43:20 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:30:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -224,8 +224,8 @@ Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeExcep
sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
Reference< XResultSetMetaData > xMeta = getMetaData();
sal_Int32 nLen = xMeta->getColumnCount();
@@ -240,8 +240,8 @@ sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) t
Reference< ::com::sun::star::io::XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
if((aField.GetAttributes() & adFldLong) == adFldLong)
{
@@ -280,8 +280,8 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL OResultSet::getBinarySt
Reference< ::com::sun::star::io::XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
return NULL;
}
@@ -289,8 +289,8 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL OResultSet::getCharacte
sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
aField.get_Value(m_aValue);
if(m_aValue.isNull())
@@ -302,8 +302,8 @@ sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLExcep
sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
aField.get_Value(m_aValue);
if(m_aValue.isNull())
@@ -315,8 +315,8 @@ sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLExceptio
Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
aField.get_Value(m_aValue);
if(m_aValue.isNull())
@@ -328,8 +328,8 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) thro
::com::sun::star::util::Date SAL_CALL OResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
aField.get_Value(m_aValue);
@@ -342,8 +342,8 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) thro
double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
aField.get_Value(m_aValue);
@@ -356,8 +356,8 @@ double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLExceptio
float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
aField.get_Value(m_aValue);
@@ -370,8 +370,8 @@ float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException,
sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
aField.get_Value(m_aValue);
@@ -384,8 +384,8 @@ sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex ) throw(SQLExceptio
sal_Int32 SAL_CALL OResultSet::getRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
PositionEnum aPos;
m_pRecordSet->get_AbsolutePosition(&aPos);
@@ -397,8 +397,8 @@ sal_Int32 SAL_CALL OResultSet::getRow( ) throw(SQLException, RuntimeException)
sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
if(m_aValue.isNull())
@@ -410,8 +410,8 @@ sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 columnIndex ) throw(SQLExcepti
Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
if(!m_xMetaData.is())
m_xMetaData = new OResultSetMetaData(m_pRecordSet);
@@ -456,8 +456,8 @@ Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const Reference< ::co
sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
aField.get_Value(m_aValue);
@@ -470,8 +470,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept
::rtl::OUString SAL_CALL OResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
m_aValue = aField.get_Value();
@@ -486,8 +486,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept
::com::sun::star::util::Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
aField.get_Value(m_aValue);
@@ -501,8 +501,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept
::com::sun::star::util::DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
aField.get_Value(m_aValue);
@@ -515,8 +515,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept
sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
VARIANT_BOOL bIsAtEOF;
CHECK_RETURN(m_pRecordSet->get_EOF(&bIsAtEOF))
@@ -526,8 +526,8 @@ sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeExcepti
sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
return m_nRowPos == 1;
}
@@ -535,8 +535,8 @@ sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException)
sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
return sal_True;
}
@@ -544,8 +544,8 @@ sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException)
void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
if(first())
previous();
@@ -554,8 +554,8 @@ void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
void SAL_CALL OResultSet::afterLast( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
if(last())
next();
@@ -567,8 +567,8 @@ void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException)
{
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
}
dispose();
}
@@ -577,8 +577,8 @@ void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException)
sal_Bool SAL_CALL OResultSet::first( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
if(SUCCEEDED(m_pRecordSet->MoveFirst()))
{
@@ -592,8 +592,8 @@ sal_Bool SAL_CALL OResultSet::first( ) throw(SQLException, RuntimeException)
sal_Bool SAL_CALL OResultSet::last( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
sal_Bool bRet = SUCCEEDED(m_pRecordSet->MoveLast());
if(bRet)
@@ -604,8 +604,8 @@ sal_Bool SAL_CALL OResultSet::last( ) throw(SQLException, RuntimeException)
sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
if(!row) // absolute with zero not allowed
throw SQLException();
@@ -634,8 +634,8 @@ sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, Runt
sal_Bool SAL_CALL OResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
OLEVariant aEmpty;
aEmpty.setNoArg();
@@ -648,8 +648,8 @@ sal_Bool SAL_CALL OResultSet::relative( sal_Int32 row ) throw(SQLException, Runt
sal_Bool SAL_CALL OResultSet::previous( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
sal_Bool bRet = SUCCEEDED(m_pRecordSet->MovePrevious());
if(bRet)
@@ -666,8 +666,8 @@ Reference< XInterface > SAL_CALL OResultSet::getStatement( ) throw(SQLException
sal_Bool SAL_CALL OResultSet::rowDeleted( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
RecordStatusEnum eRec;
m_pRecordSet->get_Status((sal_Int32*)&eRec);
@@ -679,8 +679,8 @@ sal_Bool SAL_CALL OResultSet::rowDeleted( ) throw(SQLException, RuntimeExceptio
// -------------------------------------------------------------------------
sal_Bool SAL_CALL OResultSet::rowInserted( ) throw(SQLException, RuntimeException)
{ ::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
RecordStatusEnum eRec;
m_pRecordSet->get_Status((sal_Int32*)&eRec);
@@ -693,8 +693,8 @@ sal_Bool SAL_CALL OResultSet::rowInserted( ) throw(SQLException, RuntimeExcepti
sal_Bool SAL_CALL OResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
RecordStatusEnum eRec;
m_pRecordSet->get_Status((sal_Int32*)&eRec);
@@ -705,8 +705,8 @@ sal_Bool SAL_CALL OResultSet::rowUpdated( ) throw(SQLException, RuntimeExceptio
sal_Bool SAL_CALL OResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
OSL_ENSURE(!m_nRowPos,"OResultSet::isBeforeFirst: Error in setting m_nRowPos!");
VARIANT_BOOL bIsAtBOF;
@@ -718,8 +718,8 @@ sal_Bool SAL_CALL OResultSet::isBeforeFirst( ) throw(SQLException, RuntimeExcep
sal_Bool SAL_CALL OResultSet::next( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
sal_Bool bRet = sal_True;
if(m_bOnFirstAfterOpen)
@@ -749,8 +749,8 @@ sal_Bool SAL_CALL OResultSet::next( ) throw(SQLException, RuntimeException)
sal_Bool SAL_CALL OResultSet::wasNull( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
return m_aValue.isNull();
}
@@ -759,8 +759,8 @@ sal_Bool SAL_CALL OResultSet::wasNull( ) throw(SQLException, RuntimeException)
void SAL_CALL OResultSet::cancel( ) throw(RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
m_pRecordSet->Cancel();
}
@@ -777,8 +777,8 @@ Any SAL_CALL OResultSet::getWarnings( ) throw(SQLException, RuntimeException)
void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
OLEVariant aEmpty;
aEmpty.setNoArg();
@@ -788,8 +788,8 @@ void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException)
void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
OLEVariant aEmpty;
aEmpty.setNoArg();
@@ -799,8 +799,8 @@ void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException)
void SAL_CALL OResultSet::deleteRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
m_pRecordSet->Delete(adAffectCurrent);
m_pRecordSet->UpdateBatch(adAffectCurrent);
@@ -810,8 +810,8 @@ void SAL_CALL OResultSet::deleteRow( ) throw(SQLException, RuntimeException)
void SAL_CALL OResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
m_pRecordSet->CancelUpdate();
}
@@ -829,8 +829,8 @@ void SAL_CALL OResultSet::moveToCurrentRow( ) throw(SQLException, RuntimeExcept
void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -843,8 +843,8 @@ void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException
void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -854,8 +854,8 @@ void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) thr
void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -866,8 +866,8 @@ void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(
void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -877,8 +877,8 @@ void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) thro
void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -888,8 +888,8 @@ void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(
void SAL_CALL OResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -899,8 +899,8 @@ void SAL_CALL OResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw
void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -911,8 +911,8 @@ void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQ
void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -922,8 +922,8 @@ void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(
void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -933,8 +933,8 @@ void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUSt
void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -944,8 +944,8 @@ void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sa
void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -956,8 +956,8 @@ void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const ::com::sun::s
void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -968,8 +968,8 @@ void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const ::com::sun::s
void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADO_GETFIELD(columnIndex);
@@ -990,8 +990,8 @@ void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Re
void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
m_pRecordSet->Resync(adAffectCurrent,adResyncAllValues);
}
@@ -1012,8 +1012,8 @@ void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any&
Any SAL_CALL OResultSet::getBookmark( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
if(m_nRowPos < (sal_Int32)m_aBookmarks.size()) // this bookmark was already fetched
return makeAny(sal_Int32(m_nRowPos-1));
@@ -1028,8 +1028,8 @@ Any SAL_CALL OResultSet::getBookmark( ) throw(SQLException, RuntimeException)
sal_Bool SAL_CALL OResultSet::moveToBookmark( const Any& bookmark ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
sal_Int32 nPos;
bookmark >>= nPos;
@@ -1043,8 +1043,8 @@ sal_Bool SAL_CALL OResultSet::moveToBookmark( const Any& bookmark ) throw(SQLExc
sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
sal_Int32 nPos;
bookmark >>= nPos;
@@ -1058,8 +1058,8 @@ sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark( const Any& bookmark, sal_I
sal_Int32 SAL_CALL OResultSet::compareBookmarks( const Any& first, const Any& second ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
sal_Int32 nPos1;
first >>= nPos1;
@@ -1078,8 +1078,8 @@ sal_Int32 SAL_CALL OResultSet::compareBookmarks( const Any& first, const Any& se
sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
ADOProperties* pProps = NULL;
m_pRecordSet->get_Properties(&pProps);
@@ -1103,8 +1103,8 @@ sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks( ) throw(SQLException, Runtim
sal_Int32 SAL_CALL OResultSet::hashBookmark( const Any& bookmark ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
sal_Int32 nPos;
bookmark >>= nPos;
@@ -1115,8 +1115,8 @@ sal_Int32 SAL_CALL OResultSet::hashBookmark( const Any& bookmark ) throw(SQLExce
Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& rows ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
OLEVariant aVar;
sal_Int32 nPos;
diff --git a/connectivity/source/drivers/ado/AStatement.cxx b/connectivity/source/drivers/ado/AStatement.cxx
index adce16cb9088..2a4a812bf7d7 100644
--- a/connectivity/source/drivers/ado/AStatement.cxx
+++ b/connectivity/source/drivers/ado/AStatement.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AStatement.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:26:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -189,8 +189,8 @@ Any SAL_CALL OStatement_Base::queryInterface( const Type & rType ) throw(Runtime
void SAL_CALL OStatement_Base::cancel( ) throw(RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
CHECK_RETURN(m_Command.Cancel())
}
@@ -200,8 +200,8 @@ void SAL_CALL OStatement_Base::close( ) throw(SQLException, RuntimeException)
{
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
}
dispose();
}
@@ -216,8 +216,8 @@ void SAL_CALL OStatement::clearBatch( ) throw(SQLException, RuntimeException)
void OStatement_Base::reset() throw (SQLException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
clearWarnings ();
@@ -247,8 +247,8 @@ void OStatement_Base::reset() throw (SQLException)
void OStatement_Base::clearMyResultSet () throw (SQLException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
Reference<XCloseable> xCloseable;
if(::comphelper::query_interface(m_xResultSet.get(),xCloseable))
@@ -259,8 +259,8 @@ void OStatement_Base::clearMyResultSet () throw (SQLException)
sal_Int32 OStatement_Base::getRowCount () throw( SQLException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
return m_RecordsAffected;
}
@@ -273,8 +273,8 @@ sal_Int32 OStatement_Base::getRowCount () throw( SQLException)
sal_Int32 OStatement_Base::getPrecision ( sal_Int32 sqlType)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
sal_Int32 prec = -1;
OTypeInfo aInfo;
@@ -298,8 +298,8 @@ sal_Int32 OStatement_Base::getPrecision ( sal_Int32 sqlType)
void OStatement_Base::setWarning (const SQLWarning &ex) throw( SQLException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
m_aLastWarning = ex;
}
@@ -307,8 +307,8 @@ void OStatement_Base::setWarning (const SQLWarning &ex) throw( SQLException)
sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
// Reset the statement handle and warning
@@ -334,8 +334,8 @@ sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(S
Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
reset();
@@ -370,8 +370,8 @@ Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const ::rtl::OUS
Reference< XConnection > SAL_CALL OStatement_Base::getConnection( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
return (Reference< XConnection >)m_pConnection;
}
@@ -389,8 +389,8 @@ Any SAL_CALL OStatement::queryInterface( const Type & rType ) throw(RuntimeExcep
void SAL_CALL OStatement::addBatch( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
m_aBatchList.push_back(sql);
}
@@ -398,8 +398,8 @@ void SAL_CALL OStatement::addBatch( const ::rtl::OUString& sql ) throw(SQLExcept
Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
reset();
@@ -439,8 +439,8 @@ Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( ) throw(SQLException,
sal_Int32 SAL_CALL OStatement_Base::executeUpdate( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
reset();
@@ -466,8 +466,8 @@ sal_Int32 SAL_CALL OStatement_Base::executeUpdate( const ::rtl::OUString& sql )
Reference< XResultSet > SAL_CALL OStatement_Base::getResultSet( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
return m_xResultSet;
}
@@ -476,8 +476,8 @@ Reference< XResultSet > SAL_CALL OStatement_Base::getResultSet( ) throw(SQLExce
sal_Int32 SAL_CALL OStatement_Base::getUpdateCount( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
sal_Int32 nRet;
if(m_RecordSet.IsValid() && m_RecordSet.get_RecordCount(nRet))
@@ -489,8 +489,8 @@ sal_Int32 SAL_CALL OStatement_Base::getUpdateCount( ) throw(SQLException, Runti
sal_Bool SAL_CALL OStatement_Base::getMoreResults( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
SQLWarning warning;
@@ -521,8 +521,8 @@ sal_Bool SAL_CALL OStatement_Base::getMoreResults( ) throw(SQLException, Runtim
Any SAL_CALL OStatement_Base::getWarnings( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
return makeAny(m_aLastWarning);
}
@@ -532,8 +532,8 @@ Any SAL_CALL OStatement_Base::getWarnings( ) throw(SQLException, RuntimeExcepti
void SAL_CALL OStatement_Base::clearWarnings( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
m_aLastWarning = SQLWarning();
}
@@ -612,8 +612,8 @@ sal_Int32 OStatement_Base::getMaxFieldSize() const throw(SQLException, RuntimeEx
void OStatement_Base::setQueryTimeOut(sal_Int32 seconds) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
m_Command.put_CommandTimeout(seconds);
}
@@ -621,8 +621,8 @@ void OStatement_Base::setQueryTimeOut(sal_Int32 seconds) throw(SQLException, Run
void OStatement_Base::setMaxRows(sal_Int32 _par0) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
m_nMaxRows = _par0;
}
@@ -630,8 +630,8 @@ void OStatement_Base::setMaxRows(sal_Int32 _par0) throw(SQLException, RuntimeExc
void OStatement_Base::setResultSetConcurrency(sal_Int32 _par0) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
switch(_par0)
{
@@ -647,8 +647,8 @@ void OStatement_Base::setResultSetConcurrency(sal_Int32 _par0) throw(SQLExceptio
void OStatement_Base::setResultSetType(sal_Int32 _par0) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
switch(_par0)
{
@@ -667,15 +667,15 @@ void OStatement_Base::setResultSetType(sal_Int32 _par0) throw(SQLException, Runt
void OStatement_Base::setFetchDirection(sal_Int32 _par0) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
}
//------------------------------------------------------------------------------
void OStatement_Base::setFetchSize(sal_Int32 _par0) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
m_nFetchSize = _par0;
// m_RecordSet.put_CacheSize(_par0);
@@ -684,16 +684,16 @@ void OStatement_Base::setFetchSize(sal_Int32 _par0) throw(SQLException, RuntimeE
void OStatement_Base::setMaxFieldSize(sal_Int32 _par0) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
}
//------------------------------------------------------------------------------
void OStatement_Base::setCursorName(const ::rtl::OUString &_par0) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OStatement_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+
m_Command.put_Name(_par0);
}
diff --git a/connectivity/source/drivers/ado/ATable.cxx b/connectivity/source/drivers/ado/ATable.cxx
index 34a2a42d3b46..d239a155d11b 100644
--- a/connectivity/source/drivers/ado/ATable.cxx
+++ b/connectivity/source/drivers/ado/ATable.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ATable.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:26:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -267,8 +267,8 @@ sal_Int64 OAdoTable::getSomething( const Sequence< sal_Int8 > & rId ) throw (Run
void SAL_CALL OAdoTable::rename( const ::rtl::OUString& newName ) throw(SQLException, ElementExistException, RuntimeException)
{
::osl::MutexGuard aGuard(m_aMutex);
- if (rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(rBHelper.bDisposed);
+
m_aTable.put_Name(newName);
}
@@ -277,8 +277,8 @@ void SAL_CALL OAdoTable::rename( const ::rtl::OUString& newName ) throw(SQLExcep
void SAL_CALL OAdoTable::alterColumnByName( const ::rtl::OUString& colName, const Reference< XPropertySet >& descriptor ) throw(SQLException, NoSuchElementException, RuntimeException)
{
::osl::MutexGuard aGuard(m_aMutex);
- if (rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(rBHelper.bDisposed);
+
Reference< ::com::sun::star::lang::XUnoTunnel> xTunnel(descriptor,UNO_QUERY);
if(xTunnel.is())
@@ -300,8 +300,8 @@ void SAL_CALL OAdoTable::alterColumnByName( const ::rtl::OUString& colName, cons
void SAL_CALL OAdoTable::alterColumnByIndex( sal_Int32 index, const Reference< XPropertySet >& descriptor ) throw(SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, RuntimeException)
{
::osl::MutexGuard aGuard(m_aMutex);
- if (rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(rBHelper.bDisposed);
+
Reference< ::com::sun::star::lang::XUnoTunnel> xTunnel(descriptor,UNO_QUERY);
if(xTunnel.is())
diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx
index bc91fa2c2530..e98093d4ebb5 100644
--- a/connectivity/source/drivers/ado/Awrapado.cxx
+++ b/connectivity/source/drivers/ado/Awrapado.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: Awrapado.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:42:44 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:26:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,6 +61,9 @@
#ifndef _CONNECTIVITY_ADO_AWRAPADO_HXX_
#include "ado/Awrapado.hxx"
#endif
+#ifndef _CONNECTIVITY_ADO_AWRAPADOX_HXX_
+#include "ado/Awrapadox.hxx"
+#endif
using namespace connectivity::ado;
@@ -892,3 +895,429 @@ CompareEnum WpADORecordset::CompareBookmarks(const OLEVariant& left,const OLEVar
{
return (SUCCEEDED(pInterface->put_Value(aVariant)));
}
+
+ ::rtl::OUString WpADOColumn::get_Name() const
+{
+ OLEString aBSTR;
+ pInterface->get_Name(&aBSTR);
+ return aBSTR;
+}
+::rtl::OUString WpADOColumn::get_RelatedColumn() const
+{
+ OLEString aBSTR;
+ pInterface->get_RelatedColumn(&aBSTR);
+ return aBSTR;
+}
+
+void WpADOColumn::put_Name(const ::rtl::OUString& _rName)
+{
+ OLEString bstr(_rName);
+ sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
+}
+void WpADOColumn::put_RelatedColumn(const ::rtl::OUString& _rName)
+{
+ OLEString bstr(_rName);
+ sal_Bool bErg = SUCCEEDED(pInterface->put_RelatedColumn(bstr));
+}
+
+DataTypeEnum WpADOColumn::get_Type() const
+{
+ DataTypeEnum eNum = adVarChar;
+ pInterface->get_Type(&eNum);
+ return eNum;
+}
+
+void WpADOColumn::put_Type(const DataTypeEnum& _eNum)
+{
+ pInterface->put_Type(_eNum);
+}
+
+sal_Int32 WpADOColumn::get_Precision() const
+{
+ sal_Int32 nPrec=0;
+ pInterface->get_Precision(&nPrec);
+ return nPrec;
+}
+
+void WpADOColumn::put_Precision(sal_Int32 _nPre)
+{
+ pInterface->put_Precision(_nPre);
+}
+
+sal_Int32 WpADOColumn::get_NumericScale() const
+{
+ sal_uInt8 nPrec=0;
+ pInterface->get_NumericScale(&nPrec);
+ return nPrec;
+}
+
+void WpADOColumn::put_NumericScale(sal_Int8 _nScale)
+{
+ pInterface->put_NumericScale(_nScale);
+}
+
+SortOrderEnum WpADOColumn::get_SortOrder() const
+{
+ SortOrderEnum nPrec=adSortAscending;
+ pInterface->get_SortOrder(&nPrec);
+ return nPrec;
+}
+
+void WpADOColumn::put_SortOrder(SortOrderEnum _nScale)
+{
+ pInterface->put_SortOrder(_nScale);
+}
+
+ColumnAttributesEnum WpADOColumn::get_Attributes() const
+{
+ ColumnAttributesEnum eNum=adColNullable;
+ pInterface->get_Attributes(&eNum);
+ return eNum;
+}
+
+void WpADOColumn::put_Attributes(const ColumnAttributesEnum& _eNum)
+{
+ pInterface->put_Attributes(_eNum);
+}
+
+ADOProperties* WpADOColumn::get_Properties() const
+{
+ ADOProperties* pProps = NULL;
+ pInterface->get_Properties(&pProps);
+ return pProps;
+}
+
+::rtl::OUString WpADOKey::get_Name() const
+{
+ OLEString aBSTR;
+ pInterface->get_Name(&aBSTR);
+ return aBSTR;
+}
+
+void WpADOKey::put_Name(const ::rtl::OUString& _rName)
+{
+ OLEString bstr(_rName);
+ sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
+
+}
+
+KeyTypeEnum WpADOKey::get_Type() const
+{
+ KeyTypeEnum eNum=adKeyPrimary;
+ pInterface->get_Type(&eNum);
+ return eNum;
+}
+
+void WpADOKey::put_Type(const KeyTypeEnum& _eNum)
+{
+ pInterface->put_Type(_eNum);
+}
+
+::rtl::OUString WpADOKey::get_RelatedTable() const
+{
+ OLEString aBSTR;
+ pInterface->get_RelatedTable(&aBSTR);
+ return aBSTR;
+}
+
+void WpADOKey::put_RelatedTable(const ::rtl::OUString& _rName)
+{
+ OLEString bstr(_rName);
+ sal_Bool bErg = SUCCEEDED(pInterface->put_RelatedTable(bstr));
+
+}
+
+RuleEnum WpADOKey::get_DeleteRule() const
+{
+ RuleEnum eNum = adRINone;
+ pInterface->get_DeleteRule(&eNum);
+ return eNum;
+}
+
+void WpADOKey::put_DeleteRule(const RuleEnum& _eNum)
+{
+ pInterface->put_DeleteRule(_eNum);
+}
+
+RuleEnum WpADOKey::get_UpdateRule() const
+{
+ RuleEnum eNum = adRINone;
+ pInterface->get_UpdateRule(&eNum);
+ return eNum;
+}
+
+void WpADOKey::put_UpdateRule(const RuleEnum& _eNum)
+{
+ pInterface->put_UpdateRule(_eNum);
+}
+
+ADOColumns* WpADOKey::get_Columns() const
+{
+ ADOColumns* pCols = NULL;
+ pInterface->get_Columns(&pCols);
+ return pCols;
+}
+
+::rtl::OUString WpADOIndex::get_Name() const
+{
+ OLEString aBSTR;
+ pInterface->get_Name(&aBSTR);
+ return aBSTR;
+}
+
+void WpADOIndex::put_Name(const ::rtl::OUString& _rName)
+{
+ OLEString bstr(_rName);
+ sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
+
+}
+
+sal_Bool WpADOIndex::get_Clustered() const
+{
+ VARIANT_BOOL eNum = VARIANT_FALSE;
+ pInterface->get_Clustered(&eNum);
+ return eNum == VARIANT_TRUE;
+}
+
+void WpADOIndex::put_Clustered(sal_Bool _b)
+{
+ pInterface->put_Clustered(_b ? VARIANT_TRUE : VARIANT_FALSE);
+}
+
+sal_Bool WpADOIndex::get_Unique() const
+{
+ VARIANT_BOOL eNum = VARIANT_FALSE;
+ pInterface->get_Unique(&eNum);
+ return eNum == VARIANT_TRUE;
+}
+
+void WpADOIndex::put_Unique(sal_Bool _b)
+{
+ pInterface->put_Unique(_b ? VARIANT_TRUE : VARIANT_FALSE);
+}
+
+sal_Bool WpADOIndex::get_PrimaryKey() const
+{
+ VARIANT_BOOL eNum = VARIANT_FALSE;
+ pInterface->get_PrimaryKey(&eNum);
+ return eNum == VARIANT_TRUE;
+}
+
+void WpADOIndex::put_PrimaryKey(sal_Bool _b)
+{
+ pInterface->put_PrimaryKey(_b ? VARIANT_TRUE : VARIANT_FALSE);
+}
+
+ADOColumns* WpADOIndex::get_Columns() const
+{
+ ADOColumns* pCols = NULL;
+ pInterface->get_Columns(&pCols);
+ return pCols;
+}
+
+void WpADOCatalog::putref_ActiveConnection(IDispatch* pCon)
+{
+ pInterface->putref_ActiveConnection(pCon);
+}
+
+ADOTables* WpADOCatalog::get_Tables()
+{
+ ADOTables* pRet = NULL;
+ pInterface->get_Tables(&pRet);
+ return pRet;
+}
+
+ADOViews* WpADOCatalog::get_Views()
+{
+ ADOViews* pRet = NULL;
+ pInterface->get_Views(&pRet);
+ return pRet;
+}
+
+ADOGroups* WpADOCatalog::get_Groups()
+{
+ ADOGroups* pRet = NULL;
+ pInterface->get_Groups(&pRet);
+ return pRet;
+}
+
+ADOUsers* WpADOCatalog::get_Users()
+{
+ ADOUsers* pRet = NULL;
+ pInterface->get_Users(&pRet);
+ return pRet;
+}
+
+ADOProcedures* WpADOCatalog::get_Procedures()
+{
+ ADOProcedures* pRet = NULL;
+ pInterface->get_Procedures(&pRet);
+ return pRet;
+}
+
+::rtl::OUString WpADOTable::get_Name() const
+{
+ OLEString aBSTR;
+ pInterface->get_Name(&aBSTR);
+ return aBSTR;
+}
+
+void WpADOTable::put_Name(const ::rtl::OUString& _rName)
+{
+ OLEString bstr(_rName);
+ sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
+
+}
+
+::rtl::OUString WpADOTable::get_Type() const
+{
+ OLEString aBSTR;
+ pInterface->get_Type(&aBSTR);
+ return aBSTR;
+}
+
+ADOColumns* WpADOTable::get_Columns() const
+{
+ ADOColumns* pCols = NULL;
+ pInterface->get_Columns(&pCols);
+ return pCols;
+}
+
+ADOIndexes* WpADOTable::get_Indexes() const
+{
+ ADOIndexes* pCols = NULL;
+ pInterface->get_Indexes(&pCols);
+ return pCols;
+}
+
+ADOKeys* WpADOTable::get_Keys() const
+{
+ ADOKeys* pCols = NULL;
+ pInterface->get_Keys(&pCols);
+ return pCols;
+}
+
+WpADOCatalog WpADOTable::get_ParentCatalog() const
+{
+ ADOCatalog* pCat = NULL;
+ pInterface->get_ParentCatalog(&pCat);
+ return WpADOCatalog(pCat);
+}
+
+ADOProperties* WpADOTable::get_Properties() const
+{
+ ADOProperties* pProps = NULL;
+ pInterface->get_Properties(&pProps);
+ return pProps;
+}
+
+::rtl::OUString WpADOView::get_Name() const
+{
+ OLEString aBSTR;
+ pInterface->get_Name(&aBSTR);
+ return aBSTR;
+}
+
+void WpADOView::get_Command(OLEVariant& _rVar) const
+{
+ pInterface->get_Command(&_rVar);
+}
+
+void WpADOView::put_Command(OLEVariant& _rVar)
+{
+ pInterface->put_Command(_rVar);
+}
+
+::rtl::OUString WpADOGroup::get_Name() const
+{
+ OLEString aBSTR;
+ pInterface->get_Name(&aBSTR);
+ return aBSTR;
+}
+
+void WpADOGroup::put_Name(const ::rtl::OUString& _rName)
+{
+ OLEString bstr(_rName);
+ sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
+
+}
+
+RightsEnum WpADOGroup::GetPermissions(
+ /* [in] */ const OLEVariant& Name,
+ /* [in] */ ObjectTypeEnum ObjectType)
+{
+ RightsEnum Rights=adRightNone;
+ OLEVariant ObjectTypeId;
+ ObjectTypeId.setNoArg();
+ pInterface->GetPermissions(Name,ObjectType,ObjectTypeId,&Rights);
+ return Rights;
+}
+
+sal_Bool WpADOGroup::SetPermissions(
+ /* [in] */ const OLEVariant& Name,
+ /* [in] */ ObjectTypeEnum ObjectType,
+ /* [in] */ ActionEnum Action,
+ /* [in] */ RightsEnum Rights)
+{
+ OLEVariant ObjectTypeId;
+ ObjectTypeId.setNoArg();
+ return SUCCEEDED(pInterface->SetPermissions(Name,ObjectType,Action,Rights,adInheritNone,ObjectTypeId));
+}
+
+ADOUsers* WpADOGroup::get_Users( )
+{
+ ADOUsers* pRet = NULL;
+ pInterface->get_Users( &pRet);
+ return pRet;
+}
+
+::rtl::OUString WpADOUser::get_Name() const
+{
+ OLEString aBSTR;
+ pInterface->get_Name(&aBSTR);
+ return aBSTR;
+}
+
+void WpADOUser::put_Name(const ::rtl::OUString& _rName)
+{
+ OLEString bstr(_rName);
+ sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
+
+}
+
+sal_Bool WpADOUser::ChangePassword(const ::rtl::OUString& _rPwd,const ::rtl::OUString& _rNewPwd)
+{
+ OLEString sStr1(_rPwd);
+ OLEString sStr2(_rNewPwd);
+ sal_Bool bErg = SUCCEEDED(pInterface->ChangePassword(sStr1,sStr2));
+ return bErg;
+}
+
+ADOGroups* WpADOUser::get_Groups()
+{
+ ADOGroups* pRet = NULL;
+ pInterface->get_Groups(&pRet);
+ return pRet;
+}
+
+RightsEnum WpADOUser::GetPermissions(
+ /* [in] */ const OLEVariant& Name,
+ /* [in] */ ObjectTypeEnum ObjectType)
+{
+ RightsEnum Rights=adRightNone;
+ OLEVariant ObjectTypeId;
+ ObjectTypeId.setNoArg();
+ pInterface->GetPermissions(Name,ObjectType,ObjectTypeId,&Rights);
+ return Rights;
+}
+
+sal_Bool WpADOUser::SetPermissions(
+ /* [in] */ const OLEVariant& Name,
+ /* [in] */ ObjectTypeEnum ObjectType,
+ /* [in] */ ActionEnum Action,
+ /* [in] */ RightsEnum Rights)
+{
+ OLEVariant ObjectTypeId;
+ ObjectTypeId.setNoArg();
+ return SUCCEEDED(pInterface->SetPermissions(Name,ObjectType,Action,Rights,adInheritNone,ObjectTypeId));
+} \ No newline at end of file
diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx
index ee7185083873..95f3885c30ac 100644
--- a/connectivity/source/drivers/calc/CConnection.cxx
+++ b/connectivity/source/drivers/calc/CConnection.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: CConnection.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: oj $ $Date: 2001-04-27 10:08:09 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:26:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -196,8 +196,8 @@ IMPLEMENT_SERVICE_INFO(OCalcConnection, "com.sun.star.sdbc.drivers.calc.Connecti
Reference< XDatabaseMetaData > SAL_CALL OCalcConnection::getMetaData( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
if(!xMetaData.is())
@@ -229,8 +229,8 @@ Reference< XDatabaseMetaData > SAL_CALL OCalcConnection::getMetaData( ) throw(S
Reference< XStatement > SAL_CALL OCalcConnection::createStatement( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
Reference< XStatement > xReturn = new OCalcStatement(this);
m_aStatements.push_back(WeakReferenceHelper(xReturn));
@@ -243,10 +243,10 @@ Reference< XPreparedStatement > SAL_CALL OCalcConnection::prepareStatement( cons
throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- OCalcPreparedStatement* pStmt = new OCalcPreparedStatement(this,m_aTypeInfo);
+
+ OCalcPreparedStatement* pStmt = new OCalcPreparedStatement(this);
Reference< XPreparedStatement > xHoldAlive = pStmt;
pStmt->construct(sql);
m_aStatements.push_back(WeakReferenceHelper(*pStmt));
@@ -259,8 +259,8 @@ Reference< XPreparedStatement > SAL_CALL OCalcConnection::prepareCall( const ::r
throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OConnection_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OConnection_BASE::rBHelper.bDisposed);
+
return NULL;
}
diff --git a/connectivity/source/drivers/jdbc/JDriver.cxx b/connectivity/source/drivers/jdbc/JDriver.cxx
index d3cd193cd0fa..36bf22da34e5 100644
--- a/connectivity/source/drivers/jdbc/JDriver.cxx
+++ b/connectivity/source/drivers/jdbc/JDriver.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: JDriver.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: oj $ $Date: 2001-05-09 12:58:20 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:26:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -134,11 +134,11 @@ sal_Bool SAL_CALL java_sql_Driver::supportsService( const ::rtl::OUString& _rSer
{
Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
const ::rtl::OUString* pSupported = aSupported.getConstArray();
- for (sal_Int32 i=0; i<aSupported.getLength(); ++i, ++pSupported)
- if (pSupported->equals(_rServiceName))
- return sal_True;
+ const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
+ for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
+ ;
- return sal_False;
+ return pSupported != pEnd;
}
// --------------------------------------------------------------------------------
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx
index 8978b625692e..b5691c0a82a9 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: mdrivermanager.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: fs $ $Date: 2001-03-15 08:54:31 $
+ * last change: $Author: oj $ $Date: 2001-05-17 07:26:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,6 +94,11 @@ using namespace ::osl;
#define SERVICE_SDBC_DRIVER ::rtl::OUString::createFromAscii("com.sun.star.sdbc.Driver")
+void throwNoSuchElementException() throw(NoSuchElementException)
+{
+ throw NoSuchElementException();
+}
+
//==========================================================================
//= ODriverEnumeration
//==========================================================================
@@ -101,10 +106,9 @@ class ODriverEnumeration : public ::cppu::ImplHelper1< XEnumeration >
{
friend class OSDBCDriverManager;
- oslInterlockedCount m_refCount;
-
DECLARE_STL_VECTOR(OSDBCDriverManager::SdbcDriver, Drivers);
Drivers m_aDrivers;
+ oslInterlockedCount m_refCount;
sal_Int32 m_nPos;
~ODriverEnumeration();
@@ -154,7 +158,7 @@ sal_Bool SAL_CALL ODriverEnumeration::hasMoreElements( ) throw(RuntimeException
Any SAL_CALL ODriverEnumeration::nextElement( ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
{
if (!hasMoreElements())
- throw NoSuchElementException();
+ throwNoSuchElementException();
return makeAny(m_aDrivers[m_nPos++]);
}
@@ -175,17 +179,15 @@ OSDBCDriverManager::OSDBCDriverManager(const Reference< XMultiServiceFactory >&
if (xEnumDrivers.is())
{
+ Reference< XSingleServiceFactory > xFactory;
while (xEnumDrivers->hasMoreElements())
{
- Any aCurrent = xEnumDrivers->nextElement();
- Reference< XSingleServiceFactory > xFactory;
-
- if (!::cppu::extractInterface(xFactory, aCurrent))
- continue;
-
- Reference< XDriver > xDriver(xFactory->createInstance(), UNO_QUERY);
- if (xDriver.is())
- m_aDriversBS.push_back(xDriver);
+ if (::cppu::extractInterface(xFactory, xEnumDrivers->nextElement()))
+ {
+ Reference< XDriver > xDriver(xFactory->createInstance(), UNO_QUERY);
+ if (xDriver.is())
+ m_aDriversBS.push_back(xDriver);
+ }
}
}
}
@@ -274,21 +276,19 @@ sal_Bool SAL_CALL OSDBCDriverManager::hasElements( ) throw(::com::sun::star::un
//--------------------------------------------------------------------------
::rtl::OUString SAL_CALL OSDBCDriverManager::getImplementationName( ) throw(RuntimeException)
{
- MutexGuard aGuard(m_aMutex);
return getImplementationName_Static();
}
//--------------------------------------------------------------------------
sal_Bool SAL_CALL OSDBCDriverManager::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
{
- MutexGuard aGuard(m_aMutex);
Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
const ::rtl::OUString* pSupported = aSupported.getConstArray();
- for (sal_Int32 i=0; i<aSupported.getLength(); ++i, ++pSupported)
- if (pSupported->equals(_rServiceName))
- return sal_True;
+ const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
+ for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
+ ;
- return sal_False;
+ return pSupported != pEnd;
}
//--------------------------------------------------------------------------
@@ -323,7 +323,7 @@ Reference< XInterface > SAL_CALL OSDBCDriverManager::getRegisteredObject( const
MutexGuard aGuard(m_aMutex);
ConstRuntimeDriversIterator aSearch = m_aDriversRT.find(_rName);
if (aSearch == m_aDriversRT.end())
- throw NoSuchElementException();
+ throwNoSuchElementException();
return aSearch->second;
}
@@ -333,14 +333,16 @@ void SAL_CALL OSDBCDriverManager::registerObject( const ::rtl::OUString& _rName,
{
MutexGuard aGuard(m_aMutex);
ConstRuntimeDriversIterator aSearch = m_aDriversRT.find(_rName);
- if (aSearch != m_aDriversRT.end())
+ if (aSearch == m_aDriversRT.end())
+ {
+ Reference< XDriver > xNewDriver(_rxObject, UNO_QUERY);
+ if (xNewDriver.is())
+ m_aDriversRT[_rName] = xNewDriver;
+ else
+ throw IllegalArgumentException();
+ }
+ else
throw ElementExistException();
-
- Reference< XDriver > xNewDriver(_rxObject, UNO_QUERY);
- if (!xNewDriver.is())
- throw IllegalArgumentException();
-
- m_aDriversRT[_rName] = xNewDriver;
}
//--------------------------------------------------------------------------
@@ -349,7 +351,7 @@ void SAL_CALL OSDBCDriverManager::revokeObject( const ::rtl::OUString& _rName )
MutexGuard aGuard(m_aMutex);
ConstRuntimeDriversIterator aSearch = m_aDriversRT.find(_rName);
if (aSearch == m_aDriversRT.end())
- throw NoSuchElementException();
+ throwNoSuchElementException();
m_aDriversRT.erase(_rName);
}