diff options
Diffstat (limited to 'connectivity')
60 files changed, 135 insertions, 135 deletions
diff --git a/connectivity/inc/connectivity/DateConversion.hxx b/connectivity/inc/connectivity/DateConversion.hxx index cbab67251e4a..45afacfdbe68 100755 --- a/connectivity/inc/connectivity/DateConversion.hxx +++ b/connectivity/inc/connectivity/DateConversion.hxx @@ -41,52 +41,52 @@ namespace connectivity public: static sal_Int32 toINT32(const ::com::sun::star::util::Date&) { - OSL_ENSURE(0,"Please use DBConversion instead!"); + OSL_FAIL("Please use DBConversion instead!"); return 0; } static sal_Int32 toINT32(const ::com::sun::star::util::Time&) { - OSL_ENSURE(0,"Please use DBConversion instead!"); + OSL_FAIL("Please use DBConversion instead!"); return 0; } static sal_Int64 toINT64(const ::com::sun::star::util::DateTime&) { - OSL_ENSURE(0,"Please use DBConversion instead!"); + OSL_FAIL("Please use DBConversion instead!"); return 0; } static sal_Int32 getMsFromTime(const ::com::sun::star::util::Time&) { - OSL_ENSURE(0,"Please use DBConversion instead!"); + OSL_FAIL("Please use DBConversion instead!"); return 0; } static double toDouble(const ::com::sun::star::util::Date&) { - OSL_ENSURE(0,"Please use DBConversion instead!"); + OSL_FAIL("Please use DBConversion instead!"); return 0; } static double toDouble(const ::com::sun::star::util::Time&) { - OSL_ENSURE(0,"Please use DBConversion instead!"); + OSL_FAIL("Please use DBConversion instead!"); return 0; } static double toDouble(const ::com::sun::star::util::DateTime&) { - OSL_ENSURE(0,"Please use DBConversion instead!"); + OSL_FAIL("Please use DBConversion instead!"); return 0; } static ::com::sun::star::util::Date toDate(double,const ::com::sun::star::util::Date& =::com::sun::star::util::Date(01,01,1900)) { - OSL_ENSURE(0,"Please use DBConversion instead!"); + OSL_FAIL("Please use DBConversion instead!"); return ::com::sun::star::util::Date(); } static ::com::sun::star::util::Time toTime(double) { - OSL_ENSURE(0,"Please use DBConversion instead!"); + OSL_FAIL("Please use DBConversion instead!"); return ::com::sun::star::util::Time(); } static ::com::sun::star::util::DateTime toDateTime(double,const ::com::sun::star::util::Date& =::com::sun::star::util::Date(01,01,1900)) { - OSL_ENSURE(0,"Please use DBConversion instead!"); + OSL_FAIL("Please use DBConversion instead!"); return ::com::sun::star::util::DateTime(); } }; diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index cd335987c121..7170ee48a501 100755 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -217,7 +217,7 @@ using namespace ::com::sun::star::beans; } catch ( const Exception& ) { - OSL_ENSURE(0,"TypeConversion Error"); + OSL_FAIL("TypeConversion Error"); } } else @@ -428,7 +428,7 @@ double DBTypeConversion::getValue( const Reference< XColumn >& i_column, const D } catch (const Exception& ) { - OSL_ENSURE(false, "DBTypeConversion::getFormattedValue: caught an exception while asking for the format key!"); + OSL_FAIL("DBTypeConversion::getValue: caught an exception while asking for the format key!"); } if (!nKey) diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx index 96ab611142c0..231ebb75fcc1 100755 --- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx +++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx @@ -121,7 +121,7 @@ void ODatabaseMetaDataResultSet::setType(MetaDataResultSetType _eType) case eBestRowIdentifier: setBestRowIdentifierMap(); break; case eVersionColumns: setVersionColumnsMap(); break; default: - OSL_ENSURE(0,"Wrong type!"); + OSL_FAIL("Wrong type!"); } } // ------------------------------------------------------------------------- diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx index 0be8ea3f49f6..797cad9de343 100755 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -260,7 +260,7 @@ void ORowSetValue::setTypeKind(sal_Int32 _eType) break; default: (*this) = getAny(); - OSL_ENSURE(0,"ORowSetValue:operator==(): UNSPUPPORTED TYPE!"); + OSL_FAIL("ORowSetValue:operator==(): UNSPUPPORTED TYPE!"); } } @@ -865,7 +865,7 @@ bool ORowSetValue::operator==(const ORowSetValue& _rRH) const break; default: bRet = false; - OSL_ENSURE(0,"ORowSetValue::operator==(): UNSPUPPORTED TYPE!"); + OSL_FAIL("ORowSetValue::operator==(): UNSPUPPORTED TYPE!"); break; } return bRet; @@ -958,7 +958,7 @@ Any ORowSetValue::makeAny() const } break; default: - OSL_ENSURE(0,"ORowSetValue::makeAny(): UNSPUPPORTED TYPE!"); + OSL_FAIL("ORowSetValue::makeAny(): UNSPUPPORTED TYPE!"); rValue = getAny(); break; } @@ -2171,7 +2171,7 @@ void ORowSetValue::impl_fill( const sal_Int32 _nType, sal_Bool _bNullable, const setTypeKind(DataType::OTHER); break; default: - OSL_ENSURE( false, "ORowSetValue::fill: unsupported type!" ); + OSL_FAIL( "ORowSetValue::fill: unsupported type!" ); (*this) = _rValueSource.getObject(); break; } @@ -2289,7 +2289,7 @@ void ORowSetValue::fill(const Any& _rValue) if ( _rValue >>= aDummy ) (*this) = aDummy; else - OSL_ENSURE( false, "ORowSetValue::fill: unsupported sequence type!" ); + OSL_FAIL( "ORowSetValue::fill: unsupported sequence type!" ); break; } @@ -2311,7 +2311,7 @@ void ORowSetValue::fill(const Any& _rValue) (*this) = aDateTime; } else - OSL_ENSURE( false, "ORowSetValue::fill: unsupported structure!" ); + OSL_FAIL( "ORowSetValue::fill: unsupported structure!" ); break; } @@ -2340,7 +2340,7 @@ void ORowSetValue::fill(const Any& _rValue) break; default: - OSL_ENSURE(0,"Unknown type"); + OSL_FAIL("Unknown type"); break; } } diff --git a/connectivity/source/commontools/TSkipDeletedSet.cxx b/connectivity/source/commontools/TSkipDeletedSet.cxx index 90dbf8c6487e..15f30a592d24 100755 --- a/connectivity/source/commontools/TSkipDeletedSet.cxx +++ b/connectivity/source/commontools/TSkipDeletedSet.cxx @@ -252,7 +252,7 @@ sal_Int32 OSkipDeletedSet::getMappedPosition(sal_Int32 _nPos) const /*TInt2IntMap::const_iterator aFind = m_aBookmarks.find(_nPos); OSL_ENSURE(aFind != m_aBookmarks.end(),"OSkipDeletedSet::getMappedPosition() invalid bookmark!"); return aFind->second;*/ - OSL_ENSURE(0,"Why!"); + OSL_FAIL("Why!"); return -1; } // ----------------------------------------------------------------------------- diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 6a8161da314b..5d3027a627b1 100755 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -245,7 +245,7 @@ namespace // if that's not the case, normalize it if ( bGaps || bDuplicates ) { - OSL_ENSURE( false, "lcl_sanitizeColumnDescs: database did provide invalid ORDINAL_POSITION values!" ); + OSL_FAIL( "lcl_sanitizeColumnDescs: database did provide invalid ORDINAL_POSITION values!" ); OrdinalPosition nNormalizedPosition = 1; for ( ::std::vector< ColumnDesc >::iterator normalize = _rColumns.begin(); @@ -589,7 +589,7 @@ sdbcx::TKeyProperties OTableHelper::getKeyProperties(const ::rtl::OUString& _sNa } else // only a fall back { - OSL_ENSURE(0,"No key with the given name found"); + OSL_FAIL("No key with the given name found"); pKeyProps.reset(new sdbcx::KeyProperties()); } diff --git a/connectivity/source/commontools/dbexception.cxx b/connectivity/source/commontools/dbexception.cxx index ea96f9cb0c9e..e79f0dda4d49 100755 --- a/connectivity/source/commontools/dbexception.cxx +++ b/connectivity/source/commontools/dbexception.cxx @@ -239,7 +239,7 @@ void SQLExceptionInfo::append( TYPE _eType, const ::rtl::OUString& _rErrorMessag case SQL_WARNING: aAppend <<= SQLWarning(); break; case SQL_CONTEXT: aAppend <<= SQLContext(); break; default: - OSL_ENSURE( false, "SQLExceptionInfo::append: invalid exception type: this will crash!" ); + OSL_FAIL( "SQLExceptionInfo::append: invalid exception type: this will crash!" ); break; } diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 9ee1581c5c3b..37d1fa51a440 100755 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -500,7 +500,7 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R } catch(Exception&) { - OSL_ENSURE(0,"EXception when we set the new active connection!"); + OSL_FAIL("EXception when we set the new active connection!"); } } } @@ -1439,7 +1439,7 @@ namespace _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= _out_rName; } else - OSL_ENSURE( false, "::dbtools::lcl_getTableNameComponents: this is no table object!" ); + OSL_FAIL( "::dbtools::lcl_getTableNameComponents: this is no table object!" ); } } @@ -1547,12 +1547,12 @@ void showError(const SQLExceptionInfo& _rInfo, xErrorDialog->execute(); else { - OSL_ENSURE(0,"dbtools::showError: no XExecutableDialog found!"); + OSL_FAIL("dbtools::showError: no XExecutableDialog found!"); } } catch(Exception&) { - OSL_ENSURE(0,"showError: could not display the error message!"); + OSL_FAIL("showError: could not display the error message!"); } } } diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 0e35af8434b1..d955ef225c03 100755 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -469,7 +469,7 @@ namespace } catch(SQLException&) { - OSL_ENSURE( false, "lcl_createSDBCXColumn: caught an exception!" ); + OSL_FAIL( "lcl_createSDBCXColumn: caught an exception!" ); } } @@ -762,7 +762,7 @@ sal_Int32 getTablePrivileges(const Reference< XDatabaseMetaData>& _xMetaData, Privilege::INSERT | Privilege::SELECT; else - OSL_ENSURE(0,"Could not collect the privileges !"); + OSL_FAIL("Could not collect the privileges !"); } return nPrivileges; } diff --git a/connectivity/source/cpool/ZPoolCollection.cxx b/connectivity/source/cpool/ZPoolCollection.cxx index 9ebdd3f08272..97f3eeee6a0c 100755 --- a/connectivity/source/cpool/ZPoolCollection.cxx +++ b/connectivity/source/cpool/ZPoolCollection.cxx @@ -512,7 +512,7 @@ void SAL_CALL OPoolCollection::disposing( const EventObject& Source ) throw (Run } catch(const Exception&) { - OSL_ENSURE(0,"Exception caught"); + OSL_FAIL("Exception caught"); } } } diff --git a/connectivity/source/drivers/adabas/BDriver.cxx b/connectivity/source/drivers/adabas/BDriver.cxx index f692d50b8069..bb72894d621c 100755 --- a/connectivity/source/drivers/adabas/BDriver.cxx +++ b/connectivity/source/drivers/adabas/BDriver.cxx @@ -821,7 +821,7 @@ oslGenericFunction ODriver::getOdbcFunction(sal_Int32 _nIndex) const pFunction = (oslGenericFunction)pODBC3SQLNativeSql; break; default: - OSL_ENSURE(0,"Function unknown!"); + OSL_FAIL("Function unknown!"); } return pFunction; } diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index 37fb4f981240..a5bb2c190186 100755 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -355,7 +355,7 @@ void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 level ) throw(SQLE eIso = adXactSerializable; break; default: - OSL_ENSURE(0,"OConnection::setTransactionIsolation invalid level"); + OSL_FAIL("OConnection::setTransactionIsolation invalid level"); return; } m_pAdoConnection->put_IsolationLevel(eIso); @@ -387,7 +387,7 @@ sal_Int32 SAL_CALL OConnection::getTransactionIsolation( ) throw(SQLException, nRet = TransactionIsolation::SERIALIZABLE; break; default: - OSL_ENSURE(0,"OConnection::setTransactionIsolation invalid level"); + OSL_FAIL("OConnection::setTransactionIsolation invalid level"); } ADOS::ThrowException(*m_pAdoConnection,*this); return nRet; diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx index 8bde02cd5239..e8acf0ad3613 100755 --- a/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx +++ b/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx @@ -535,7 +535,7 @@ KeyTypeEnum OAdoKey::Map2KeyRule(const sal_Int32& _eNum) eNum = adKeyUnique; break; default: - OSL_ENSURE( false, "OAdoKey::Map2KeyRule: invalid key type!" ); + OSL_FAIL( "OAdoKey::Map2KeyRule: invalid key type!" ); } return eNum; } diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx index 589fd04f6675..0290e29cbfef 100755 --- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx +++ b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx @@ -763,7 +763,7 @@ void ODatabaseMetaDataResultSet::setFastPropertyValue_NoBroadcast( throw Exception(); break; default: - OSL_ENSURE(0,"setFastPropertyValue_NoBroadcast: Illegal handle value!"); + OSL_FAIL("setFastPropertyValue_NoBroadcast: Illegal handle value!"); } } // ------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/ado/adoimp.cxx b/connectivity/source/drivers/ado/adoimp.cxx index de0d53b50e97..73b00faefe01 100755 --- a/connectivity/source/drivers/ado/adoimp.cxx +++ b/connectivity/source/drivers/ado/adoimp.cxx @@ -132,7 +132,7 @@ sal_Int32 ADOS::MapADOType2Jdbc(DataTypeEnum eType) case adVariant: nType = DataType::OTHER; break; default: - OSL_ENSURE(0,"MapADOType2Jdbc: Unknown Type!"); + OSL_FAIL("MapADOType2Jdbc: Unknown Type!"); ; } return nType; @@ -165,7 +165,7 @@ DataTypeEnum ADOS::MapJdbc2ADOType(sal_Int32 _nType,sal_Int32 _nJetEngine) case DataType::TINYINT: return isJetEngine(_nJetEngine) ? adUnsignedTinyInt : adTinyInt;break; case DataType::OBJECT: return adGUID; break; default: - OSL_ENSURE(0,"MapJdbc2ADOType: Unknown Type!"); + OSL_FAIL("MapJdbc2ADOType: Unknown Type!"); ; } return adEmpty; @@ -264,7 +264,7 @@ sal_Int32 ADOS::mapAdoType2Object(ObjectTypeEnum objType) nType = PrivilegeObject::COLUMN; break; default: - OSL_ENSURE( false, "ADOS::mapAdoType2Object: privilege type cannot be translated!" ); + OSL_FAIL( "ADOS::mapAdoType2Object: privilege type cannot be translated!" ); break; } return nType; diff --git a/connectivity/source/drivers/dbase/DNoException.cxx b/connectivity/source/drivers/dbase/DNoException.cxx index df0fa5af0fd8..b130547e9265 100755 --- a/connectivity/source/drivers/dbase/DNoException.cxx +++ b/connectivity/source/drivers/dbase/DNoException.cxx @@ -498,7 +498,7 @@ SvStream& connectivity::dbase::operator << (SvStream &rStream, const ONDXPage& r void ONDXPage::PrintPage() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXPage::PrintPage" ); - DBG_TRACE4("\nSDB: -----------Page: %d Parent: %d Count: %d Child: %d-----", + OSL_TRACE("\nSDB: -----------Page: %d Parent: %d Count: %d Child: %d-----", nPagePos, HasParent() ? aParent->GetPagePos() : 0 ,nCount, aChild.GetPagePos()); for (sal_uInt16 i = 0; i < nCount; i++) @@ -510,18 +510,18 @@ void ONDXPage::PrintPage() if (rKey.getValue().isNull()) { - DBG_TRACE2("SDB: [%d,NULL,%d]",rKey.GetRecord(), rNode.GetChild().GetPagePos()); + OSL_TRACE("SDB: [%d,NULL,%d]",rKey.GetRecord(), rNode.GetChild().GetPagePos()); } else if (rIndex.getHeader().db_keytype) { - DBG_TRACE3("SDB: [%d,%f,%d]",rKey.GetRecord(), rKey.getValue().getDouble(),rNode.GetChild().GetPagePos()); + OSL_TRACE("SDB: [%d,%f,%d]",rKey.GetRecord(), rKey.getValue().getDouble(),rNode.GetChild().GetPagePos()); } else { - DBG_TRACE3("SDB: [%d,%s,%d]",rKey.GetRecord(), (const char* )ByteString(rKey.getValue().getString().getStr(), rIndex.m_pTable->getConnection()->getTextEncoding()).GetBuffer(),rNode.GetChild().GetPagePos()); + OSL_TRACE("SDB: [%d,%s,%d]",rKey.GetRecord(), (const char* )ByteString(rKey.getValue().getString().getStr(), rIndex.m_pTable->getConnection()->getTextEncoding()).GetBuffer(),rNode.GetChild().GetPagePos()); } } - DBG_TRACE("SDB: -----------------------------------------------\n"); + OSL_TRACE("SDB: -----------------------------------------------\n"); if (!IsLeaf()) { #if OSL_DEBUG_LEVEL > 1 @@ -533,7 +533,7 @@ void ONDXPage::PrintPage() } #endif } - DBG_TRACE("SDB: ===============================================\n"); + OSL_TRACE("SDB: ===============================================\n"); } #endif // ----------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 5397bc4a036f..5630800b47f2 100755 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -600,7 +600,7 @@ sal_Bool ODbaseTable::ReadMemoHeader() (*m_pMemoStream) >> m_aMemoHeader.db_size; break; default: - OSL_ENSURE( false, "ODbaseTable::ReadMemoHeader: unsupported memo type!" ); + OSL_FAIL( "ODbaseTable::ReadMemoHeader: unsupported memo type!" ); break; } return sal_True; @@ -2270,7 +2270,7 @@ void ODbaseTable::alterColumn(sal_Int32 index, } catch(const Exception&) { - OSL_ENSURE(0,"ODbaseTable::alterColumn: Exception occurred!"); + OSL_FAIL("ODbaseTable::alterColumn: Exception occurred!"); throw; } } diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx index 487c0b740b87..53a384ad6853 100755 --- a/connectivity/source/drivers/dbase/dindexnode.cxx +++ b/connectivity/source/drivers/dbase/dindexnode.cxx @@ -896,7 +896,7 @@ SvStream& connectivity::dbase::operator << (SvStream &rStream, const ONDXPage& r //------------------------------------------------------------------ void ONDXPage::PrintPage() { - DBG_TRACE4("\nSDB: -----------Page: %d Parent: %d Count: %d Child: %d-----", + OSL_TRACE("\nSDB: -----------Page: %d Parent: %d Count: %d Child: %d-----", nPagePos, HasParent() ? aParent->GetPagePos() : 0 ,nCount, aChild.GetPagePos()); for (sal_uInt16 i = 0; i < nCount; i++) @@ -908,18 +908,18 @@ void ONDXPage::PrintPage() if (rKey.getValue().isNull()) { - DBG_TRACE2("SDB: [%d,NULL,%d]",rKey.GetRecord(), rNode.GetChild().GetPagePos()); + OSL_TRACE("SDB: [%d,NULL,%d]",rKey.GetRecord(), rNode.GetChild().GetPagePos()); } else if (rIndex.getHeader().db_keytype) { - DBG_TRACE3("SDB: [%d,%f,%d]",rKey.GetRecord(), rKey.getValue().getDouble(),rNode.GetChild().GetPagePos()); + OSL_TRACE("SDB: [%d,%f,%d]",rKey.GetRecord(), rKey.getValue().getDouble(),rNode.GetChild().GetPagePos()); } else { - DBG_TRACE3("SDB: [%d,%s,%d]",rKey.GetRecord(), (const char* )ByteString(rKey.getValue().getString().getStr(), rIndex.m_pTable->getConnection()->getTextEncoding()).GetBuffer(),rNode.GetChild().GetPagePos()); + OSL_TRACE("SDB: [%d,%s,%d]",rKey.GetRecord(), (const char* )ByteString(rKey.getValue().getString().getStr(), rIndex.m_pTable->getConnection()->getTextEncoding()).GetBuffer(),rNode.GetChild().GetPagePos()); } } - DBG_TRACE("SDB: -----------------------------------------------\n"); + OSL_TRACE("SDB: -----------------------------------------------\n"); if (!IsLeaf()) { #if OSL_DEBUG_LEVEL > 1 @@ -931,7 +931,7 @@ void ONDXPage::PrintPage() } #endif } - DBG_TRACE("SDB: ===============================================\n"); + OSL_TRACE("SDB: ===============================================\n"); } #endif // ----------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/evoab/LDriver.cxx b/connectivity/source/drivers/evoab/LDriver.cxx index 637203e787d9..53ac9fc3ec39 100755 --- a/connectivity/source/drivers/evoab/LDriver.cxx +++ b/connectivity/source/drivers/evoab/LDriver.cxx @@ -233,7 +233,7 @@ sal_Bool SAL_CALL OEvoabDriver::acceptsURL( const ::rtl::OUString& url ) if ( nFileErr != osl_File_E_None ) { ::rtl::OUString sErr = translateFileErrorMessage( nFileErr); - OSL_ENSURE(false, ::rtl::OUStringToOString( sErr, RTL_TEXTENCODING_ASCII_US ).getStr()); + OSL_FAIL(::rtl::OUStringToOString( sErr, RTL_TEXTENCODING_ASCII_US ).getStr()); } ::rtl::OUString aVersionInfo; if ( nFileErr == osl_File_E_None && nBytesRead > 0 && nBytesRead <= 256) diff --git a/connectivity/source/drivers/evoab2/NServices.cxx b/connectivity/source/drivers/evoab2/NServices.cxx index d028755081e2..87e0831513e4 100755 --- a/connectivity/source/drivers/evoab2/NServices.cxx +++ b/connectivity/source/drivers/evoab2/NServices.cxx @@ -79,7 +79,7 @@ struct ProviderRequest } catch(::com::sun::star::uno::Exception) { - OSL_ENSURE(0,"Service Creation Exception"); + OSL_FAIL("Service Creation Exception"); } return xRet.is(); } diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx index 2ea738ad3419..30773e4ea665 100755 --- a/connectivity/source/drivers/evoab2/NStatement.cxx +++ b/connectivity/source/drivers/evoab2/NStatement.cxx @@ -477,10 +477,10 @@ rtl::OUString OCommonStatement::getTableName() OSQLParseNode::getTableComponents( pNodeForTableName, aCatalog, aSchema, aTableName,NULL); } else - OSL_ENSURE( false, "odd table layout" ); + OSL_FAIL( "odd table layout" ); } else - OSL_ENSURE( false, "unusual table layout" ); + OSL_FAIL( "unusual table layout" ); } return aTableName; } diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx index 2626c1d29a30..aa5a5108c7d5 100755 --- a/connectivity/source/drivers/file/FConnection.cxx +++ b/connectivity/source/drivers/file/FConnection.cxx @@ -198,7 +198,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV } else { - OSL_ENSURE(0,"OConnection::construct: ::ucbhelper::Content isn't a folde nor a document! How that?!"); + OSL_FAIL("OConnection::construct: ::ucbhelper::Content isn't a folde nor a document! How that?!"); throw SQLException(); } } diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx index cd738291e1a5..4a98491450ba 100755 --- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx @@ -89,7 +89,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns( const ::rtl::OUString& /*columnNamePattern*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getColumns" ); - OSL_ENSURE(0,"Should be overloaded!"); + OSL_FAIL("Should be overloaded!"); return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eColumns ); } diff --git a/connectivity/source/drivers/file/FDateFunctions.cxx b/connectivity/source/drivers/file/FDateFunctions.cxx index 792cb2d8bddb..a6be589f5328 100755 --- a/connectivity/source/drivers/file/FDateFunctions.cxx +++ b/connectivity/source/drivers/file/FDateFunctions.cxx @@ -70,7 +70,7 @@ ORowSetValue OOp_DayOfWeek::operate(const ORowSetValue& lhs) const nRet = 1; break; default: - OSL_ENSURE(0,"Error in enum values for date"); + OSL_FAIL("Error in enum values for date"); } return nRet; } @@ -136,7 +136,7 @@ ORowSetValue OOp_DayName::operate(const ORowSetValue& lhs) const sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Sunday")); break; default: - OSL_ENSURE(0,"Error in enum values for date"); + OSL_FAIL("Error in enum values for date"); } return sRet; } diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index d0056768663e..58d6baad649e 100755 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -1615,7 +1615,7 @@ sal_Bool OResultSet::OpenImpl() m_nRowCountResult = 1; break; default: - OSL_ENSURE( false, "OResultSet::OpenImpl: unsupported statement type!" ); + OSL_FAIL( "OResultSet::OpenImpl: unsupported statement type!" ); break; } diff --git a/connectivity/source/drivers/file/FTable.cxx b/connectivity/source/drivers/file/FTable.cxx index 2d31ff691e17..ddf70610939b 100755 --- a/connectivity/source/drivers/file/FTable.cxx +++ b/connectivity/source/drivers/file/FTable.cxx @@ -226,13 +226,13 @@ sal_Bool OFileTable::UpdateRow(OValueRefVector& /*rRow*/, OValueRefRow& /*pOrgRo void OFileTable::addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& /*descriptor*/) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::addColumn" ); - OSL_ENSURE( false, "OFileTable::addColumn: not implemented!" ); + OSL_FAIL( "OFileTable::addColumn: not implemented!" ); } // ----------------------------------------------------------------------------- void OFileTable::dropColumn(sal_Int32 /*_nPos*/) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::dropColumn" ); - OSL_ENSURE( false, "OFileTable::addColumn: not implemented!" ); + OSL_FAIL( "OFileTable::addColumn: not implemented!" ); } // ----------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/file/fanalyzer.cxx b/connectivity/source/drivers/file/fanalyzer.cxx index a69f521aff67..6cc7b6eaccb3 100755 --- a/connectivity/source/drivers/file/fanalyzer.cxx +++ b/connectivity/source/drivers/file/fanalyzer.cxx @@ -270,7 +270,7 @@ void OSQLAnalyzer::describeParam(::rtl::Reference<OSQLColumns> rParameterColumns if (IS_TYPE(OOperandResult,pOperand)) delete pOperand; else - OSL_ENSURE(0,"Illegal here!"); + OSL_FAIL("Illegal here!"); rParameterColumns = aNewParamColumns; } diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx index e8464c4740d7..bd920d356034 100755 --- a/connectivity/source/drivers/file/fcomp.cxx +++ b/connectivity/source/drivers/file/fcomp.cxx @@ -274,7 +274,7 @@ OOperand* OPredicateCompiler::execute_COMPARE(OSQLParseNode* pPredicateNode) th else if (pPrec->getNodeType() == SQL_NODE_GREAT) ePredicateType = SQLFilterOperator::GREATER; else - OSL_ENSURE( false, "OPredicateCompiler::execute_COMPARE: unexpected node type!" ); + OSL_FAIL( "OPredicateCompiler::execute_COMPARE: unexpected node type!" ); execute(pPredicateNode->getChild(0)); execute(pPredicateNode->getChild(2)); @@ -471,7 +471,7 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode* pPredicateNode) thr } catch(Exception &) { - OSL_ENSURE(0,"OPredicateCompiler::execute_Operand Exception"); + OSL_FAIL("OPredicateCompiler::execute_Operand Exception"); } } else if (SQL_ISRULE(pPredicateNode,parameter)) @@ -778,7 +778,7 @@ OOperand* OPredicateCompiler::executeFunction(OSQLParseNode* pPredicateNode) pOperator = new OOp_Second(); break; default: - OSL_ENSURE(0,"Error in switch!"); + OSL_FAIL("Error in switch!"); } break; case SQL_TOKEN_CHAR: @@ -866,7 +866,7 @@ OOperand* OPredicateCompiler::executeFunction(OSQLParseNode* pPredicateNode) pOperator = new OOp_Week(); break; default: - OSL_ENSURE(0,"Error in switch!"); + OSL_FAIL("Error in switch!"); } } break; diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index 0fc2a71ac10d..6756fd5a8447 100755 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -654,7 +654,7 @@ namespace connectivity } catch(Exception&) { - OSL_ENSURE( false, "ODriverDelegator::preCommit: caught an exception!" ); + OSL_FAIL( "ODriverDelegator::preCommit: caught an exception!" ); } } } @@ -805,7 +805,7 @@ namespace connectivity // second round, this time without matching the country return lcl_getCollationForLocale( _rLocaleString, true ); - OSL_ENSURE( false, "lcl_getCollationForLocale: unknown locale string, falling back to Latin1_General!" ); + OSL_FAIL( "lcl_getCollationForLocale: unknown locale string, falling back to Latin1_General!" ); return "Latin1_General"; } diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx index 1ce47beb572f..04f15cab4a21 100755 --- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx @@ -92,7 +92,7 @@ SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStor } catch(Exception&) { - OSL_ENSURE( false, "NativeStorageAccess::close: caught an exception while flushing!" ); + OSL_FAIL( "NativeStorageAccess::close: caught an exception while flushing!" ); } #ifdef HSQLDB_DBG { @@ -443,7 +443,7 @@ void write_to_storage_stream_from_buffer( JNIEnv* env, jobject /*obj_this*/, jst if (JNI_FALSE != env->ExceptionCheck()) { env->ExceptionClear(); - OSL_ENSURE(0,"ExceptionClear"); + OSL_FAIL("ExceptionClear"); } OSL_ENSURE(buf,"buf is NULL"); if ( buf && len > 0 && len <= env->GetArrayLength(buffer)) @@ -466,7 +466,7 @@ void write_to_storage_stream_from_buffer( JNIEnv* env, jobject /*obj_this*/, jst } catch(Exception& e) { - OSL_ENSURE(0,"Exception caught! : write [BII)V"); + OSL_FAIL("Exception caught! : write [BII)V"); StorageContainer::throwJavaException(e,env); } } @@ -525,7 +525,7 @@ void write_to_storage_stream( JNIEnv* env, jobject /*obj_this*/, jstring name, j } catch(Exception& e) { - OSL_ENSURE(0,"Exception catched! : writeBytes(aData);"); + OSL_FAIL("Exception catched! : writeBytes(aData);"); StorageContainer::throwJavaException(e,env); } } diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx index 6dbf7a30bbbe..f8bc5c53b0ce 100755 --- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx @@ -85,7 +85,7 @@ namespace connectivity catch(const Exception& e) { OSL_UNUSED( e ); - OSL_ENSURE(0,"Could not dispose OutputStream"); + OSL_FAIL("Could not dispose OutputStream"); } m_xOutputStream.clear(); } @@ -93,7 +93,7 @@ namespace connectivity catch(Exception& ex) { OSL_UNUSED( ex ); - OSL_ENSURE(0,"Exception catched!"); + OSL_FAIL("Exception catched!"); } } // ----------------------------------------------------------------------------- @@ -158,7 +158,7 @@ namespace connectivity if (JNI_FALSE != env->ExceptionCheck()) { env->ExceptionClear(); - OSL_ENSURE(0,"ExceptionClear"); + OSL_FAIL("ExceptionClear"); } ::rtl::OUString aStr; if ( jstr ) @@ -175,7 +175,7 @@ namespace connectivity if (JNI_FALSE != env->ExceptionCheck()) { env->ExceptionClear(); - OSL_ENSURE(0,"ExceptionClear"); + OSL_FAIL("ExceptionClear"); } return aStr; } @@ -313,7 +313,7 @@ namespace connectivity if ( _nMode < 16 ) sMessage += "0"; sMessage += ::rtl::OString::valueOf( _nMode, 16 ).toAsciiUpperCase(); - OSL_ENSURE( false, sMessage.getStr() ); + OSL_FAIL( sMessage.getStr() ); #endif StorageContainer::throwJavaException(e,env); } diff --git a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx index 5a51e6d9bb7f..9bd28fa0b0d4 100755 --- a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx +++ b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx @@ -91,7 +91,7 @@ SAL_DLLPUBLIC_EXPORT jboolean JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Storag } catch(Exception& e) { - OSL_ENSURE(0,"Exception catched! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_isStreamElement"); + OSL_FAIL("Exception catched! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_isStreamElement"); if (JNI_FALSE != env->ExceptionCheck()) env->ExceptionClear(); ::rtl::OString cstr( ::rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_JAVA_UTF8 ) ); @@ -130,7 +130,7 @@ SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageFil } catch(Exception& e) { - OSL_ENSURE(0,"Exception catched! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_removeElement"); + OSL_FAIL("Exception catched! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_removeElement"); StorageContainer::throwJavaException(e,env); } } @@ -173,7 +173,7 @@ SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageFil } catch(Exception& e) { - OSL_ENSURE(0,"Exception catched! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_renameElement"); + OSL_FAIL("Exception catched! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_renameElement"); StorageContainer::throwJavaException(e,env); } } diff --git a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx index b9b78a675936..28711c7bf277 100755 --- a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx +++ b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx @@ -191,7 +191,7 @@ SAL_DLLPUBLIC_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNa } catch(Exception& e) { - OSL_ENSURE(0,"Exception catched! : skip();"); + OSL_FAIL("Exception catched! : skip();"); StorageContainer::throwJavaException(e,env); } } @@ -234,7 +234,7 @@ SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNat } catch(Exception& e) { - OSL_ENSURE(0,"Exception caught! : available();"); + OSL_FAIL("Exception caught! : available();"); StorageContainer::throwJavaException(e,env); } } @@ -278,7 +278,7 @@ SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNat } catch(Exception& e) { - OSL_ENSURE(0,"Exception catched! : skip();"); + OSL_FAIL("Exception catched! : skip();"); StorageContainer::throwJavaException(e,env); } diff --git a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx index 4ef88ff7bdca..8bae08b4bf30 100755 --- a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx +++ b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx @@ -213,7 +213,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb } catch(Exception&) { - OSL_ENSURE( false, "StorageNativeOutputStream::sync: could not flush output stream!" ); + OSL_FAIL( "StorageNativeOutputStream::sync: could not flush output stream!" ); } } } diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx index 09e28dbac4c1..a2d9d453f20a 100755 --- a/connectivity/source/drivers/jdbc/ResultSet.cxx +++ b/connectivity/source/drivers/jdbc/ResultSet.cxx @@ -865,7 +865,7 @@ void SAL_CALL java_sql_ResultSet::updateObject( sal_Int32 columnIndex, const ::c void SAL_CALL java_sql_ResultSet::updateNumericObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateNumericObject" ); - // OSL_ENSURE(0,"java_sql_ResultSet::updateNumericObject: NYI"); + // OSL_FAIL("java_sql_ResultSet::updateNumericObject: NYI"); try { SDBThreadAttach t; diff --git a/connectivity/source/drivers/kab/KDatabaseMetaData.cxx b/connectivity/source/drivers/kab/KDatabaseMetaData.cxx index e27ce35bce04..870b46ed3546 100755 --- a/connectivity/source/drivers/kab/KDatabaseMetaData.cxx +++ b/connectivity/source/drivers/kab/KDatabaseMetaData.cxx @@ -1075,7 +1075,7 @@ Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getCrossReference( // ------------------------------------------------------------------------- Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getUDTs( const Any&, const ::rtl::OUString&, const ::rtl::OUString&, const Sequence< sal_Int32 >& ) throw(SQLException, RuntimeException) { - OSL_ENSURE(0,"Not implemented yet!"); + OSL_FAIL("Not implemented yet!"); throw SQLException(); } // ----------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/kab/KDriver.cxx b/connectivity/source/drivers/kab/KDriver.cxx index 20105d9b5db0..8c5554082078 100755 --- a/connectivity/source/drivers/kab/KDriver.cxx +++ b/connectivity/source/drivers/kab/KDriver.cxx @@ -106,7 +106,7 @@ namespace if ( !_rFunction ) { // did not find the symbol - OSL_ENSURE( false, ::rtl::OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + ::rtl::OString( _pAsciiSymbolName ) ); + OSL_FAIL( ::rtl::OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + ::rtl::OString( _pAsciiSymbolName ) ); osl_unloadModule( _rModule ); _rModule = NULL; } diff --git a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx index 896a5ca04c91..dcb776b6d3c2 100755 --- a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx +++ b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx @@ -1119,7 +1119,7 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getCrossReference( // ------------------------------------------------------------------------- Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getUDTs( const Any&, const ::rtl::OUString&, const ::rtl::OUString&, const Sequence< sal_Int32 >& ) throw(SQLException, RuntimeException) { - OSL_ENSURE(0,"Not implemented yet!"); + OSL_FAIL("Not implemented yet!"); throw SQLException(); } // ----------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/macab/MacabDriver.cxx b/connectivity/source/drivers/macab/MacabDriver.cxx index ed6c40867c2a..92d3e0f16963 100755 --- a/connectivity/source/drivers/macab/MacabDriver.cxx +++ b/connectivity/source/drivers/macab/MacabDriver.cxx @@ -84,7 +84,7 @@ namespace if ( !_rFunction ) { // did not find the symbol - OSL_ENSURE( false, ::rtl::OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + ::rtl::OString( _pAsciiSymbolName ) ); + OSL_FAIL( ::rtl::OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + ::rtl::OString( _pAsciiSymbolName ) ); osl_unloadModule( _rModule ); _rModule = NULL; } diff --git a/connectivity/source/drivers/macab/MacabRecords.cxx b/connectivity/source/drivers/macab/MacabRecords.cxx index 93cbca5b79f6..86d34a808355 100755 --- a/connectivity/source/drivers/macab/MacabRecords.cxx +++ b/connectivity/source/drivers/macab/MacabRecords.cxx @@ -448,7 +448,7 @@ MacabHeader *MacabRecords::createHeaderForRecordType(const CFArrayRef _records, else { // Couldn't find a required property... - OSL_ENSURE(false, ::rtl::OString("MacabRecords::createHeaderForRecordType: could not find required property: ") + + OSL_FAIL(::rtl::OString("MacabRecords::createHeaderForRecordType: could not find required property: ") + ::rtl::OUStringToOString(CFStringToOUString(requiredProperties[i]), RTL_TEXTENCODING_ASCII_US)); } } diff --git a/connectivity/source/drivers/mozab/MColumnAlias.cxx b/connectivity/source/drivers/mozab/MColumnAlias.cxx index 211a7c307542..4585bddd6331 100755 --- a/connectivity/source/drivers/mozab/MColumnAlias.cxx +++ b/connectivity/source/drivers/mozab/MColumnAlias.cxx @@ -174,7 +174,7 @@ void OColumnAlias::initialize( const ::com::sun::star::uno::Reference< ::com::su AliasMap::const_iterator pos = m_aAliasMap.find( _rAlias ); if ( pos == m_aAliasMap.end() ) { - OSL_ENSURE( false, "OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias: no programmatic name for this alias!" ); + OSL_FAIL( "OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias: no programmatic name for this alias!" ); return ::rtl::OUStringToOString( _rAlias, RTL_TEXTENCODING_UTF8 ); } return pos->second.programmaticAsciiName; diff --git a/connectivity/source/drivers/mozab/MConnection.cxx b/connectivity/source/drivers/mozab/MConnection.cxx index df121ffeacce..943bb7cc774e 100755 --- a/connectivity/source/drivers/mozab/MConnection.cxx +++ b/connectivity/source/drivers/mozab/MConnection.cxx @@ -573,11 +573,11 @@ void OConnection::throwSQLException( const ErrorDescriptor& _rError, const Refer "$1$", sParameter ) ); ::dbtools::throwGenericSQLException( sError, _rxContext ); - OSL_ENSURE( false, "OConnection::throwSQLException: unreachable (1)!" ); + OSL_FAIL( "OConnection::throwSQLException: unreachable (1)!" ); } throwGenericSQLException( _rError.getResId(), _rxContext ); - OSL_ENSURE( false, "OConnection::throwSQLException: unreachable (2)!" ); + OSL_FAIL( "OConnection::throwSQLException: unreachable (2)!" ); } if ( _rError.getErrorCondition() != 0 ) @@ -588,7 +588,7 @@ void OConnection::throwSQLException( const ErrorDescriptor& _rError, const Refer aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext, sParameter ); else aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext); - OSL_ENSURE( false, "OConnection::throwSQLException: unreachable (3)!" ); + OSL_FAIL( "OConnection::throwSQLException: unreachable (3)!" ); } throwGenericSQLException( STR_UNSPECIFIED_ERROR, _rxContext ); diff --git a/connectivity/source/drivers/mozab/MDriver.cxx b/connectivity/source/drivers/mozab/MDriver.cxx index e78ed7dab7f0..082a2bb9331e 100755 --- a/connectivity/source/drivers/mozab/MDriver.cxx +++ b/connectivity/source/drivers/mozab/MDriver.cxx @@ -283,7 +283,7 @@ namespace if ( !_rFunction ) { // did not find the symbol - OSL_ENSURE( false, ::rtl::OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + ::rtl::OString( _pAsciiSymbolName ) ); + OSL_FAIL( ::rtl::OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + ::rtl::OString( _pAsciiSymbolName ) ); osl_unloadModule( _rModule ); _rModule = NULL; } diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx index b233e19a8c56..9a891affdd08 100755 --- a/connectivity/source/drivers/mozab/MResultSet.cxx +++ b/connectivity/source/drivers/mozab/MResultSet.cxx @@ -172,7 +172,7 @@ void OResultSet::methodEntry() checkDisposed(OResultSet_BASE::rBHelper.bDisposed); if ( !m_pTable ) { - OSL_ENSURE( false, "OResultSet::methodEntry: looks like we're disposed, but how is this possible?" ); + OSL_FAIL( "OResultSet::methodEntry: looks like we're disposed, but how is this possible?" ); throw DisposedException( ::rtl::OUString(), *this ); } } @@ -642,7 +642,7 @@ sal_Bool OResultSet::convertFastPropertyValue( const Any& /*rValue*/ ) throw (::com::sun::star::lang::IllegalArgumentException) { - OSL_ENSURE( false, "OResultSet::convertFastPropertyValue: not implemented!" ); + OSL_FAIL( "OResultSet::convertFastPropertyValue: not implemented!" ); switch(nHandle) { case PROPERTY_ID_ISBOOKMARKABLE: @@ -663,7 +663,7 @@ void OResultSet::setFastPropertyValue_NoBroadcast( ) throw (Exception) { - OSL_ENSURE( false, "OResultSet::setFastPropertyValue_NoBroadcast: not implemented!" ); + OSL_FAIL( "OResultSet::setFastPropertyValue_NoBroadcast: not implemented!" ); switch(nHandle) { case PROPERTY_ID_ISBOOKMARKABLE: diff --git a/connectivity/source/drivers/mozab/MResultSetMetaData.cxx b/connectivity/source/drivers/mozab/MResultSetMetaData.cxx index 99894fb750e1..042207f6618e 100755 --- a/connectivity/source/drivers/mozab/MResultSetMetaData.cxx +++ b/connectivity/source/drivers/mozab/MResultSetMetaData.cxx @@ -175,7 +175,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQL if ( !m_pTable || !m_pTable->getConnection() ) { - OSL_ENSURE( false, "OResultSetMetaData::isSearchable: suspicious: called without table or connection!" ); + OSL_FAIL( "OResultSetMetaData::isSearchable: suspicious: called without table or connection!" ); return sal_False; } diff --git a/connectivity/source/drivers/mozab/MStatement.cxx b/connectivity/source/drivers/mozab/MStatement.cxx index 709676b21966..2070f8da37c8 100755 --- a/connectivity/source/drivers/mozab/MStatement.cxx +++ b/connectivity/source/drivers/mozab/MStatement.cxx @@ -255,7 +255,7 @@ OCommonStatement::StatementType OCommonStatement::parseSql( const ::rtl::OUStrin } getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this ); - OSL_ENSURE( false, "OCommonStatement::parseSql: unreachable!" ); + OSL_FAIL( "OCommonStatement::parseSql: unreachable!" ); return eSelect; } diff --git a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx index 4af7668e4ec2..7f625c59a1b7 100755 --- a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx @@ -188,7 +188,7 @@ namespace connectivity { namespace mozab { // ------------------------------------------------------------------- NS_IMETHODIMP MLdapAttributeMap::GetAttributes(const nsACString & aProperty, PRUint32* aCount, char*** aAttrs) { - OSL_ENSURE( false, "MLdapAttributeMap::GetAttributes: not implemented!" ); + OSL_FAIL( "MLdapAttributeMap::GetAttributes: not implemented!" ); (void)aProperty; (void)aCount; (void)aAttrs; @@ -220,7 +220,7 @@ namespace connectivity { namespace mozab { // ------------------------------------------------------------------- NS_IMETHODIMP MLdapAttributeMap::SetAttributeList(const nsACString & aProperty, const nsACString & aAttributeList, PRBool allowInconsistencies) { - OSL_ENSURE( false, "MLdapAttributeMap::SetAttributeList: not implemented!" ); + OSL_FAIL( "MLdapAttributeMap::SetAttributeList: not implemented!" ); (void)aProperty; (void)aAttributeList; (void)allowInconsistencies; @@ -230,7 +230,7 @@ namespace connectivity { namespace mozab { // ------------------------------------------------------------------- NS_IMETHODIMP MLdapAttributeMap::GetProperty(const nsACString & aAttribute, nsACString & _retval) { - OSL_ENSURE( false, "MLdapAttributeMap::GetProperty: not implemented!" ); + OSL_FAIL( "MLdapAttributeMap::GetProperty: not implemented!" ); (void)aAttribute; (void)_retval; return NS_ERROR_NOT_IMPLEMENTED; @@ -266,7 +266,7 @@ namespace connectivity { namespace mozab { // ------------------------------------------------------------------- NS_IMETHODIMP MLdapAttributeMap::SetFromPrefs(const nsACString & aPrefBranchName) { - OSL_ENSURE( false, "MLdapAttributeMap::SetFromPrefs: not implemented!" ); + OSL_FAIL( "MLdapAttributeMap::SetFromPrefs: not implemented!" ); (void)aPrefBranchName; return NS_ERROR_NOT_IMPLEMENTED; } @@ -396,7 +396,7 @@ namespace connectivity { namespace mozab { _card.SetPreferMailFormat(format); } else - OSL_ENSURE( false, "MLdapAttributeMap::fillCardFromResult: unexpected property without default setters!" ); + OSL_FAIL( "MLdapAttributeMap::fillCardFromResult: unexpected property without default setters!" ); } } } @@ -439,7 +439,7 @@ namespace connectivity { namespace mozab { } } else - OSL_ENSURE( false, "MLdapAttributeMap::fillResultFromCard: unexpected property without default getters!" ); + OSL_FAIL( "MLdapAttributeMap::fillResultFromCard: unexpected property without default getters!" ); } _result.insert( prop->first, resultValue ); diff --git a/connectivity/source/drivers/odbc/ORealDriver.cxx b/connectivity/source/drivers/odbc/ORealDriver.cxx index 1bca9cccc78a..c786df3e9b89 100755 --- a/connectivity/source/drivers/odbc/ORealDriver.cxx +++ b/connectivity/source/drivers/odbc/ORealDriver.cxx @@ -330,7 +330,7 @@ oslGenericFunction ORealObdcDriver::getOdbcFunction(sal_Int32 _nIndex) const pFunction = (oslGenericFunction)pODBC3SQLNativeSql; break; default: - OSL_ENSURE(0,"Function unknown!"); + OSL_FAIL("Function unknown!"); } return pFunction; } diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx index 8d880caa534f..55f7548d5f70 100755 --- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx +++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx @@ -795,7 +795,7 @@ void ODatabaseMetaDataResultSet::setFastPropertyValue_NoBroadcast( sal_Int32 nHa case PROPERTY_ID_FETCHSIZE: throw Exception(); default: - OSL_ENSURE(0,"setFastPropertyValue_NoBroadcast: Illegal handle value!"); + OSL_FAIL("setFastPropertyValue_NoBroadcast: Illegal handle value!"); } } // ------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx index e93a465cea3b..e789f4bd111b 100755 --- a/connectivity/source/drivers/odbcbase/OResultSet.cxx +++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx @@ -320,7 +320,7 @@ TVoidPtr OResultSet::allocBindColumn(sal_Int32 _nType,sal_Int32 _nColumnIndex) aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new sal_Int8[m_aRow[_nColumnIndex].getSequence().getLength()]),_nType); break; default: - OSL_ENSURE(0,"Unknown type"); + OSL_FAIL("Unknown type"); aPair = TVoidPtr(0,_nType); } return aPair; @@ -1605,7 +1605,7 @@ sal_Bool OResultSet::move(IResultSetHelper::Movement _eCursorPosition, sal_Int32 if ( aIter->second == _nOffset ) return moveToBookmark(makeAny(aIter->first)); } - OSL_ENSURE(0,"Bookmark not found!"); + OSL_FAIL("Bookmark not found!"); } return sal_False; } @@ -1740,7 +1740,7 @@ void OResultSet::fillNeededData(SQLRETURN _nRet) break; } default: - OSL_ENSURE(0,"Not supported at the moment!"); + OSL_FAIL("Not supported at the moment!"); } nRet = N3SQLParamData(m_aStatementHandle,&pColumnIndex); } diff --git a/connectivity/source/drivers/odbcbase/OStatement.cxx b/connectivity/source/drivers/odbcbase/OStatement.cxx index 51689b44e2b5..8a92fa87911c 100755 --- a/connectivity/source/drivers/odbcbase/OStatement.cxx +++ b/connectivity/source/drivers/odbcbase/OStatement.cxx @@ -64,7 +64,7 @@ using namespace ::comphelper; } \ catch(SQLException&) \ { \ - OSL_ENSURE(0,"Exception in odbc catched"); \ + OSL_FAIL("Exception in odbc catched"); \ } #endif @@ -839,7 +839,7 @@ void OStatement_Base::setResultSetType(sal_Int32 _par0) nSet = SQL_SENSITIVE; break; default: - OSL_ENSURE( false, "OStatement_Base::setResultSetType: invalid result set type!" ); + OSL_FAIL( "OStatement_Base::setResultSetType: invalid result set type!" ); break; } @@ -1048,7 +1048,7 @@ void OStatement_Base::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const A setEscapeProcessing( ::comphelper::getBOOL( rValue ) ); break; default: - OSL_ENSURE( false, "OStatement_Base::setFastPropertyValue_NoBroadcast: what property?" ); + OSL_FAIL( "OStatement_Base::setFastPropertyValue_NoBroadcast: what property?" ); break; } } @@ -1093,7 +1093,7 @@ void OStatement_Base::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const rValue <<= getEscapeProcessing(); break; default: - OSL_ENSURE( false, "OStatement_Base::getFastPropertyValue: what property?" ); + OSL_FAIL( "OStatement_Base::getFastPropertyValue: what property?" ); break; } } diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx index 8ae72766fc04..d9eb8647d485 100755 --- a/connectivity/source/drivers/odbcbase/OTools.cxx +++ b/connectivity/source/drivers/odbcbase/OTools.cxx @@ -433,7 +433,7 @@ void OTools::ThrowException(OConnection* _pConnection, case SQL_ERROR: break; - case SQL_INVALID_HANDLE: OSL_ENSURE(0,"SdbODBC3_SetStatus: SQL_INVALID_HANDLE"); + case SQL_INVALID_HANDLE: OSL_FAIL("SdbODBC3_SetStatus: SQL_INVALID_HANDLE"); throw SQLException(); } diff --git a/connectivity/source/inc/ado/Aolewrap.hxx b/connectivity/source/inc/ado/Aolewrap.hxx index 79371befcb7f..46dcf18668e6 100755 --- a/connectivity/source/inc/ado/Aolewrap.hxx +++ b/connectivity/source/inc/ado/Aolewrap.hxx @@ -190,7 +190,7 @@ namespace connectivity #if OSL_DEBUG_LEVEL > 0 ::rtl::OString sTemp("Unknown Item: "); sTemp += ::rtl::OString(sStr.getStr(),sStr.getLength(),osl_getThreadTextEncoding()); - OSL_ENSURE(0,sTemp); + OSL_FAIL(sTemp); #endif } else diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y index 498f9aad900f..dbfbd7ad1322 100755 --- a/connectivity/source/parse/sqlbison.y +++ b/connectivity/source/parse/sqlbison.y @@ -3949,7 +3949,7 @@ OParseContext::~OParseContext() case ERROR_INVALID_TABLE_EXIST: aMsg = ERROR_STR_INVALID_TABLE_EXIST; break; case ERROR_INVALID_QUERY_EXIST: aMsg = ERROR_STR_INVALID_QUERY_EXIST; break; default: - OSL_ENSURE( false, "OParseContext::getErrorMessage: unknown error code!" ); + OSL_FAIL( "OParseContext::getErrorMessage: unknown error code!" ); break; } return aMsg; @@ -3987,7 +3987,7 @@ OParseContext::~OParseContext() case KEY_INTERSECTION:aKeyword = KEY_STR_INTERSECTION; break; case KEY_NONE: break; default: - OSL_ENSURE( false, "OParseContext::getIntlKeywordAscii: unknown key!" ); + OSL_FAIL( "OParseContext::getIntlKeywordAscii: unknown key!" ); break; } return aKeyword; diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l index 8a4f5e577908..c959230c0da9 100755 --- a/connectivity/source/parse/sqlflex.l +++ b/connectivity/source/parse/sqlflex.l @@ -565,7 +565,7 @@ sal_Int32 mapEnumToToken(IParseContext::InternationalKeyCode _eKeyCode ) case IParseContext::KEY_FUSION: nTokenID = SQL_TOKEN_FUSION; break; case IParseContext::KEY_INTERSECTION: nTokenID = SQL_TOKEN_INTERSECTION; break; default: - OSL_ENSURE( false, "mapEnumToToken: unsupported key!" ); + OSL_FAIL( "mapEnumToToken: unsupported key!" ); } return nTokenID; } diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index f3f4ff179e02..59c7287fcdd8 100755 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -376,7 +376,7 @@ OSQLTable OSQLParseTreeIterator::impl_locateRecordSource( const ::rtl::OUString& RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::impl_locateRecordSource" ); if ( !_rComposedName.getLength() ) { - OSL_ENSURE( false, "OSQLParseTreeIterator::impl_locateRecordSource: no object name at all?" ); + OSL_FAIL( "OSQLParseTreeIterator::impl_locateRecordSource: no object name at all?" ); return OSQLTable(); } @@ -605,7 +605,7 @@ const OSQLParseNode* OSQLParseTreeIterator::getTableNode( OSQLTables& _rTables, } else { - OSL_ENSURE( false, "OSQLParseTreeIterator::getTableNode: subquery which is no select_statement: not yet implemented!" ); + OSL_FAIL( "OSQLParseTreeIterator::getTableNode: subquery which is no select_statement: not yet implemented!" ); } } } @@ -614,7 +614,7 @@ const OSQLParseNode* OSQLParseTreeIterator::getTableNode( OSQLTables& _rTables, pTableNameNode = pTableRef->getChild(0); } else - OSL_ENSURE( false, "OSQLParseTreeIterator::getTableNode: unhandled case!" ); + OSL_FAIL( "OSQLParseTreeIterator::getTableNode: unhandled case!" ); } return pTableNameNode; diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 9ccad33c6c4a..c69017e0744b 100755 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -314,7 +314,7 @@ void OSQLParseNode::parseNodeToStr(::rtl::OUString& rString, } catch( const SQLException& ) { - OSL_ENSURE( false, "OSQLParseNode::parseNodeToStr: this should not throw!" ); + OSL_FAIL( "OSQLParseNode::parseNodeToStr: this should not throw!" ); // our callers don't expect this method to throw anything. The only known situation // where impl_parseNodeToString_throw can throw is when there is a cyclic reference // in the sub queries, but this cannot be the case here, as we do not parse to @@ -702,7 +702,7 @@ void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUStringBuffer& rSt } catch ( Exception& ) { - OSL_ENSURE( false, "OSQLParseNode::impl_parseLikeNodeToString_throw Exception occurred!" ); + OSL_FAIL( "OSQLParseNode::impl_parseLikeNodeToString_throw Exception occurred!" ); } if ( !m_aChildren[0]->isLeaf() ) { @@ -775,7 +775,7 @@ sal_Bool OSQLParseNode::getTableComponents(const OSQLParseNode* _pTableNode, } else { - OSL_ENSURE(0,"Error in parse tree!"); + OSL_FAIL("Error in parse tree!"); } } return _rTable.getLength() != 0; @@ -1216,7 +1216,7 @@ OSQLParseNode* OSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const : } catch ( Exception& ) { - OSL_ENSURE(0,"DateFormatKey"); + OSL_FAIL("DateFormatKey"); } } @@ -1980,7 +1980,7 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_B pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("=")),SQL_NODE_EQUAL,SQL_EQUAL); break; default: - OSL_ENSURE( false, "OSQLParseNode::negateSearchCondition: unexpected node type!" ); + OSL_FAIL( "OSQLParseNode::negateSearchCondition: unexpected node type!" ); break; } pSearchCondition->replace(pComparison, pNewComparison); @@ -2369,7 +2369,7 @@ void OSQLParseNode::showParseTree( ::rtl::OUStringBuffer& _inout_rBuffer, sal_uI default: OSL_TRACE( "-- %i", int( m_eNodeType ) ); - OSL_ENSURE( false, "OSQLParser::ShowParseTree: unzulaessiger NodeType" ); + OSL_FAIL( "OSQLParser::ShowParseTree: unzulaessiger NodeType" ); } } } diff --git a/connectivity/source/sdbcx/VCatalog.cxx b/connectivity/source/sdbcx/VCatalog.cxx index f49c9e4fdbeb..8ea37b7cb216 100755 --- a/connectivity/source/sdbcx/VCatalog.cxx +++ b/connectivity/source/sdbcx/VCatalog.cxx @@ -61,7 +61,7 @@ OCatalog::OCatalog(const Reference< XConnection> &_xConnection) : OCatalog_BASE( } catch(const Exception&) { - OSL_ENSURE(0,"No Metadata available!"); + OSL_FAIL("No Metadata available!"); } } //----------------------------------------------------------------------------- diff --git a/connectivity/source/sdbcx/VIndex.cxx b/connectivity/source/sdbcx/VIndex.cxx index e05b6e43056b..3326952d231d 100755 --- a/connectivity/source/sdbcx/VIndex.cxx +++ b/connectivity/source/sdbcx/VIndex.cxx @@ -177,7 +177,7 @@ Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OIndex::getColumn } catch( const Exception& ) { - OSL_ENSURE( false, "OIndex::getColumns: caught an exception!" ); + OSL_FAIL( "OIndex::getColumns: caught an exception!" ); } return const_cast<OIndex*>(this)->m_pColumns; diff --git a/connectivity/source/sdbcx/VUser.cxx b/connectivity/source/sdbcx/VUser.cxx index 1b4a9b132c90..7bcdd52f8541 100755 --- a/connectivity/source/sdbcx/VUser.cxx +++ b/connectivity/source/sdbcx/VUser.cxx @@ -176,7 +176,7 @@ void SAL_CALL OUser::revokePrivileges( const ::rtl::OUString& /*objName*/, sal_I // ----------------------------------------------------------------------------- void SAL_CALL OUser::setName( const ::rtl::OUString& /*aName*/ ) throw(::com::sun::star::uno::RuntimeException) { - OSL_ENSURE( false, "OUser::setName: not implemented!" ); + OSL_FAIL( "OUser::setName: not implemented!" ); // not allowed to throw an SQLException here ... } // ----------------------------------------------------------------------------- |