diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-11 11:06:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-25 07:19:13 +0100 |
commit | b1cfdb7bee4f7af97af54e6abbc5d04aed4ba082 (patch) | |
tree | 8211ea564e36152b9eeb7be7212342d9e82800c6 /dbaccess | |
parent | 26b81b23f0ad061b6d44fcea3e07ae4b18a63f94 (diff) |
new loplugin:unoquery
look for places we are doing code like:
Reference<XProperty>(model, css::uno::UNO_QUERY)->getAsProperty()
which might result in a SIGSEGV is the query fails
Change-Id: I5cbdbc9e64bd0bed588297c512bf60cbacb9442e
Reviewed-on: https://gerrit.libreoffice.org/69044
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/CacheSet.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/api/KeySet.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/api/OptimisticSet.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetCache.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/api/TableDeco.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/api/callablestatement.cxx | 44 | ||||
-rw-r--r-- | dbaccess/source/core/api/querycomposer.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/api/querycontainer.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/api/resultset.cxx | 22 | ||||
-rw-r--r-- | dbaccess/source/core/api/statement.cxx | 42 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppController.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/queryfilter.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/queryorder.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/RowSetDrop.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/TokenWriter.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/UITools.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/relationdesign/RelationTableView.cxx | 2 |
17 files changed, 77 insertions, 77 deletions
diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx index dcfdb71266ff..62020e68d4db 100644 --- a/dbaccess/source/core/api/CacheSet.cxx +++ b/dbaccess/source/core/api/CacheSet.cxx @@ -85,7 +85,7 @@ void OCacheSet::construct( const Reference< XResultSet>& _xDriverSet,const OUSt { m_xDriverSet = _xDriverSet; m_xDriverRow.set(_xDriverSet,UNO_QUERY); - m_xSetMetaData = Reference<XResultSetMetaDataSupplier>(_xDriverSet,UNO_QUERY)->getMetaData(); + m_xSetMetaData = Reference<XResultSetMetaDataSupplier>(_xDriverSet,UNO_QUERY_THROW)->getMetaData(); if ( m_xSetMetaData.is() ) { const sal_Int32 nCount = m_xSetMetaData->getColumnCount(); @@ -218,7 +218,7 @@ void OCacheSet::fillParameters( const ORowSetRow& _rRow && comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISUNIQUE)) && !comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISPRIMARYKEYINDEX)) ) - aAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY)->getColumns()); + aAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY_THROW)->getColumns()); } } @@ -342,7 +342,7 @@ void OCacheSet::deleteRow(const ORowSetRow& _rDeleteRow ,const connectivity::OSQ && comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISUNIQUE)) && !comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISPRIMARYKEYINDEX)) ) - aAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY)->getColumns()); + aAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY_THROW)->getColumns()); } } diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index f057b3de14e6..3c9b62b5d0ab 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -81,7 +81,7 @@ namespace && comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISUNIQUE)) && !comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISPRIMARYKEYINDEX)) ) - _rAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY)->getColumns()); + _rAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY_THROW)->getColumns()); } } } diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index bf272f18471a..614c540e115d 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -91,7 +91,7 @@ OptimisticSet::OptimisticSet(const Reference<XComponentContext>& _rContext, sal_Int32& o_nRowCount) :OKeySet(nullptr,nullptr,OUString(),_xComposer,_aParameterValueForCache,i_nMaxRows,o_nRowCount) ,m_aSqlParser( _rContext ) - ,m_aSqlIterator( i_xConnection, Reference<XTablesSupplier>(_xComposer,UNO_QUERY)->getTables(), m_aSqlParser ) + ,m_aSqlIterator( i_xConnection, Reference<XTablesSupplier>(_xComposer,UNO_QUERY_THROW)->getTables(), m_aSqlParser ) ,m_bResultSetChanged(false) { } diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index f05caa68c3c1..544d9269bcd8 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -90,7 +90,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, const OUString& i_sRowSetFilter, sal_Int32 i_nMaxRows) :m_xSet(_xRs) - ,m_xMetaData(Reference< XResultSetMetaDataSupplier >(_xRs,UNO_QUERY)->getMetaData()) + ,m_xMetaData(Reference< XResultSetMetaDataSupplier >(_xRs,UNO_QUERY_THROW)->getMetaData()) ,m_aContext( _rContext ) ,m_nFetchSize(0) ,m_nRowCount(0) @@ -1693,7 +1693,7 @@ bool ORowSetCache::isResultSetChanged() const void ORowSetCache::reset(const Reference< XResultSet>& _xDriverSet) { m_xSet = _xDriverSet; - m_xMetaData.set(Reference< XResultSetMetaDataSupplier >(_xDriverSet,UNO_QUERY)->getMetaData()); + m_xMetaData.set(Reference< XResultSetMetaDataSupplier >(_xDriverSet,UNO_QUERY_THROW)->getMetaData()); m_xCacheSet->reset(_xDriverSet); m_bRowCountFinal = false; diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx index 0744d7fcff5d..1c229802b43d 100644 --- a/dbaccess/source/core/api/TableDeco.cxx +++ b/dbaccess/source/core/api/TableDeco.cxx @@ -420,14 +420,14 @@ Reference< XNameAccess> ODBTableDecorator::getIndexes() { ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed); - return Reference< XIndexesSupplier>(m_xTable,UNO_QUERY)->getIndexes(); + return Reference< XIndexesSupplier>(m_xTable,UNO_QUERY_THROW)->getIndexes(); } Reference< XIndexAccess> ODBTableDecorator::getKeys() { ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed); - return Reference< XKeysSupplier>(m_xTable,UNO_QUERY)->getKeys(); + return Reference< XKeysSupplier>(m_xTable,UNO_QUERY_THROW)->getKeys(); } Reference< XNameAccess> ODBTableDecorator::getColumns() diff --git a/dbaccess/source/core/api/callablestatement.cxx b/dbaccess/source/core/api/callablestatement.cxx index cbf9ad8ab874..2f888596d026 100644 --- a/dbaccess/source/core/api/callablestatement.cxx +++ b/dbaccess/source/core/api/callablestatement.cxx @@ -91,7 +91,7 @@ void SAL_CALL OCallableStatement::registerOutParameter( sal_Int32 parameterIndex ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY)->registerOutParameter( parameterIndex, sqlType, typeName ); + Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY_THROW)->registerOutParameter( parameterIndex, sqlType, typeName ); } void SAL_CALL OCallableStatement::registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale ) @@ -99,7 +99,7 @@ void SAL_CALL OCallableStatement::registerNumericOutParameter( sal_Int32 paramet MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY)->registerNumericOutParameter( parameterIndex, sqlType, scale ); + Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY_THROW)->registerNumericOutParameter( parameterIndex, sqlType, scale ); } // XRow @@ -108,7 +108,7 @@ sal_Bool SAL_CALL OCallableStatement::wasNull( ) MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->wasNull(); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->wasNull(); } OUString SAL_CALL OCallableStatement::getString( sal_Int32 columnIndex ) @@ -116,7 +116,7 @@ OUString SAL_CALL OCallableStatement::getString( sal_Int32 columnIndex ) MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getString( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getString( columnIndex ); } sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 columnIndex ) @@ -124,7 +124,7 @@ sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 columnIndex ) MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getBoolean( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBoolean( columnIndex ); } sal_Int8 SAL_CALL OCallableStatement::getByte( sal_Int32 columnIndex ) @@ -132,63 +132,63 @@ sal_Int8 SAL_CALL OCallableStatement::getByte( sal_Int32 columnIndex ) MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getByte( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getByte( columnIndex ); } sal_Int16 SAL_CALL OCallableStatement::getShort( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getShort( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getShort( columnIndex ); } sal_Int32 SAL_CALL OCallableStatement::getInt( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getInt( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getInt( columnIndex ); } sal_Int64 SAL_CALL OCallableStatement::getLong( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getLong( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getLong( columnIndex ); } float SAL_CALL OCallableStatement::getFloat( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getFloat( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getFloat( columnIndex ); } double SAL_CALL OCallableStatement::getDouble( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getDouble( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getDouble( columnIndex ); } Sequence< sal_Int8 > SAL_CALL OCallableStatement::getBytes( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getBytes( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBytes( columnIndex ); } css::util::Date SAL_CALL OCallableStatement::getDate( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getDate( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getDate( columnIndex ); } css::util::Time SAL_CALL OCallableStatement::getTime( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getTime( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getTime( columnIndex ); } css::util::DateTime SAL_CALL OCallableStatement::getTimestamp( sal_Int32 columnIndex ) @@ -196,7 +196,7 @@ css::util::DateTime SAL_CALL OCallableStatement::getTimestamp( sal_Int32 columnI MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getTimestamp( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getTimestamp( columnIndex ); } Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getBinaryStream( sal_Int32 columnIndex ) @@ -204,7 +204,7 @@ Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getBinaryStream( MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getBinaryStream( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBinaryStream( columnIndex ); } Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getCharacterStream( sal_Int32 columnIndex ) @@ -212,7 +212,7 @@ Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getCharacterStre MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getCharacterStream( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getCharacterStream( columnIndex ); } Any SAL_CALL OCallableStatement::getObject( sal_Int32 columnIndex, const Reference< css::container::XNameAccess >& typeMap ) @@ -220,35 +220,35 @@ Any SAL_CALL OCallableStatement::getObject( sal_Int32 columnIndex, const Referen MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getObject( columnIndex, typeMap ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getObject( columnIndex, typeMap ); } Reference< XRef > SAL_CALL OCallableStatement::getRef( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getRef( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getRef( columnIndex ); } Reference< XBlob > SAL_CALL OCallableStatement::getBlob( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getBlob( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBlob( columnIndex ); } Reference< XClob > SAL_CALL OCallableStatement::getClob( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getClob( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getClob( columnIndex ); } Reference< XArray > SAL_CALL OCallableStatement::getArray( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getArray( columnIndex ); + return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getArray( columnIndex ); } diff --git a/dbaccess/source/core/api/querycomposer.cxx b/dbaccess/source/core/api/querycomposer.cxx index d000aabe3329..41a0c628ba47 100644 --- a/dbaccess/source/core/api/querycomposer.cxx +++ b/dbaccess/source/core/api/querycomposer.cxx @@ -247,7 +247,7 @@ Reference< XNameAccess > SAL_CALL OQueryComposer::getTables( ) ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed); ::osl::MutexGuard aGuard( m_aMutex ); - return Reference<XTablesSupplier>(m_xComposer,UNO_QUERY)->getTables(); + return Reference<XTablesSupplier>(m_xComposer,UNO_QUERY_THROW)->getTables(); } // XColumnsSupplier @@ -256,7 +256,7 @@ Reference< XNameAccess > SAL_CALL OQueryComposer::getColumns( ) ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed); ::osl::MutexGuard aGuard( m_aMutex ); - return Reference<XColumnsSupplier>(m_xComposer,UNO_QUERY)->getColumns(); + return Reference<XColumnsSupplier>(m_xComposer,UNO_QUERY_THROW)->getColumns(); } Reference< XIndexAccess > SAL_CALL OQueryComposer::getParameters( ) @@ -264,7 +264,7 @@ Reference< XIndexAccess > SAL_CALL OQueryComposer::getParameters( ) ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed); ::osl::MutexGuard aGuard( m_aMutex ); - return Reference<XParametersSupplier>(m_xComposer,UNO_QUERY)->getParameters(); + return Reference<XParametersSupplier>(m_xComposer,UNO_QUERY_THROW)->getParameters(); } void SAL_CALL OQueryComposer::acquire() throw() diff --git a/dbaccess/source/core/api/querycontainer.cxx b/dbaccess/source/core/api/querycontainer.cxx index dea302029dce..4e5ba761398b 100644 --- a/dbaccess/source/core/api/querycontainer.cxx +++ b/dbaccess/source/core/api/querycontainer.cxx @@ -221,7 +221,7 @@ void SAL_CALL OQueryContainer::dropByIndex( sal_Int32 _nIndex ) throw DisposedException( OUString(), *this ); OUString sName; - Reference<XPropertySet> xProp(Reference<XIndexAccess>(m_xCommandDefinitions,UNO_QUERY)->getByIndex(_nIndex),UNO_QUERY); + Reference<XPropertySet> xProp(Reference<XIndexAccess>(m_xCommandDefinitions,UNO_QUERY_THROW)->getByIndex(_nIndex),UNO_QUERY); if ( xProp.is() ) xProp->getPropertyValue(PROPERTY_NAME) >>= sName; @@ -401,7 +401,7 @@ sal_Bool SAL_CALL OQueryContainer::hasElements( ) sal_Int32 SAL_CALL OQueryContainer::getCount( ) { MutexGuard aGuard(m_aMutex); - return Reference<XIndexAccess>(m_xCommandDefinitions,UNO_QUERY)->getCount(); + return Reference<XIndexAccess>(m_xCommandDefinitions,UNO_QUERY_THROW)->getCount(); } Sequence< OUString > SAL_CALL OQueryContainer::getElementNames( ) diff --git a/dbaccess/source/core/api/resultset.cxx b/dbaccess/source/core/api/resultset.cxx index 715f4465ff22..9eb66c68a1a4 100644 --- a/dbaccess/source/core/api/resultset.cxx +++ b/dbaccess/source/core/api/resultset.cxx @@ -147,7 +147,7 @@ void OResultSet::disposing() m_pColumns->disposing(); // close the pending result set - Reference< XCloseable > (m_xDelegatorResultSet, UNO_QUERY)->close(); + Reference< XCloseable > (m_xDelegatorResultSet, UNO_QUERY_THROW)->close(); m_xDelegatorResultSet = nullptr; m_xDelegatorRow = nullptr; @@ -253,7 +253,7 @@ void OResultSet::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const OSL_ENSURE(!aPropName.isEmpty(), "property not found?"); // now read the value - rValue = Reference< XPropertySet >(m_xDelegatorResultSet, UNO_QUERY)->getPropertyValue(aPropName); + rValue = Reference< XPropertySet >(m_xDelegatorResultSet, UNO_QUERY_THROW)->getPropertyValue(aPropName); } } } @@ -279,7 +279,7 @@ Reference< XResultSetMetaData > OResultSet::getMetaData() MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); - return Reference< XResultSetMetaDataSupplier >(m_xDelegatorResultSet, UNO_QUERY)->getMetaData(); + return Reference< XResultSetMetaDataSupplier >(m_xDelegatorResultSet, UNO_QUERY_THROW)->getMetaData(); } // css::sdbc::XColumnLocate @@ -288,7 +288,7 @@ sal_Int32 OResultSet::findColumn(const OUString& columnName) MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); - return Reference< XColumnLocate >(m_xDelegatorResultSet, UNO_QUERY)->findColumn(columnName); + return Reference< XColumnLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->findColumn(columnName); } namespace @@ -326,7 +326,7 @@ Reference< css::container::XNameAccess > OResultSet::getColumns() if (!m_pColumns->isInitialized()) { // get the metadata - Reference< XResultSetMetaData > xMetaData = Reference< XResultSetMetaDataSupplier >(m_xDelegatorResultSet, UNO_QUERY)->getMetaData(); + Reference< XResultSetMetaData > xMetaData = Reference< XResultSetMetaDataSupplier >(m_xDelegatorResultSet, UNO_QUERY_THROW)->getMetaData(); sal_Int32 nColCount = 0; // do we have columns @@ -868,7 +868,7 @@ Any OResultSet::getBookmark() checkBookmarkable(); - return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->getBookmark(); + return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->getBookmark(); } sal_Bool OResultSet::moveToBookmark(const Any& bookmark) @@ -878,7 +878,7 @@ sal_Bool OResultSet::moveToBookmark(const Any& bookmark) checkBookmarkable(); - return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->moveToBookmark(bookmark); + return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->moveToBookmark(bookmark); } sal_Bool OResultSet::moveRelativeToBookmark(const Any& bookmark, sal_Int32 rows) @@ -888,7 +888,7 @@ sal_Bool OResultSet::moveRelativeToBookmark(const Any& bookmark, sal_Int32 rows) checkBookmarkable(); - return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->moveRelativeToBookmark(bookmark, rows); + return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->moveRelativeToBookmark(bookmark, rows); } sal_Int32 OResultSet::compareBookmarks(const Any& _first, const Any& _second) @@ -898,7 +898,7 @@ sal_Int32 OResultSet::compareBookmarks(const Any& _first, const Any& _second) checkBookmarkable(); - return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->compareBookmarks(_first, _second); + return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->compareBookmarks(_first, _second); } sal_Bool OResultSet::hasOrderedBookmarks() @@ -908,7 +908,7 @@ sal_Bool OResultSet::hasOrderedBookmarks() checkBookmarkable(); - return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->hasOrderedBookmarks(); + return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->hasOrderedBookmarks(); } sal_Int32 OResultSet::hashBookmark(const Any& bookmark) @@ -918,7 +918,7 @@ sal_Int32 OResultSet::hashBookmark(const Any& bookmark) checkBookmarkable(); - return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->hashBookmark(bookmark); + return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->hashBookmark(bookmark); } // css::sdbc::XResultSetUpdate diff --git a/dbaccess/source/core/api/statement.cxx b/dbaccess/source/core/api/statement.cxx index 7cc74ed3ef6e..3bad447db85f 100644 --- a/dbaccess/source/core/api/statement.cxx +++ b/dbaccess/source/core/api/statement.cxx @@ -147,7 +147,7 @@ void OStatementBase::disposing() { try { - Reference< XCloseable > (m_xAggregateAsSet, UNO_QUERY)->close(); + Reference< XCloseable > (m_xAggregateAsSet, UNO_QUERY_THROW)->close(); } catch(RuntimeException& ) {// don't care for anymore @@ -292,7 +292,7 @@ Any OStatementBase::getWarnings() MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - return Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY)->getWarnings(); + return Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY_THROW)->getWarnings(); } void OStatementBase::clearWarnings() @@ -300,7 +300,7 @@ void OStatementBase::clearWarnings() MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY)->clearWarnings(); + Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY_THROW)->clearWarnings(); } // css::util::XCancellable @@ -320,11 +320,11 @@ Reference< XResultSet > SAL_CALL OStatementBase::getResultSet( ) ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); // first check the meta data - Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData(); + Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); if (!xMeta.is() || !xMeta->supportsMultipleResultSets()) throwFunctionSequenceException(*this); - return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY)->getResultSet(); + return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY_THROW)->getResultSet(); } sal_Int32 SAL_CALL OStatementBase::getUpdateCount( ) @@ -333,11 +333,11 @@ sal_Int32 SAL_CALL OStatementBase::getUpdateCount( ) ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); // first check the meta data - Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData(); + Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); if (!xMeta.is() || !xMeta->supportsMultipleResultSets()) throwFunctionSequenceException(*this); - return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY)->getUpdateCount(); + return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY_THROW)->getUpdateCount(); } sal_Bool SAL_CALL OStatementBase::getMoreResults( ) @@ -346,14 +346,14 @@ sal_Bool SAL_CALL OStatementBase::getMoreResults( ) ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); // first check the meta data - Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData(); + Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); if (!xMeta.is() || !xMeta->supportsMultipleResultSets()) throwFunctionSequenceException(*this); // free the previous results disposeResultSet(); - return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY)->getMoreResults(); + return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY_THROW)->getMoreResults(); } // XPreparedBatchExecution @@ -363,11 +363,11 @@ void SAL_CALL OStatementBase::addBatch( ) ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); // first check the meta data - Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData(); + Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); if (!xMeta.is() || !xMeta->supportsBatchUpdates()) throwFunctionSequenceException(*this); - Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->addBatch(); + Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY_THROW)->addBatch(); } void SAL_CALL OStatementBase::clearBatch( ) @@ -376,11 +376,11 @@ void SAL_CALL OStatementBase::clearBatch( ) ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); // first check the meta data - Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData(); + Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); if (!xMeta.is() || !xMeta->supportsBatchUpdates()) throwFunctionSequenceException(*this); - Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->clearBatch(); + Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY_THROW)->clearBatch(); } Sequence< sal_Int32 > SAL_CALL OStatementBase::executeBatch( ) @@ -389,14 +389,14 @@ Sequence< sal_Int32 > SAL_CALL OStatementBase::executeBatch( ) ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); // first check the meta data - Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData(); + Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); if (!xMeta.is() || !xMeta->supportsBatchUpdates()) throwFunctionSequenceException(*this); // free the previous results disposeResultSet(); - return Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->executeBatch(); + return Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY_THROW)->executeBatch(); } Reference< XResultSet > SAL_CALL OStatementBase::getGeneratedValues( ) @@ -495,12 +495,12 @@ void OStatement::addBatch( const OUString& _rSQL ) ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); // first check the meta data - Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData(); + Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); if (!xMeta.is() || !xMeta->supportsBatchUpdates()) throwFunctionSequenceException(*this); OUString sSQL( impl_doEscapeProcessing_nothrow( _rSQL ) ); - Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->addBatch( sSQL ); + Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY_THROW)->addBatch( sSQL ); } void OStatement::clearBatch( ) @@ -508,11 +508,11 @@ void OStatement::clearBatch( ) MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); // first check the meta data - Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData(); + Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); if (!xMeta.is() || !xMeta->supportsBatchUpdates()) throwFunctionSequenceException(*this); - Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->clearBatch(); + Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY_THROW)->clearBatch(); } Sequence< sal_Int32 > OStatement::executeBatch( ) @@ -520,10 +520,10 @@ Sequence< sal_Int32 > OStatement::executeBatch( ) MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); // first check the meta data - Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData(); + Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); if (!xMeta.is() || !xMeta->supportsBatchUpdates()) throwFunctionSequenceException(*this); - return Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->executeBatch( ); + return Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY_THROW)->executeBatch( ); } diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index efa5f95d8453..f36f9b2e860d 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -2042,7 +2042,7 @@ void OApplicationController::renameEntry() if ( xParent.is() ) { xHNames = xParent; - Reference<XPropertySet>(xRename,UNO_QUERY)->getPropertyValue(PROPERTY_NAME) >>= sName; + Reference<XPropertySet>(xRename,UNO_QUERY_THROW)->getPropertyValue(PROPERTY_NAME) >>= sName; } } pNameChecker.reset( new HierarchicalNameCheck( xHNames.get(), OUString() ) ); diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 7f05fda7f8ec..3286ecf8c420 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -130,7 +130,7 @@ DlgFilterCrit::DlgFilterCrit(weld::Window * pParent, m_xLB_WHEREFIELD3->append_text( *pIter ); } - Reference<XNameAccess> xSelectColumns = Reference<XColumnsSupplier>(m_xQueryComposer,UNO_QUERY)->getColumns(); + Reference<XNameAccess> xSelectColumns = Reference<XColumnsSupplier>(m_xQueryComposer,UNO_QUERY_THROW)->getColumns(); aNames = xSelectColumns->getElementNames(); pIter = aNames.getConstArray(); pEnd = pIter + aNames.getLength(); @@ -357,7 +357,7 @@ Reference< XPropertySet > DlgFilterCrit::getColumn( const OUString& _rFieldName if ( m_xColumns.is() && m_xColumns->hasByName( _rFieldName ) ) m_xColumns->getByName( _rFieldName ) >>= xColumn; - Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY)->getColumns(); + Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY_THROW)->getColumns(); if ( xColumns.is() && !xColumn.is() ) { Sequence< OUString> aSeq = xColumns->getElementNames(); @@ -393,7 +393,7 @@ Reference< XPropertySet > DlgFilterCrit::getQueryColumn( const OUString& _rField Reference< XPropertySet > xColumn; try { - Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY)->getColumns(); + Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY_THROW)->getColumns(); if ( xColumns.is() && xColumns->hasByName( _rFieldName ) ) xColumns->getByName( _rFieldName ) >>= xColumn; } diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx index 1bd9d3692591..af788f258ba0 100644 --- a/dbaccess/source/ui/dlg/queryorder.cxx +++ b/dbaccess/source/ui/dlg/queryorder.cxx @@ -196,7 +196,7 @@ OUString DlgOrderCrit::GetOrderList( ) const Reference<XDatabaseMetaData> xMetaData = m_xConnection->getMetaData(); OUString sQuote = xMetaData.is() ? xMetaData->getIdentifierQuoteString() : OUString(); - Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY)->getColumns(); + Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY_THROW)->getColumns(); OUStringBuffer sOrder; for( sal_uInt16 i=0 ; i<DOG_ROWS; i++ ) diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index 8b596b137839..99d0d7a622b4 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -61,7 +61,7 @@ void ORowSetImportExport::initialize() Reference<XColumnLocate> xColumnLocate(m_xResultSet,UNO_QUERY); OSL_ENSURE(xColumnLocate.is(),"The rowset normally should support this"); - m_xTargetResultSetMetaData = Reference<XResultSetMetaDataSupplier>(m_xTargetResultSetUpdate,UNO_QUERY)->getMetaData(); + m_xTargetResultSetMetaData = Reference<XResultSetMetaDataSupplier>(m_xTargetResultSetUpdate,UNO_QUERY_THROW)->getMetaData(); if(!m_xTargetResultSetMetaData.is() || !xColumnLocate.is() || !m_xResultSetMetaData.is() ) throw SQLException(DBA_RES(STR_UNEXPECTED_ERROR),*this,"S1000",0,Any()); diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index a30614e5b82f..c862af65969a 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -270,7 +270,7 @@ void ODatabaseImportExport::initialize() { m_xRow.set( m_xResultSet, UNO_QUERY ); m_xRowLocate.set( m_xResultSet, UNO_QUERY ); - m_xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(m_xRow,UNO_QUERY)->getMetaData(); + m_xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(m_xRow,UNO_QUERY_THROW)->getMetaData(); Reference<XColumnsSupplier> xSup(m_xResultSet,UNO_QUERY_THROW); m_xRowSetColumns.set(xSup->getColumns(),UNO_QUERY_THROW); } diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 47e5c9933a4b..75c318d0787c 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -430,7 +430,7 @@ void fillTypeInfo( const Reference< css::sdbc::XConnection>& _rxConnection, // Information for a single SQL type if(xRs.is()) { - Reference<XResultSetMetaData> xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(xRs,UNO_QUERY)->getMetaData(); + Reference<XResultSetMetaData> xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(xRs,UNO_QUERY_THROW)->getMetaData(); ::connectivity::ORowSetValue aValue; std::vector<sal_Int32> aTypes; std::vector<bool> aNullable; diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index ad1cbb401eee..5a6c1568688d 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -189,7 +189,7 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const // the number of PKey-Fields in the source const Reference< XNameAccess> xPrimaryKeyColumns = getPrimaryKeyColumns_throw(pSourceWin->GetData()->getTable()); - bool bAskUser = xPrimaryKeyColumns.is() && Reference< XIndexAccess>(xPrimaryKeyColumns,UNO_QUERY)->getCount() > 1; + bool bAskUser = xPrimaryKeyColumns.is() && Reference< XIndexAccess>(xPrimaryKeyColumns,UNO_QUERY_THROW)->getCount() > 1; pTabConnData->SetConnLine( 0, sSourceFieldName, sDestFieldName ); |