diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2011-03-12 12:04:35 +0100 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2011-03-12 14:05:07 +0100 |
commit | f6ccb8354a350fce31f8c6c7d04b86d5c0a126d1 (patch) | |
tree | c2c0b2f76362e442e1cbdec027ea4625f8ed3165 /dbaccess/source/core/api | |
parent | 7a7f390db3656b976a5c9fc8d081d5e3c60582e8 (diff) |
Move OSL_ENSURE(0,...) to OSL_FAIL(...)
Diffstat (limited to 'dbaccess/source/core/api')
-rw-r--r-- | dbaccess/source/core/api/CacheSet.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/api/HelperCollections.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/api/KeySet.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSet.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetBase.cxx | 10 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetCache.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/api/TableDeco.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/api/tablecontainer.cxx | 2 |
9 files changed, 24 insertions, 24 deletions
diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx index 88eafa3c7d3a..5224d80b7589 100644 --- a/dbaccess/source/core/api/CacheSet.cxx +++ b/dbaccess/source/core/api/CacheSet.cxx @@ -137,11 +137,11 @@ OCacheSet::~OCacheSet() } catch(Exception&) { - OSL_ENSURE(0,"Exception occurred"); + OSL_FAIL("Exception occurred"); } catch(...) { - OSL_ENSURE(0,"Unknown Exception occurred"); + OSL_FAIL("Unknown Exception occurred"); } DBG_DTOR(OCacheSet,NULL); @@ -676,7 +676,7 @@ bool OCacheSet::isResultSetChanged() const void OCacheSet::reset(const Reference< XResultSet>& /*_xDriverSet*/) { - OSL_ENSURE(0,"Illegal call!"); + OSL_FAIL("Illegal call!"); } void OCacheSet::mergeColumnValues(sal_Int32 i_nColumnIndex,ORowSetValueVector::Vector& /*io_aInsertRow*/,ORowSetValueVector::Vector& /*io_aRow*/,::std::vector<sal_Int32>& o_aChangedColumns) diff --git a/dbaccess/source/core/api/HelperCollections.cxx b/dbaccess/source/core/api/HelperCollections.cxx index 9bfc64370195..acc2d3ef337f 100644 --- a/dbaccess/source/core/api/HelperCollections.cxx +++ b/dbaccess/source/core/api/HelperCollections.cxx @@ -97,7 +97,7 @@ namespace dbaccess if(aIter != m_aColumns->get().end()) return connectivity::sdbcx::ObjectType(*aIter,UNO_QUERY); - OSL_ENSURE(0,"Column not found in collection!"); + OSL_FAIL("Column not found in collection!"); } return NULL; } diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 78eceea4dbcd..44f5ebc0c737 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -133,7 +133,7 @@ OKeySet::~OKeySet() } catch(...) { - OSL_ENSURE(0,"Unknown Exception occurred"); + OSL_FAIL("Unknown Exception occurred"); } m_xComposer = NULL; @@ -764,7 +764,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString } catch(Exception&) { - OSL_ENSURE(0,"Could not execute GeneratedKeys() stmt"); + OSL_FAIL("Could not execute GeneratedKeys() stmt"); } } @@ -823,7 +823,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString } catch(SQLException&) { - OSL_ENSURE(0,"Could not fetch with MAX() "); + OSL_FAIL("Could not fetch with MAX() "); } } } @@ -975,7 +975,7 @@ void SAL_CALL OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivit aSql.append(::dbtools::quoteName( aQuote,aIter->second.sRealName)); if((_rDeleteRow->get())[aIter->second.nPosition].isNull()) { - OSL_ENSURE(0,"can a primary key be null"); + OSL_FAIL("can a primary key be null"); aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" IS NULL"))); } else diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 02e84ea2b932..750c03617890 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -230,7 +230,7 @@ ORowSet::~ORowSet() { if ( !m_rBHelper.bDisposed && !m_rBHelper.bInDispose ) { - OSL_ENSURE(0, "Please check who doesn't dispose this component!"); + OSL_FAIL("Please check who doesn't dispose this component!"); osl_incrementInterlockedCount( &m_refCount ); dispose(); } diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index 5a6816aae17e..2af2ef12587e 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -240,7 +240,7 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex) RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::impl_getValue" ); if ( m_bBeforeFirst || m_bAfterLast ) { - OSL_ENSURE(0,"ORowSetBase::getValue: Illegal call here (we're before first or after last)!"); + OSL_FAIL("ORowSetBase::getValue: Illegal call here (we're before first or after last)!"); ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_CURSOR_BEFORE_OR_AFTER ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); } @@ -382,7 +382,7 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSetBase::getBinaryS if ( m_bBeforeFirst || m_bAfterLast ) { - OSL_ENSURE(0,"ORowSetBase::getBinaryStream: Illegal call here (we're before first or after last)!"); + OSL_FAIL("ORowSetBase::getBinaryStream: Illegal call here (we're before first or after last)!"); ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_CURSOR_BEFORE_OR_AFTER ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); } @@ -478,9 +478,9 @@ sal_Bool SAL_CALL ORowSetBase::moveToBookmark( const Any& bookmark ) throw(SQLEx if(!bookmark.hasValue() || m_nResultSetType == ResultSetType::FORWARD_ONLY) { if(bookmark.hasValue()) - OSL_ENSURE(0,"MoveToBookmark is not possible when we are only forward"); + OSL_FAIL("MoveToBookmark is not possible when we are only forward"); else - OSL_ENSURE(0,"Bookmark is not valid"); + OSL_FAIL("Bookmark is not valid"); throwFunctionSequenceException(*m_pMySelf); } @@ -1285,7 +1285,7 @@ void ORowSetBase::firePropertyChange(const ORowSetRow& _rOldRow) } catch(Exception&) { - OSL_ENSURE(0,"firePropertyChange: Exception"); + OSL_FAIL("firePropertyChange: Exception"); } OSL_TRACE("DBACCESS ORowSetBase::firePropertyChange() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 1b1a60090a25..671046009d15 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -847,7 +847,7 @@ sal_Bool ORowSetCache::moveWindow() } else { // normally this should never happen - OSL_ENSURE(0,"What the hell is happen here!"); + OSL_FAIL("What the hell is happen here!"); return sal_False; } } @@ -1228,7 +1228,7 @@ sal_Bool ORowSetCache::insertRow(::std::vector< Any >& o_aBookmarks) } else { - OSL_ENSURE(0,"There must be a bookmark after the row was inserted!"); + OSL_FAIL("There must be a bookmark after the row was inserted!"); } } return bRet; @@ -1317,7 +1317,7 @@ void ORowSetCache::cancelRowUpdates( ) m_bNew = m_bModified = sal_False; if(!m_nPosition) { - OSL_ENSURE(0,"cancelRowUpdates:Invalid positions pos == 0"); + OSL_FAIL("cancelRowUpdates:Invalid positions pos == 0"); ::dbtools::throwFunctionSequenceException(NULL); } @@ -1325,7 +1325,7 @@ void ORowSetCache::cancelRowUpdates( ) m_pCacheSet->fillValueRow(*m_aMatrixIter,m_nPosition); else { - OSL_ENSURE(0,"cancelRowUpdates couldn't position right with absolute"); + OSL_FAIL("cancelRowUpdates couldn't position right with absolute"); ::dbtools::throwFunctionSequenceException(NULL); } } diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 3a337481ffba..3374efa4f828 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -1122,7 +1122,7 @@ sal_Int32 OSingleSelectQueryComposer::getPredicateType(OSQLParseNode * _pPredica nPredicate = SQLFilterOperator::GREATER_EQUAL; break; default: - OSL_ENSURE(0,"Wrong NodeType!"); + OSL_FAIL("Wrong NodeType!"); } return nPredicate; } @@ -1793,7 +1793,7 @@ Sequence< Sequence< PropertyValue > > OSingleSelectQueryComposer::getStructuredC switch(_ePart) { default: - OSL_ENSURE( 0, "OSingleSelectQueryComposer::getKeyWord: Invalid enum value!" ); + OSL_FAIL( "OSingleSelectQueryComposer::getKeyWord: Invalid enum value!" ); // no break, fallback to WHERE case Where: sKeyword = STR_WHERE; @@ -1831,7 +1831,7 @@ Sequence< Sequence< PropertyValue > > OSingleSelectQueryComposer::getStructuredC F_tmp = TGetParseNode(&OSQLParseTreeIterator::getSimpleOrderTree); break; default: - OSL_ENSURE(0,"Invalid enum value!"); + OSL_FAIL("Invalid enum value!"); } ::rtl::OUString sRet = getStatementPart( F_tmp, _rIterator ); diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx index 40bf99774f95..d2b724f68a04 100644 --- a/dbaccess/source/core/api/TableDeco.cxx +++ b/dbaccess/source/core/api/TableDeco.cxx @@ -187,7 +187,7 @@ void ODBTableDecorator::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, con switch(_nHandle) { case PROPERTY_ID_PRIVILEGES: - OSL_ENSURE(0,"Property is readonly!"); + OSL_FAIL("Property is readonly!"); case PROPERTY_ID_FILTER: case PROPERTY_ID_ORDER: case PROPERTY_ID_APPLYFILTER: @@ -326,7 +326,7 @@ void ODBTableDecorator::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) c } break; default: - OSL_ENSURE(0,"Invalid Handle for table"); + OSL_FAIL("Invalid Handle for table"); } } diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx index 9c446a18ff1f..128595fea054 100644 --- a/dbaccess/source/core/api/tablecontainer.cxx +++ b/dbaccess/source/core/api/tablecontainer.cxx @@ -98,7 +98,7 @@ namespace } catch(Exception) { - OSL_ENSURE( 0, "lcl_isPropertySetDefaulted: Exception caught!" ); + OSL_FAIL( "lcl_isPropertySetDefaulted: Exception caught!" ); } } return ( pIter == pEnd ); |