diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2011-03-12 14:27:45 +0100 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2011-03-13 16:50:43 +0100 |
commit | 1848de2f4cce84862cf0843e15f38ce5d1f26108 (patch) | |
tree | 38d3983e56f5d2c900c24750e0050556435cfd6b | |
parent | e4d0bb122a93d243067814b9d43f9c9ab1e4df65 (diff) |
Move OSL_ENSURE(false,...) to OSL_FAIL(...)
136 files changed, 340 insertions, 378 deletions
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx index 2057a065e96c..c01b736c10d8 100644 --- a/basic/source/basmgr/basicmanagerrepository.cxx +++ b/basic/source/basmgr/basicmanagerrepository.cxx @@ -594,7 +594,7 @@ namespace basic // a BasicManager which is still in our repository is being deleted. // That's bad, since by definition, we *own* all instances in our // repository. - OSL_ENSURE( false, "ImplRepository::Notify: nobody should tamper with the managers, except ourself!" ); + OSL_FAIL( "ImplRepository::Notify: nobody should tamper with the managers, except ourself!" ); m_aStore.erase( loop ); break; } diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 28b783c3d7d8..5185ff77abde 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -178,7 +178,7 @@ DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ), mName( pV } catch( Exception& ) { - OSL_ENSURE( false, "DocObjectWrapper::DocObjectWrapper: Caught exception!" ); + OSL_FAIL( "DocObjectWrapper::DocObjectWrapper: Caught exception!" ); } } diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 48f8169d71d3..d654d58f1607 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -884,7 +884,7 @@ sal_Bool SfxLibraryContainer::init_Impl( aMessage.append( ::rtl::OUStringToOString( rLib.aName, osl_getThreadTextEncoding() ) ); aMessage.append( "'.\n\nException:" ); aMessage.append( ::rtl::OUStringToOString( ::comphelper::anyToString( aError ), osl_getThreadTextEncoding() ) ); - OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() ); + OSL_FAIL( aMessage.makeStringAndClear().getStr() ); #endif } } @@ -1379,7 +1379,7 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib, aMessage.append( "invalid library element '" ); aMessage.append( ::rtl::OUStringToOString( aElementName, osl_getThreadTextEncoding() ) ); aMessage.append( "'." ); - OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() ); + OSL_FAIL( aMessage.makeStringAndClear().getStr() ); #endif continue; } @@ -1468,7 +1468,7 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib, aMessage.append( "invalid library element '" ); aMessage.append( ::rtl::OUStringToOString( aElementName, osl_getThreadTextEncoding() ) ); aMessage.append( "'." ); - OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() ); + OSL_FAIL( aMessage.makeStringAndClear().getStr() ); #endif continue; } @@ -1893,7 +1893,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto aMessage.append( ::rtl::OUStringToOString( rLib.aName, osl_getThreadTextEncoding() ) ); aMessage.append( "'.\n\nException:" ); aMessage.append( ::rtl::OUStringToOString( ::comphelper::anyToString( aError ), osl_getThreadTextEncoding() ) ); - OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() ); + OSL_FAIL( aMessage.makeStringAndClear().getStr() ); #endif return; } @@ -2314,7 +2314,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name ) aMessage.append( ::rtl::OUStringToOString( Name, osl_getThreadTextEncoding() ) ); aMessage.append( "'.\n\nException:" ); aMessage.append( ::rtl::OUStringToOString( ::comphelper::anyToString( aError ), osl_getThreadTextEncoding() ) ); - OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() ); + OSL_FAIL( aMessage.makeStringAndClear().getStr() ); #endif return; } @@ -2364,7 +2364,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name ) aMessage.append( "couln't open library element stream - attempted to open library '" ); aMessage.append( ::rtl::OUStringToOString( Name, osl_getThreadTextEncoding() ) ); aMessage.append( "'." ); - OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() ); + OSL_FAIL( aMessage.makeStringAndClear().getStr() ); #endif return; } @@ -3188,7 +3188,7 @@ rtl::OUString ScriptExtensionIterator::nextBasicOrDialogLibrary( bool& rbPureDia break; } case END_REACHED: - OSL_ENSURE( false, "ScriptExtensionIterator::nextBasicOrDialogLibrary(): Invalid case END_REACHED" ); + OSL_FAIL( "ScriptExtensionIterator::nextBasicOrDialogLibrary(): Invalid case END_REACHED" ); break; } } diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index e1b4cf40459b..ecc9c6c4cad9 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -691,7 +691,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, aMessage.append( "invalid library element '" ); aMessage.append( ::rtl::OUStringToOString( aElementName, osl_getThreadTextEncoding() ) ); aMessage.append( "'." ); - OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() ); + OSL_FAIL( aMessage.makeStringAndClear().getStr() ); #endif continue; } @@ -777,7 +777,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, aMessage.append( "invalid library element '" ); aMessage.append( ::rtl::OUStringToOString( aElementName, osl_getThreadTextEncoding() ) ); aMessage.append( "'." ); - OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() ); + OSL_FAIL( aMessage.makeStringAndClear().getStr() ); #endif continue; } diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index 73f77f85cc6d..e02dd44c0e53 100644 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -424,7 +424,7 @@ double DBTypeConversion::getValue(const Reference<XColumn>& xVariant, } catch (const Exception& ) { - OSL_ENSURE(false, "DBTypeConversion::getValue: 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/FValue.cxx b/connectivity/source/commontools/FValue.cxx index ddcafc06fc91..88add8593e30 100644 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -2157,7 +2157,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; } @@ -2275,7 +2275,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; } @@ -2297,7 +2297,7 @@ void ORowSetValue::fill(const Any& _rValue) (*this) = aDateTime; } else - OSL_ENSURE( false, "ORowSetValue::fill: unsupported structure!" ); + OSL_FAIL( "ORowSetValue::fill: unsupported structure!" ); break; } diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index f0259e0de5f1..5d3027a627b1 100644 --- 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(); diff --git a/connectivity/source/commontools/dbexception.cxx b/connectivity/source/commontools/dbexception.cxx index ea96f9cb0c9e..e79f0dda4d49 100644 --- 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 f78135404fe8..393a3db5b051 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -1438,7 +1438,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!" ); } } diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 6288a543d241..5306e37a7673 100644 --- 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!" ); } } diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx index 8bde02cd5239..e8acf0ad3613 100644 --- 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/adoimp.cxx b/connectivity/source/drivers/ado/adoimp.cxx index 9f8c0afb96b3..0ccb8916ecb8 100644 --- a/connectivity/source/drivers/ado/adoimp.cxx +++ b/connectivity/source/drivers/ado/adoimp.cxx @@ -263,7 +263,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/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index a37214e80a6c..123e68330715 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -600,7 +600,7 @@ 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 TRUE; diff --git a/connectivity/source/drivers/evoab/LDriver.cxx b/connectivity/source/drivers/evoab/LDriver.cxx index 637203e787d9..53ac9fc3ec39 100644 --- 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/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx index 2ea738ad3419..30773e4ea665 100644 --- 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/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index b9f60f63b076..895afd6f9e9a 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -1607,7 +1607,7 @@ 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 1aadb836fbac..4ee04b5d99c7 100644 --- a/connectivity/source/drivers/file/FTable.cxx +++ b/connectivity/source/drivers/file/FTable.cxx @@ -226,13 +226,13 @@ BOOL OFileTable::UpdateRow(OValueRefVector& /*rRow*/, OValueRefRow& /*pOrgRow*/, 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/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx index f4a87d0ba1a1..634ee8e67608 100644 --- 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)); diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index 2a2b33a65154..818fb4d293e1 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -638,7 +638,7 @@ namespace connectivity } catch(Exception&) { - OSL_ENSURE( false, "ODriverDelegator::preCommit: caught an exception!" ); + OSL_FAIL( "ODriverDelegator::preCommit: caught an exception!" ); } } } @@ -789,7 +789,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 cefec2c3ee08..04f15cab4a21 100644 --- 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 { diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx index 67daadd3515a..535f821c4902 100644 --- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx @@ -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/StorageNativeOutputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx index 4ef88ff7bdca..8bae08b4bf30 100644 --- 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/kab/KDriver.cxx b/connectivity/source/drivers/kab/KDriver.cxx index 20105d9b5db0..8c5554082078 100644 --- 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/MacabDriver.cxx b/connectivity/source/drivers/macab/MacabDriver.cxx index ed6c40867c2a..92d3e0f16963 100644 --- 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 100644 --- 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 100644 --- 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 100644 --- 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 c0f0a39316bb..3132834c58bd 100644 --- 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 a41cbf780713..d50c9817aeb8 100644 --- 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 100644 --- 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 100644 --- 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 100644 --- 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/odbcbase/OStatement.cxx b/connectivity/source/drivers/odbcbase/OStatement.cxx index f6d6a78323b2..8a92fa87911c 100644 --- a/connectivity/source/drivers/odbcbase/OStatement.cxx +++ b/connectivity/source/drivers/odbcbase/OStatement.cxx @@ -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/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 8bcf122e22de..1f8ef88242d2 100644 --- 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 742e059617b6..c69017e0744b 100644 --- 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() ) { @@ -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/VIndex.cxx b/connectivity/source/sdbcx/VIndex.cxx index e05b6e43056b..3326952d231d 100644 --- 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 100644 --- 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 ... } // ----------------------------------------------------------------------------- diff --git a/desktop/source/migration/services/autocorrmigration.cxx b/desktop/source/migration/services/autocorrmigration.cxx index b6e8a13b4335..2fd53751a71f 100644 --- a/desktop/source/migration/services/autocorrmigration.cxx +++ b/desktop/source/migration/services/autocorrmigration.cxx @@ -246,7 +246,7 @@ namespace migration { if ( !(aValue.Value >>= m_sSourceDir) ) { - OSL_ENSURE( false, "AutocorrectionMigration::initialize: argument UserData has wrong type!" ); + OSL_FAIL( "AutocorrectionMigration::initialize: argument UserData has wrong type!" ); } m_sSourceDir += sSourceSubDir; break; diff --git a/desktop/source/migration/services/basicmigration.cxx b/desktop/source/migration/services/basicmigration.cxx index 33b9cf9a4ef7..2d4530cf1a9a 100644 --- a/desktop/source/migration/services/basicmigration.cxx +++ b/desktop/source/migration/services/basicmigration.cxx @@ -235,7 +235,7 @@ namespace migration { if ( !(aValue.Value >>= m_sSourceDir) ) { - OSL_ENSURE( false, "BasicMigration::initialize: argument UserData has wrong type!" ); + OSL_FAIL( "BasicMigration::initialize: argument UserData has wrong type!" ); } m_sSourceDir += sSourceUserBasic; break; diff --git a/desktop/source/migration/services/jvmfwk.cxx b/desktop/source/migration/services/jvmfwk.cxx index 95d870139e03..53c3596ae4f4 100644 --- a/desktop/source/migration/services/jvmfwk.cxx +++ b/desktop/source/migration/services/jvmfwk.cxx @@ -301,8 +301,7 @@ void SAL_CALL JavaMigration::initialize( const css::uno::Sequence< css::uno::Any { if ( !(aValue.Value >>= m_sUserDir) ) { - OSL_ENSURE( - false, + OSL_FAIL( "[Service implementation " IMPL_NAME "] XInitialization::initialize: Argument UserData has wrong type."); } diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx index defc8ac9b452..2741db8d3836 100644 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -419,7 +419,7 @@ void OO3ExtensionMigration::initialize( const Sequence< Any >& aArguments ) thro { if ( !(aValue.Value >>= m_sSourceDir) ) { - OSL_ENSURE( false, "ExtensionMigration::initialize: argument UserData has wrong type!" ); + OSL_FAIL( "ExtensionMigration::initialize: argument UserData has wrong type!" ); } } else if ( aValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ExtensionBlackList" ) ) ) diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx index 7b6efb840490..d40654e01c15 100644 --- a/desktop/source/migration/services/wordbookmigration.cxx +++ b/desktop/source/migration/services/wordbookmigration.cxx @@ -283,7 +283,7 @@ bool IsUserWordbook( const ::rtl::OUString& rFile ) { if ( !(aValue.Value >>= m_sSourceDir) ) { - OSL_ENSURE( false, "WordbookMigration::initialize: argument UserData has wrong type!" ); + OSL_FAIL( "WordbookMigration::initialize: argument UserData has wrong type!" ); } m_sSourceDir += sSourceSubDir; break; diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index d205981205aa..5d3e5181855d 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -2115,7 +2115,7 @@ namespace case META_TEXTRECT_ACTION : { /** CHECKED, WORKS WELL */ - // OSL_ENSURE(false, "META_TEXTRECT_ACTION requested (!)"); + // OSL_FAIL("META_TEXTRECT_ACTION requested (!)"); const MetaTextRectAction* pA = (const MetaTextRectAction*)pAction; const Rectangle& rRectangle = pA->GetRect(); const sal_uInt32 nStringLength(pA->GetText().Len()); @@ -2729,7 +2729,7 @@ namespace } default : { - OSL_ENSURE(false, "interpretMetafile: META_MAPMODE_ACTION with unsupported MapUnit (!)"); + OSL_FAIL("interpretMetafile: META_MAPMODE_ACTION with unsupported MapUnit (!)"); break; } } @@ -3147,7 +3147,7 @@ namespace } default: { - OSL_ENSURE(false, "Unknown MetaFile Action (!)"); + OSL_FAIL("Unknown MetaFile Action (!)"); break; } } diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index ceb8e8d5dd47..89894cc2396a 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -850,7 +850,7 @@ namespace drawinglayer } catch(const uno::Exception&) { - OSL_ENSURE(false, "VclMetafileProcessor2D: No access to printable flag of Control, caught an exception!"); + OSL_FAIL("VclMetafileProcessor2D: No access to printable flag of Control, caught an exception!"); } } @@ -927,7 +927,7 @@ namespace drawinglayer } catch( const uno::Exception& ) { - OSL_ENSURE(false, "VclMetafileProcessor2D: Printing of Control failed, caught an exception!"); + OSL_FAIL("VclMetafileProcessor2D: Printing of Control failed, caught an exception!"); } } diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 6d38fee1e729..bcadb6abd545 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -1963,7 +1963,7 @@ namespace accessibility PropertyState eState = aPropSet._getPropertyState( pProperties->Name, mnParagraphIndex ); if ( eState == PropertyState_AMBIGUOUS_VALUE ) { - OSL_ENSURE( false, "ambiguous property value encountered" ); + OSL_FAIL( "ambiguous property value encountered" ); } //if (eState == PropertyState_DIRECT_VALUE) diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx index b57ec1be337f..989c6d0b4f17 100644 --- a/editeng/source/outliner/outlobj.cxx +++ b/editeng/source/outliner/outlobj.cxx @@ -225,7 +225,7 @@ const ParagraphData& OutlinerParaObject::GetParagraphData(sal_uInt32 nIndex) con } else { - OSL_ENSURE(false, "OutlinerParaObject::GetParagraphData: Access out of range (!)"); + OSL_FAIL("OutlinerParaObject::GetParagraphData: Access out of range (!)"); static ParagraphData aEmptyParagraphData; return aEmptyParagraphData; } diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index c15dbcf4401d..bc62bebd0b4a 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -327,7 +327,7 @@ void OCommonEmbeddedObject::EmbedAndReparentDoc_Impl( const uno::Reference< util } catch( const lang::NoSupportException & ) { - OSL_ENSURE( false, "OCommonEmbeddedObject::EmbedAndReparentDoc: cannot set parent at document!" ); + OSL_FAIL( "OCommonEmbeddedObject::EmbedAndReparentDoc: cannot set parent at document!" ); } } @@ -1061,7 +1061,7 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry( m_pDocHolder->SetOutplaceFrameProperties( aOutFrameProps ); } else - OSL_ENSURE( false, "OCommonEmbeddedObject::setPersistentEntry: illegal type for argument 'OutplaceFrameProperties'!" ); + OSL_FAIL( "OCommonEmbeddedObject::setPersistentEntry: illegal type for argument 'OutplaceFrameProperties'!" ); } else if ( lObjArgs[nObjInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ModuleName" ) ) ) { diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx index 545c54b9fa3f..0f7dda31a26c 100644 --- a/fpicker/source/win32/filepicker/FilePicker.cxx +++ b/fpicker/source/win32/filepicker/FilePicker.cxx @@ -238,7 +238,7 @@ rtl::OUString SAL_CALL CFilePicker::helpRequested(FilePickerEvent aEvent) const } catch(uno::RuntimeException&) { - OSL_ENSURE( false, "RuntimeException during event dispatching" ); + OSL_FAIL( "RuntimeException during event dispatching" ); } } } diff --git a/fpicker/source/win32/filepicker/asynceventnotifier.cxx b/fpicker/source/win32/filepicker/asynceventnotifier.cxx index 02805f007a8e..eeba8c595940 100644 --- a/fpicker/source/win32/filepicker/asynceventnotifier.cxx +++ b/fpicker/source/win32/filepicker/asynceventnotifier.cxx @@ -180,7 +180,7 @@ void SAL_CALL CAsyncEventNotifier::shutdown() // we are waiting infinite, so error will // be better detected in form of deadlocks if (WaitForSingleObject(m_hThread, INFINITE) == WAIT_FAILED) { - OSL_ENSURE(false, "Waiting for thread termination failed!"); + OSL_FAIL("Waiting for thread termination failed!"); } // lock mutex again to reset m_hThread diff --git a/fpicker/source/win32/filepicker/customcontrolfactory.cxx b/fpicker/source/win32/filepicker/customcontrolfactory.cxx index d21afa49a7c9..c933821641d6 100644 --- a/fpicker/source/win32/filepicker/customcontrolfactory.cxx +++ b/fpicker/source/win32/filepicker/customcontrolfactory.cxx @@ -50,7 +50,7 @@ CCustomControl* CCustomControlFactory::CreateCustomControl(HWND aControlHandle, TCHAR aClsName[256]; ZeroMemory(aClsName,sizeof(aClsName)); if (GetClassName(aControlHandle,aClsName,sizeof(aClsName)) == 0) { - OSL_ENSURE(false,"Invalid window handle"); + OSL_FAIL("Invalid window handle"); } if (0 == _tcsicmp(aClsName,TEXT("button"))) diff --git a/fpicker/source/win32/filepicker/helppopupwindow.cxx b/fpicker/source/win32/filepicker/helppopupwindow.cxx index f1faf3928416..46021a49777b 100644 --- a/fpicker/source/win32/filepicker/helppopupwindow.cxx +++ b/fpicker/source/win32/filepicker/helppopupwindow.cxx @@ -608,7 +608,7 @@ void SAL_CALL CHelpPopupWindow::UnregisterWindowClass( ) if ( !UnregisterClass( (LPCTSTR)MAKELONG( s_ClassAtom, 0 ), m_hInstance ) ) { - OSL_ENSURE( false, "unregister window class failed" ); + OSL_FAIL( "unregister window class failed" ); } s_ClassAtom = 0; diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index e7da46d9f85b..e4844db29528 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -1708,7 +1708,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame (!aNew.FactoryURL.getLength()) ) { - OSL_ENSURE( false, "AutoRecovery::implts_registerDocument: this should not happen anymore!" ); + OSL_FAIL( "AutoRecovery::implts_registerDocument: this should not happen anymore!" ); // nowadays, the Basic IDE should already die on the "supports XDocumentRecovery" check. And no other known // document type fits in here ... return; diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index f29a940f2153..a96f211cd99e 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -304,7 +304,7 @@ OUString LinguOptions::GetName( INT32 nWID ) if (0 <= nWID && nWID < nLen && aWID_Name[ nWID ].nWID == nWID) aRes = OUString::createFromAscii(aWID_Name[nWID].pPropertyName); else - OSL_ENSURE(false, "lng : unknown WID"); + OSL_FAIL("lng : unknown WID"); return aRes; } diff --git a/scripting/source/inc/util/MiscUtils.hxx b/scripting/source/inc/util/MiscUtils.hxx index 149f46e8d53c..50d693302589 100644 --- a/scripting/source/inc/util/MiscUtils.hxx +++ b/scripting/source/inc/util/MiscUtils.hxx @@ -115,11 +115,11 @@ public: } catch ( css::lang::IllegalArgumentException const & ) { - OSL_ENSURE( false, "Invalid document model!" ); + OSL_FAIL( "Invalid document model!" ); } } - OSL_ENSURE( false, "Unable to obtain URL for document model!" ); + OSL_FAIL( "Unable to obtain URL for document model!" ); return rtl::OUString(); } static css::uno::Reference< css::frame::XModel > tDocUrlToModel( const ::rtl::OUString& url ) diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx index 434e7d962eb4..135410b37c9a 100644 --- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx +++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx @@ -418,7 +418,7 @@ public: } catch( uno::Exception& ) { - OSL_ENSURE( false, "DefaultBrowseNode::DefaultBrowseNode: Caught exception!" ); + OSL_FAIL( "DefaultBrowseNode::DefaultBrowseNode: Caught exception!" ); } OSL_ENSURE( m_xAggProxy.is(), "DefaultBrowseNode::DefaultBrowseNode: Wrapped BrowseNode cannot be aggregated!" ); diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx index e5ab80f838cf..d114ea963dcf 100644 --- a/scripting/source/provider/URIHelper.cxx +++ b/scripting/source/provider/URIHelper.cxx @@ -78,8 +78,7 @@ ScriptingFrameworkURIHelper::ScriptingFrameworkURIHelper( } catch (uno::Exception&) { - OSL_ENSURE(false, - "Scripting Framework error initialising XSimpleFileAccess"); + OSL_FAIL("Scripting Framework error initialising XSimpleFileAccess"); } try @@ -92,8 +91,7 @@ ScriptingFrameworkURIHelper::ScriptingFrameworkURIHelper( } catch (uno::Exception&) { - OSL_ENSURE(false, - "Scripting Framework error initialising XUriReferenceFactory"); + OSL_FAIL("Scripting Framework error initialising XUriReferenceFactory"); } } diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index cf04f09e3ec5..1d83e6292867 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -1558,7 +1558,7 @@ Reference< io::XInputStream > BinaryInput::getInputStreamForSection( sal_Int32 n } } else - OSL_ENSURE( false, "BinaryInput::getInputStreamForSection(): Read past end" ); + OSL_FAIL( "BinaryInput::getInputStreamForSection(): Read past end" ); return xIn; } @@ -1568,7 +1568,7 @@ void BinaryInput::seek( sal_Int32 nPos ) if( nPos <= m_nSize ) m_nCurPos = nPos; else - OSL_ENSURE( false, "BinaryInput::seek(): Position past end" ); + OSL_FAIL( "BinaryInput::seek(): Position past end" ); } @@ -1581,7 +1581,7 @@ sal_Int16 BinaryInput::readInt16( void ) nRet += 256 * sal_Int16( sal_uInt8( m_pData[m_nCurPos++] ) ); } else - OSL_ENSURE( false, "BinaryInput::readInt16(): Read past end" ); + OSL_FAIL( "BinaryInput::readInt16(): Read past end" ); return nRet; } @@ -1599,7 +1599,7 @@ sal_Int32 BinaryInput::readInt32( void ) } } else - OSL_ENSURE( false, "BinaryInput::readInt32(): Read past end" ); + OSL_FAIL( "BinaryInput::readInt32(): Read past end" ); return nRet; } @@ -1613,7 +1613,7 @@ sal_Unicode BinaryInput::readUnicodeChar( void ) nRet += 256 * sal_uInt8( m_pData[m_nCurPos++] ); } else - OSL_ENSURE( false, "BinaryInput::readUnicodeChar(): Read past end" ); + OSL_FAIL( "BinaryInput::readUnicodeChar(): Read past end" ); sal_Unicode cRet = nRet; return cRet; diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 7438353c2822..9ecd8764fdad 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -1392,13 +1392,13 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFrame)); if ( pItem->ISA( SfxUsrAnyItem ) ) { - OSL_ENSURE( false, "TransformItems: transporting an XFrame via an SfxUsrAnyItem is not deprecated!" ); + OSL_FAIL( "TransformItems: transporting an XFrame via an SfxUsrAnyItem is not deprecated!" ); pValue[nActProp++].Value = static_cast< const SfxUsrAnyItem* >( pItem )->GetValue(); } else if ( pItem->ISA( SfxUnoFrameItem ) ) pValue[nActProp++].Value <<= static_cast< const SfxUnoFrameItem* >( pItem )->GetFrame(); else - OSL_ENSURE( false, "TransformItems: invalid item type for SID_FILLFRAME!" ); + OSL_FAIL( "TransformItems: invalid item type for SID_FILLFRAME!" ); } if ( rSet.GetItemState( SID_TEMPLATE, sal_False, &pItem ) == SFX_ITEM_SET ) { diff --git a/sfx2/source/appl/imestatuswindow.cxx b/sfx2/source/appl/imestatuswindow.cxx index b5126744aa50..092ace28428b 100644 --- a/sfx2/source/appl/imestatuswindow.cxx +++ b/sfx2/source/appl/imestatuswindow.cxx @@ -78,7 +78,7 @@ void ImeStatusWindow::init() } catch (css::uno::Exception &) { - OSL_ENSURE(false, "com.sun.star.uno.Exception"); + OSL_FAIL("com.sun.star.uno.Exception"); // Degrade gracefully and use the VCL-supplied default if no // configuration is available. } @@ -96,7 +96,7 @@ bool ImeStatusWindow::isShowing() } catch (css::uno::Exception &) { - OSL_ENSURE(false, "com.sun.star.uno.Exception"); + OSL_FAIL("com.sun.star.uno.Exception"); // Degrade gracefully and use the VCL-supplied default if no // configuration is available. } @@ -122,7 +122,7 @@ void ImeStatusWindow::show(bool bShow) } catch (css::uno::Exception &) { - OSL_ENSURE(false, "com.sun.star.uno.Exception"); + OSL_FAIL("com.sun.star.uno.Exception"); } } @@ -143,7 +143,7 @@ ImeStatusWindow::~ImeStatusWindow() } catch (css::uno::Exception &) { - OSL_ENSURE(false, "com.sun.star.uno.RuntimeException"); + OSL_FAIL("com.sun.star.uno.RuntimeException"); } } diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index d1de5e0aec68..50f168cfd3ea 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -1119,7 +1119,7 @@ namespace sfx2 // --------------------------------------------------------------------------------------------------------------------- void TaskPaneController_Impl::Dying() { - OSL_ENSURE( false, "TaskPaneController_Impl::Dying: unexpected call!" ); + OSL_FAIL( "TaskPaneController_Impl::Dying: unexpected call!" ); // We are expected to live longer than the ToolPanelDeck we work with. Since we remove ourself, in our dtor, // as listener from the panel deck, this method here should never be called. } diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 8ad9d8b537cb..3e54717ca6d2 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -1341,7 +1341,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, try { xBaseURI = createBaseURI(m_pImpl->m_xContext, xStorage, URL); } catch (uno::Exception &) { - OSL_ENSURE(false, "cannot create base URI"); + OSL_FAIL("cannot create base URI"); } } uno::Reference<task::XInteractionHandler> xIH; diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx index 302e181fe438..e00f5e67fec5 100644 --- a/sfx2/source/doc/Metadatable.cxx +++ b/sfx2/source/doc/Metadatable.cxx @@ -285,7 +285,7 @@ public: virtual bool IsInContent() const { return m_isInContent; } virtual ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable > MakeUnoObject() - { OSL_ENSURE(false, "MetadatableUndo::MakeUnoObject"); throw; } + { OSL_FAIL("MetadatableUndo::MakeUnoObject"); throw; } }; // MetadatableClipboard ---------------------------------------------- @@ -310,7 +310,7 @@ public: virtual bool IsInContent() const { return m_isInContent; } virtual ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable > MakeUnoObject() - { OSL_ENSURE(false, "MetadatableClipboard::MakeUnoObject"); throw; } + { OSL_FAIL("MetadatableClipboard::MakeUnoObject"); throw; } void OriginNoLongerInBusinessAnymore() { m_pReg = 0; } }; @@ -777,7 +777,7 @@ void XmlIdRegistryDocument::UnregisterMetadatable(const Metadatable& i_rObject) ::rtl::OUString idref; if (!m_pImpl->LookupXmlId(i_rObject, path, idref)) { - OSL_ENSURE(false, "unregister: no xml id?"); + OSL_FAIL("unregister: no xml id?"); return; } const XmlIdMap_t::iterator iter( m_pImpl->m_XmlIdMap.find(idref) ); @@ -820,7 +820,7 @@ void XmlIdRegistryDocument::RegisterCopy(Metadatable const& i_rSource, ::rtl::OUString idref; if (!m_pImpl->LookupXmlId( i_rSource, path, idref )) { - OSL_ENSURE(false, "no xml id?"); + OSL_FAIL("no xml id?"); return; } XmlIdList_t * pList ( m_pImpl->LookupElementList(path, idref) ); @@ -887,7 +887,7 @@ XmlIdRegistryDocument::JoinMetadatables( } else { - OSL_ENSURE(false, "JoinMetadatables: no xmlid?"); + OSL_FAIL("JoinMetadatables: no xmlid?"); return; } if (!mergedOwnsRef) @@ -1202,7 +1202,7 @@ void XmlIdRegistryClipboard::UnregisterMetadatable(const Metadatable& i_rObject) const MetadatableClipboard * pLink; if (!m_pImpl->LookupXmlId(i_rObject, path, idref, pLink)) { - OSL_ENSURE(false, "unregister: no xml id?"); + OSL_FAIL("unregister: no xml id?"); return; } const ClipboardXmlIdMap_t::iterator iter( m_pImpl->m_XmlIdMap.find(idref) ); @@ -1309,7 +1309,7 @@ void Metadatable::RemoveMetadataReference() } catch (uno::Exception &) { - OSL_ENSURE(false, "Metadatable::RemoveMetadataReference: exception"); + OSL_FAIL("Metadatable::RemoveMetadataReference: exception"); } } @@ -1465,13 +1465,13 @@ Metadatable::RegisterAsCopyOf(Metadatable const & i_rSource, } else { - OSL_ENSURE(false, "neither RegDoc nor RegClp cannot happen"); + OSL_FAIL("neither RegDoc nor RegClp cannot happen"); } } } catch (uno::Exception &) { - OSL_ENSURE(false, "Metadatable::RegisterAsCopyOf: exception"); + OSL_FAIL("Metadatable::RegisterAsCopyOf: exception"); } } @@ -1494,7 +1494,7 @@ Metadatable::RegisterAsCopyOf(Metadatable const & i_rSource, } catch (uno::Exception &) { - OSL_ENSURE(false, "Metadatable::CreateUndo: exception"); + OSL_FAIL("Metadatable::CreateUndo: exception"); } return ::boost::shared_ptr<MetadatableUndo>(); } @@ -1564,7 +1564,7 @@ Metadatable::JoinMetadatable(Metadatable const & i_rOther, } catch (uno::Exception &) { - OSL_ENSURE(false, "Metadatable::JoinMetadatable: exception"); + OSL_FAIL("Metadatable::JoinMetadatable: exception"); } } diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 2ff73c35cb36..e02e560f47e9 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -168,7 +168,7 @@ void SfxObjectFactory::RegisterViewFactory ByteString sMessage( "SfxObjectFactory::RegisterViewFactory: duplicate view name '" ); sMessage += ByteString( sViewName, RTL_TEXTENCODING_ASCII_US ); sMessage += "'!"; - OSL_ENSURE( false, sMessage.GetBuffer() ); + OSL_FAIL( sMessage.GetBuffer() ); break; } } diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 6ab877dfc6a9..8815bad96cbf 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -455,7 +455,7 @@ void SfxDocTplService_Impl::init_Impl() mxInfo = uno::Reference< XStandaloneDocumentInfo > ( mxFactory->createInstance( aService ), UNO_QUERY ); } catch (uno::RuntimeException &) { - OSL_ENSURE(false, "SfxDocTplService_Impl::init_Impl: " + OSL_FAIL("SfxDocTplService_Impl::init_Impl: " "cannot create DocumentProperties service"); } @@ -1037,7 +1037,7 @@ sal_Bool SfxDocTplService_Impl::setProperty( Content& rContent, } else { - OSL_ENSURE( false, "Unsupported property value type" ); + OSL_FAIL( "Unsupported property value type" ); } } } @@ -1098,7 +1098,7 @@ sal_Bool SfxDocTplService_Impl::getProperty( Content& rContent, } else { - OSL_ENSURE( false, "Unsupported property value type" ); + OSL_FAIL( "Unsupported property value type" ); } } } diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 3061682a39c5..d09bad7feea3 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -774,7 +774,7 @@ Reference< XLibraryContainer > SfxObjectShell::GetDialogContainer() if ( pBasMgr ) return pBasMgr->GetDialogLibraryContainer().get(); - OSL_ENSURE( false, "SfxObjectShell::GetDialogContainer: falling back to the application - is this really expected here?" ); + OSL_FAIL( "SfxObjectShell::GetDialogContainer: falling back to the application - is this really expected here?" ); return SFX_APP()->GetDialogContainer(); } @@ -789,7 +789,7 @@ Reference< XLibraryContainer > SfxObjectShell::GetBasicContainer() if ( pBasMgr ) return pBasMgr->GetScriptLibraryContainer().get(); - OSL_ENSURE( false, "SfxObjectShell::GetBasicContainer: falling back to the application - is this really expected here?" ); + OSL_FAIL( "SfxObjectShell::GetBasicContainer: falling back to the application - is this really expected here?" ); return SFX_APP()->GetBasicContainer(); } diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 7d36263c5c45..b88e14004731 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -2583,7 +2583,7 @@ sal_Bool SfxBaseModel::IsInitialized() const { if ( !m_pData || !m_pData->m_pObjectShell ) { - OSL_ENSURE( false, "SfxBaseModel::IsInitialized: this should have been caught earlier!" ); + OSL_FAIL( "SfxBaseModel::IsInitialized: this should have been caught earlier!" ); return sal_False; } @@ -3874,7 +3874,7 @@ SfxViewFrame* SfxBaseModel::FindOrCreateViewFrame_Impl( const Reference< XFrame // destroyed later, and the new one, which we're going to create continue; - OSL_ENSURE( false, "SfxBaseModel::FindOrCreateViewFrame_Impl: there already is an SfxFrame for the given XFrame, but no view in it!" ); + OSL_FAIL( "SfxBaseModel::FindOrCreateViewFrame_Impl: there already is an SfxFrame for the given XFrame, but no view in it!" ); // nowadays, we're the only instance allowed to create an SfxFrame for an XFrame, so this case here should not happen break; } diff --git a/sfx2/source/view/userinputinterception.cxx b/sfx2/source/view/userinputinterception.cxx index a61e32197cd5..fdd9f97fb4e0 100644 --- a/sfx2/source/view/userinputinterception.cxx +++ b/sfx2/source/view/userinputinterception.cxx @@ -267,7 +267,7 @@ namespace sfx2 break; default: - OSL_ENSURE( false, "UserInputInterception::handleNotifyEvent: illegal event type!" ); + OSL_FAIL( "UserInputInterception::handleNotifyEvent: illegal event type!" ); break; } diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 86d634cfd531..d32c31ff15ac 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -460,7 +460,7 @@ void SfxViewFrame::INetExecute_Impl( SfxRequest &rRequest ) { case SID_BROWSE_FORWARD: case SID_BROWSE_BACKWARD: - OSL_ENSURE( false, "SfxViewFrame::INetExecute_Impl: SID_BROWSE_FORWARD/BACKWARD are dead!" ); + OSL_FAIL( "SfxViewFrame::INetExecute_Impl: SID_BROWSE_FORWARD/BACKWARD are dead!" ); break; case SID_CREATELINK: { diff --git a/sfx2/workben/custompanel/ctp_factory.cxx b/sfx2/workben/custompanel/ctp_factory.cxx index 40525347ac58..c49e5279ebbd 100644 --- a/sfx2/workben/custompanel/ctp_factory.cxx +++ b/sfx2/workben/custompanel/ctp_factory.cxx @@ -103,7 +103,7 @@ namespace sd { namespace colortoolpanel } if ( !xParentWindow.is() ) { - OSL_ENSURE( false, "ToolPanelFactory::createUIElement: no parent window in the args!" ); + OSL_FAIL( "ToolPanelFactory::createUIElement: no parent window in the args!" ); throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No parent window provided in the creation arguments. Cannot create tool panel." ) ), *this, diff --git a/shell/source/unix/sysshell/recently_used_file_handler.cxx b/shell/source/unix/sysshell/recently_used_file_handler.cxx index 1ef8c621dd3b..b34bb3ad81a3 100644 --- a/shell/source/unix/sysshell/recently_used_file_handler.cxx +++ b/shell/source/unix/sysshell/recently_used_file_handler.cxx @@ -513,15 +513,15 @@ extern "C" void add_to_recently_used_file_list(const rtl::OUString& file_url, co } catch(const char* ex) { - OSL_ENSURE(false, ex); + OSL_FAIL(ex); } catch(const xml_parser_exception&) { - OSL_ENSURE(false, "XML parser error"); + OSL_FAIL("XML parser error"); } catch(const unknown_xml_format_exception&) { - OSL_ENSURE(false, "XML format unknown"); + OSL_FAIL("XML format unknown"); } } diff --git a/shell/source/win32/simplemail/senddoc.cxx b/shell/source/win32/simplemail/senddoc.cxx index 78f69d3200c2..c03ae66635b9 100644 --- a/shell/source/win32/simplemail/senddoc.cxx +++ b/shell/source/win32/simplemail/senddoc.cxx @@ -221,7 +221,7 @@ void initParameter(int argc, char* argv[]) { if (!isKnownParameter(argv[i])) { - OSL_ENSURE(false, "Wrong parameter received"); + OSL_FAIL("Wrong parameter received"); continue; } @@ -324,7 +324,7 @@ int main(int argc, char* argv[]) #endif ) { - OSL_ENSURE(false, ex.what()); + OSL_FAIL(ex.what()); } return ulRet; } diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index 29a5c7e79b23..c34702052013 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -898,13 +898,13 @@ sal_Bool SAL_CALL SvxRectCtlChildAccessibleContext::isFocusTraversable() throw( void SAL_CALL SvxRectCtlChildAccessibleContext::addFocusListener( const Reference< awt::XFocusListener >& /*xListener*/ ) throw( RuntimeException ) { - OSL_ENSURE( false, "SvxRectCtlChildAccessibleContext::addFocusListener: not implemented" ); + OSL_FAIL( "SvxRectCtlChildAccessibleContext::addFocusListener: not implemented" ); } void SAL_CALL SvxRectCtlChildAccessibleContext::removeFocusListener( const Reference< awt::XFocusListener >& /*xListener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SvxRectCtlChildAccessibleContext::removeFocusListener: not implemented" ); + OSL_FAIL( "SvxRectCtlChildAccessibleContext::removeFocusListener: not implemented" ); } void SAL_CALL SvxRectCtlChildAccessibleContext::grabFocus() throw( RuntimeException ) diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 26b4f1e7d447..3031cea7185a 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -906,7 +906,7 @@ void DbCellControl::Init( Window& rParent, const Reference< XRowSet >& _rxCursor case MouseWheelBehavior::SCROLL_FOCUS_ONLY: nVclSetting = MOUSE_WHEEL_FOCUS_ONLY; break; case MouseWheelBehavior::SCROLL_ALWAYS: nVclSetting = MOUSE_WHEEL_ALWAYS; break; default: - OSL_ENSURE( false, "DbCellControl::Init: invalid MouseWheelBehavior!" ); + OSL_FAIL( "DbCellControl::Init: invalid MouseWheelBehavior!" ); break; } @@ -3361,7 +3361,7 @@ void FmXGridCell::setLock(sal_Bool _bLock) throw( RuntimeException ) //------------------------------------------------------------------ void SAL_CALL FmXGridCell::setPosSize( ::sal_Int32 _XX, ::sal_Int32 _Y, ::sal_Int32 _Width, ::sal_Int32 _Height, ::sal_Int16 _Flags ) throw (RuntimeException) { - OSL_ENSURE( false, "FmXGridCell::setPosSize: not implemented" ); + OSL_FAIL( "FmXGridCell::setPosSize: not implemented" ); (void)_XX; (void)_Y; (void)_Width; @@ -3373,14 +3373,14 @@ void SAL_CALL FmXGridCell::setPosSize( ::sal_Int32 _XX, ::sal_Int32 _Y, ::sal_In //------------------------------------------------------------------ awt::Rectangle SAL_CALL FmXGridCell::getPosSize( ) throw (RuntimeException) { - OSL_ENSURE( false, "FmXGridCell::getPosSize: not implemented" ); + OSL_FAIL( "FmXGridCell::getPosSize: not implemented" ); return awt::Rectangle(); } //------------------------------------------------------------------ void SAL_CALL FmXGridCell::setVisible( ::sal_Bool _Visible ) throw (RuntimeException) { - OSL_ENSURE( false, "FmXGridCell::setVisible: not implemented" ); + OSL_FAIL( "FmXGridCell::setVisible: not implemented" ); (void)_Visible; // not allowed to tamper with this for a grid cell } @@ -3388,7 +3388,7 @@ void SAL_CALL FmXGridCell::setVisible( ::sal_Bool _Visible ) throw (RuntimeExcep //------------------------------------------------------------------ void SAL_CALL FmXGridCell::setEnable( ::sal_Bool _Enable ) throw (RuntimeException) { - OSL_ENSURE( false, "FmXGridCell::setEnable: not implemented" ); + OSL_FAIL( "FmXGridCell::setEnable: not implemented" ); (void)_Enable; // not allowed to tamper with this for a grid cell } @@ -3396,7 +3396,7 @@ void SAL_CALL FmXGridCell::setEnable( ::sal_Bool _Enable ) throw (RuntimeExcepti //------------------------------------------------------------------ void SAL_CALL FmXGridCell::setFocus( ) throw (RuntimeException) { - OSL_ENSURE( false, "FmXGridCell::setFocus: not implemented" ); + OSL_FAIL( "FmXGridCell::setFocus: not implemented" ); // not allowed to tamper with this for a grid cell } @@ -3463,14 +3463,14 @@ void SAL_CALL FmXGridCell::removeMouseMotionListener( const Reference< awt::XMou //------------------------------------------------------------------ void SAL_CALL FmXGridCell::addPaintListener( const Reference< awt::XPaintListener >& _rxListener ) throw (RuntimeException) { - OSL_ENSURE( false, "FmXGridCell::addPaintListener: not implemented" ); + OSL_FAIL( "FmXGridCell::addPaintListener: not implemented" ); (void)_rxListener; } //------------------------------------------------------------------ void SAL_CALL FmXGridCell::removePaintListener( const Reference< awt::XPaintListener >& _rxListener ) throw (RuntimeException) { - OSL_ENSURE( false, "FmXGridCell::removePaintListener: not implemented" ); + OSL_FAIL( "FmXGridCell::removePaintListener: not implemented" ); (void)_rxListener; } diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index b87c77d6a145..67727eb1fdf6 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -755,12 +755,12 @@ namespace svxform case MID_INSERT_CONTROL: { - OSL_ENSURE( false, "XFormsPage::DoToolboxAction: MID_INSERT_CONTROL not implemented, yet!" ); + OSL_FAIL( "XFormsPage::DoToolboxAction: MID_INSERT_CONTROL not implemented, yet!" ); } break; default: - OSL_ENSURE( false, "XFormsPage::DoToolboxAction: unknown ID!" ); + OSL_FAIL( "XFormsPage::DoToolboxAction: unknown ID!" ); break; } diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 9768ba66cecf..2346de225e31 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -538,7 +538,7 @@ void SAL_CALL FmFilterAdapter::disjunctiveTermAdded( const FilterEvent& _Event ) bool bValidIndex = ( nInsertPos >= 0 ) && ( (size_t)nInsertPos <= pFormItem->GetChildren().size() ); if ( !bValidIndex ) { - OSL_ENSURE( false, "FmFilterAdapter::disjunctiveTermAdded: invalid index!" ); + OSL_FAIL( "FmFilterAdapter::disjunctiveTermAdded: invalid index!" ); return; } diff --git a/svx/source/form/fmcontrollayout.cxx b/svx/source/form/fmcontrollayout.cxx index 5c590448b789..c49db3344f8a 100644 --- a/svx/source/form/fmcontrollayout.cxx +++ b/svx/source/form/fmcontrollayout.cxx @@ -163,7 +163,7 @@ namespace svxform pCharLocalePropertyName = "CharLocaleComplex"; break; default: - OSL_ENSURE( false, "lcl_initializeControlFont: unexpected script type for system locale!" ); + OSL_FAIL( "lcl_initializeControlFont: unexpected script type for system locale!" ); break; } diff --git a/svx/source/form/fmdocumentclassification.cxx b/svx/source/form/fmdocumentclassification.cxx index 34083dae5108..f22d204f0cea 100644 --- a/svx/source/form/fmdocumentclassification.cxx +++ b/svx/source/form/fmdocumentclassification.cxx @@ -151,7 +151,7 @@ namespace svxform } // last: uhm, there is no last resort - OSL_ENSURE( false, "DocumentClassification::classifyDocument: unknown document!" ); + OSL_FAIL( "DocumentClassification::classifyDocument: unknown document!" ); } catch( const Exception& ) { diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index 0fef03f19257..ec6b2efb37b4 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -211,7 +211,7 @@ FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl if ( bForeignIsForm != bOwnIsForm ) { - OSL_ENSURE( false, "FmFormPageImpl::FmFormPageImpl: inconsistent ordering of objects!" ); + OSL_FAIL( "FmFormPageImpl::FmFormPageImpl: inconsistent ordering of objects!" ); // don't attempt to do further assignments, something's completely messed up break; } diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index dda3c2384958..2f4db9bcfd97 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -742,7 +742,7 @@ bool FmXFormShell::impl_checkDisposed() const RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::impl_checkDisposed" ); if ( !m_pShell ) { - OSL_ENSURE( false, "FmXFormShell::impl_checkDisposed: already disposed!" ); + OSL_FAIL( "FmXFormShell::impl_checkDisposed: already disposed!" ); return true; } return false; diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 4556679dbebd..1011966b1f46 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -1669,7 +1669,7 @@ bool FmXFormView::createControlLabelPair( const ::comphelper::ComponentContext& if ( xControlPropInfo->hasPropertyByName( FM_PROP_LABEL ) ) xControlSet->setPropertyValue( FM_PROP_LABEL, makeAny( sFieldName + _rFieldPostfix ) ); else - OSL_ENSURE( false, "FmXFormView::createControlLabelPair: can't set a label for the control!" ); + OSL_FAIL( "FmXFormView::createControlLabelPair: can't set a label for the control!" ); } } diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index ef78b4991018..9fdcb524fa65 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -1507,7 +1507,7 @@ void SAL_CALL FormController::textChanged(const TextEvent& e) throw( RuntimeExce // Suchen der aktuellen Row if ( ( (size_t)m_nCurrentFilterPosition >= m_aFilterRows.size() ) || ( m_nCurrentFilterPosition < 0 ) ) { - OSL_ENSURE( false, "FormController::textChanged: m_nCurrentFilterPosition is wrong!" ); + OSL_FAIL( "FormController::textChanged: m_nCurrentFilterPosition is wrong!" ); return; } diff --git a/svx/source/form/formcontrolling.cxx b/svx/source/form/formcontrolling.cxx index b76213fe84b7..197de8ccbee2 100644 --- a/svx/source/form/formcontrolling.cxx +++ b/svx/source/form/formcontrolling.cxx @@ -469,7 +469,7 @@ namespace svx else if ( aError.hasValue() ) displayException( aError ); else - OSL_ENSURE( false, "FormControllerHelper::impl_operateForm_nothrow: no success, but no error?" ); + OSL_FAIL( "FormControllerHelper::impl_operateForm_nothrow: no success, but no error?" ); return false; } diff --git a/svx/source/sdr/contact/viewcontactofe3dscene.cxx b/svx/source/sdr/contact/viewcontactofe3dscene.cxx index 4040abc5adca..13256264aeca 100644 --- a/svx/source/sdr/contact/viewcontactofe3dscene.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dscene.cxx @@ -386,7 +386,7 @@ namespace sdr { // empty scene, no 3d action should be necessary. Prepare some // fallback size - OSL_ENSURE(false, "No need to get ViewInformation3D from an empty scene (!)"); + OSL_FAIL("No need to get ViewInformation3D from an empty scene (!)"); aContentRange.expand(basegfx::B3DPoint(-100.0, -100.0, -100.0)); aContentRange.expand(basegfx::B3DPoint( 100.0, 100.0, 100.0)); } diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx index fb08e2322073..46a8d4611021 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx @@ -69,7 +69,7 @@ namespace sdr if(!nPointCount) { - OSL_ENSURE(false, "PolyPolygon object without geometry detected, this should not be created (!)"); + OSL_FAIL("PolyPolygon object without geometry detected, this should not be created (!)"); basegfx::B2DPolygon aFallbackLine; aFallbackLine.append(basegfx::B2DPoint(0.0, 0.0)); aFallbackLine.append(basegfx::B2DPoint(1000.0, 1000.0)); diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index fdf372690ed8..f221b52c142f 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -197,7 +197,7 @@ namespace sdr { namespace contact { m_xControlView.set( m_xControl, UNO_QUERY ); if ( !m_xControlWindow.is() || !m_xControlView.is() ) { - OSL_ENSURE( false, "ControlHolder::operator=: invalid XControl, missing required interfaces!" ); + OSL_FAIL( "ControlHolder::operator=: invalid XControl, missing required interfaces!" ); clear(); } } @@ -1055,7 +1055,7 @@ namespace sdr { namespace contact { UnoControlContactHelper::adjustControlGeometry_throw( m_aControl, pUnoObject->GetLogicRect(), _rViewTransformation, m_aZoomLevelNormalization ); } else - OSL_ENSURE( false, "ViewObjectContactOfUnoControl_Impl::positionAndZoomControl: no SdrUnoObj!" ); + OSL_FAIL( "ViewObjectContactOfUnoControl_Impl::positionAndZoomControl: no SdrUnoObj!" ); } catch( const Exception& ) { @@ -1135,7 +1135,7 @@ namespace sdr { namespace contact { { if ( m_bCreatingControl ) { - OSL_ENSURE( false, "ViewObjectContactOfUnoControl_Impl::impl_ensureControl_nothrow: reentrance is not really good here!" ); + OSL_FAIL( "ViewObjectContactOfUnoControl_Impl::impl_ensureControl_nothrow: reentrance is not really good here!" ); // We once had a situation where this was called reentrantly, which lead to all kind of strange effects. All // those affected the grid control, which is the only control so far which is visible in design mode (and // not only in alive mode). diff --git a/svx/source/sdr/overlay/overlayobject.cxx b/svx/source/sdr/overlay/overlayobject.cxx index 780c85c480e5..076c2d83f875 100644 --- a/svx/source/sdr/overlay/overlayobject.cxx +++ b/svx/source/sdr/overlay/overlayobject.cxx @@ -73,7 +73,7 @@ namespace sdr // Default implementation has to assert a missing implementation. It cannot // be useful to have overlay object derivations which have no visualisation // at all - OSL_ENSURE(false, "OverlayObject derivation without visualisation definition (missing createOverlayObjectPrimitive2DSequence implementation) (!)"); + OSL_FAIL("OverlayObject derivation without visualisation definition (missing createOverlayObjectPrimitive2DSequence implementation) (!)"); return drawinglayer::primitive2d::Primitive2DSequence(); } diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index c4fc5c95b5bc..86e34cfc897f 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -2039,7 +2039,7 @@ SdrHdl* SdrPathObj::GetHdl(sal_uInt32 nHdlNum) const { // #i73248# // Warn the user that this is ineffective and show alternatives. Should not be used at all. - OSL_ENSURE(false, "SdrPathObj::GetHdl(): ineffective, use AddToHdlList instead (!)"); + OSL_FAIL("SdrPathObj::GetHdl(): ineffective, use AddToHdlList instead (!)"); // to have an alternative, get single handle using the ineffective way SdrHdl* pRetval = 0; diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index deeadb458b0f..d527cc8b584f 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -436,7 +436,7 @@ void SdrPageView::DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget, sdr::con } else { - OSL_ENSURE(false, "SdrPageView::DrawLayer: Creating temporary SdrPageWindow (ObjectContact), this should never be needed (!)"); + OSL_FAIL("SdrPageView::DrawLayer: Creating temporary SdrPageWindow (ObjectContact), this should never be needed (!)"); // None of the known OutputDevices is the target of this paint, use // a temporary SdrPageWindow for this Redraw. diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 4e6f6572d23d..ff78d8dd32d4 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -2452,7 +2452,7 @@ SdrHdl* SdrTableObj::GetHdl(sal_uInt32 nHdlNum) const { // #i73248# // Warn the user that this is ineffective and show alternatives. Should not be used at all. - OSL_ENSURE(false, "SdrTableObj::GetHdl(): ineffective, use AddToHdlList instead (!)"); + OSL_FAIL("SdrTableObj::GetHdl(): ineffective, use AddToHdlList instead (!)"); // to have an alternative, get single handle using the ineffective way SdrHdl* pRetval = 0; diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx index 63129cdd5426..f96e4c918ae8 100644 --- a/svx/source/table/tablehandles.cxx +++ b/svx/source/table/tablehandles.cxx @@ -89,7 +89,7 @@ void TableEdgeHdl::SetEdge( sal_Int32 nEdge, sal_Int32 nStart, sal_Int32 nEnd, T } else { - OSL_ENSURE( false, "sdr::table::TableEdgeHdl::SetEdge(), invalid edge!" ); + OSL_FAIL( "sdr::table::TableEdgeHdl::SetEdge(), invalid edge!" ); } } diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index 3d40963107db..9a1a9d365250 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -210,7 +210,7 @@ bool TableLayouter::isEdgeVisible( sal_Int32 nEdgeX, sal_Int32 nEdgeY, bool bHor } else { - OSL_ENSURE( false, "sdr::table::TableLayouter::getBorderLine(), invalid edge!" ); + OSL_FAIL( "sdr::table::TableLayouter::getBorderLine(), invalid edge!" ); } return false; @@ -234,7 +234,7 @@ SvxBorderLine* TableLayouter::getBorderLine( sal_Int32 nEdgeX, sal_Int32 nEdgeY, } else { - OSL_ENSURE( false, "sdr::table::TableLayouter::getBorderLine(), invalid edge!" ); + OSL_FAIL( "sdr::table::TableLayouter::getBorderLine(), invalid edge!" ); } return pLine; diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index a7a9e89a3bf6..e3fc88b10ef7 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -1487,14 +1487,14 @@ void SAL_CALL SvxShape::removePropertyChangeListener( const OUString& _propertyN void SAL_CALL SvxShape::addVetoableChangeListener( const OUString& , const Reference< beans::XVetoableChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - OSL_ENSURE( false, "SvxShape::addVetoableChangeListener: don't have any vetoable properties, so why ...?" ); + OSL_FAIL( "SvxShape::addVetoableChangeListener: don't have any vetoable properties, so why ...?" ); } //---------------------------------------------------------------------- void SAL_CALL SvxShape::removeVetoableChangeListener( const OUString& , const Reference< beans::XVetoableChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - OSL_ENSURE( false, "SvxShape::removeVetoableChangeListener: don't have any vetoable properties, so why ...?" ); + OSL_FAIL( "SvxShape::removeVetoableChangeListener: don't have any vetoable properties, so why ...?" ); } //---------------------------------------------------------------------- @@ -3825,7 +3825,7 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames() } return *pSeq; } - OSL_ENSURE( false, "SvxShape::_getSupportedServiceNames: could not determine object type!" ); + OSL_FAIL( "SvxShape::_getSupportedServiceNames: could not determine object type!" ); uno::Sequence< OUString > aSeq; return aSeq; } diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index 2cd0f6d1d238..4124c8c6ec71 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -200,8 +200,7 @@ bool createContentProviderData( if ( !( rxHierNameAccess->getByHierarchicalName( aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) { - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - " + OSL_FAIL( "UniversalContentBroker::getContentProviderData - " "Error getting item value!" ); } } @@ -219,8 +218,7 @@ bool createContentProviderData( if ( !( rxHierNameAccess->getByHierarchicalName( aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) { - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - " + OSL_FAIL( "UniversalContentBroker::getContentProviderData - " "Error getting item value!" ); } @@ -233,8 +231,7 @@ bool createContentProviderData( if ( !( rxHierNameAccess->getByHierarchicalName( aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) { - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - " + OSL_FAIL( "UniversalContentBroker::getContentProviderData - " "Error getting item value!" ); } @@ -786,14 +783,14 @@ bool UniversalContentBroker::configureUcb() if (m_aArguments.getLength() < 2 || !(m_aArguments[0] >>= aKey1) || !(m_aArguments[1] >>= aKey2)) { - OSL_ENSURE(false, "UniversalContentBroker::configureUcb(): Bad arguments"); + OSL_FAIL("UniversalContentBroker::configureUcb(): Bad arguments"); return false; } ContentProviderDataList aData; if (!getContentProviderData(aKey1, aKey2, aData)) { - OSL_ENSURE(false, "UniversalContentBroker::configureUcb(): No configuration"); + OSL_FAIL("UniversalContentBroker::configureUcb(): No configuration"); return false; } @@ -823,8 +820,7 @@ void UniversalContentBroker::prepareAndRegister( } else - OSL_ENSURE(false, - "UniversalContentBroker::prepareAndRegister(): Bad argument placeholders"); + OSL_FAIL("UniversalContentBroker::prepareAndRegister(): Bad argument placeholders"); } } @@ -836,8 +832,7 @@ bool UniversalContentBroker::getContentProviderData( { if ( !m_xSMgr.is() || !rKey1.getLength() || !rKey2.getLength() ) { - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - Invalid argument!" ); + OSL_FAIL( "UniversalContentBroker::getContentProviderData - Invalid argument!" ); return false; } @@ -913,8 +908,7 @@ bool UniversalContentBroker::getContentProviderData( catch ( container::NoSuchElementException& ) { // getByHierarchicalName - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - " + OSL_FAIL( "UniversalContentBroker::getContentProviderData - " "caught NoSuchElementException!" ); } } @@ -922,16 +916,14 @@ bool UniversalContentBroker::getContentProviderData( } catch ( uno::RuntimeException& ) { - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - caught RuntimeException!" ); + OSL_FAIL( "UniversalContentBroker::getContentProviderData - caught RuntimeException!" ); return false; } catch ( uno::Exception& ) { // createInstance, createInstanceWithArguments - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - caught Exception!" ); + OSL_FAIL( "UniversalContentBroker::getContentProviderData - caught Exception!" ); return false; } diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx index 0fd4a8fa37b4..488fcbfcd731 100644 --- a/ucb/source/core/ucbcmds.cxx +++ b/ucb/source/core/ucbcmds.cxx @@ -1438,7 +1438,7 @@ void globalTransfer_( "BUG: UnsupportedNameClashException not allowed here!" ); if (exc.NameClash != ucb::NameClash::ERROR) { - OSL_ENSURE( false, "BUG: NameClash::ERROR expected!" ); + OSL_FAIL( "BUG: NameClash::ERROR expected!" ); } // No chance to solve name clashes, because I'm not able to detect diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx index b83aa4f7b455..1ed589387280 100644 --- a/ucb/source/ucp/ext/ucpext_content.cxx +++ b/ucb/source/ucp/ext/ucpext_content.cxx @@ -385,7 +385,7 @@ namespace ucb { namespace ucp { namespace ext } default: - OSL_ENSURE( false, "Content::getParentURL: unhandled case!" ); + OSL_FAIL( "Content::getParentURL: unhandled case!" ); break; } return ::rtl::OUString(); @@ -514,11 +514,11 @@ namespace ucb { namespace ucp { namespace ext } default: - OSL_ENSURE( false, "Content::getPropertyValues: unhandled case!" ); + OSL_FAIL( "Content::getPropertyValues: unhandled case!" ); break; } - OSL_ENSURE( false, "Content::getPropertyValues: unreachable!" ); + OSL_FAIL( "Content::getPropertyValues: unreachable!" ); return NULL; } diff --git a/ucb/source/ucp/ext/ucpext_datasupplier.cxx b/ucb/source/ucp/ext/ucpext_datasupplier.cxx index 60b1ff72a4b3..8c40411a8c71 100644 --- a/ucb/source/ucp/ext/ucpext_datasupplier.cxx +++ b/ucb/source/ucp/ext/ucpext_datasupplier.cxx @@ -194,7 +194,7 @@ namespace ucb { namespace ucp { namespace ext } break; default: - OSL_ENSURE( false, "DataSupplier::fetchData: unimplemented content type!" ); + OSL_FAIL( "DataSupplier::fetchData: unimplemented content type!" ); break; } } @@ -221,7 +221,7 @@ namespace ucb { namespace ucp { namespace ext return sId; } - OSL_ENSURE( false, "DataSupplier::queryContentIdentifierString: illegal index, or illegal result entry id!" ); + OSL_FAIL( "DataSupplier::queryContentIdentifierString: illegal index, or illegal result entry id!" ); return ::rtl::OUString(); } @@ -344,7 +344,7 @@ namespace ucb { namespace ucp { namespace ext } break; default: - OSL_ENSURE( false, "DataSupplier::queryPropertyValues: unhandled case!" ); + OSL_FAIL( "DataSupplier::queryPropertyValues: unhandled case!" ); break; } diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx index 444ba7055881..8242276ad604 100644 --- a/ucb/source/ucp/file/bc.cxx +++ b/ucb/source/ucp/file/bc.cxx @@ -546,14 +546,12 @@ BaseContent::getContentType() } else { - OSL_ENSURE( false, - "BaseContent::getContentType - Property value was null!" ); + OSL_FAIL( "BaseContent::getContentType - Property value was null!" ); } } catch ( sdbc::SQLException const & ) { - OSL_ENSURE( false, - "BaseContent::getContentType - Caught SQLException!" ); + OSL_FAIL( "BaseContent::getContentType - Caught SQLException!" ); } } } @@ -679,15 +677,13 @@ BaseContent::createNewContent( if ( xRow->wasNull() ) { IsDocument = false; -// OSL_ENSURE( false, -// "BaseContent::createNewContent - Property value was null!" ); +// OSL_FAIL( // "BaseContent::createNewContent - Property value was null!" ); // return Reference< XContent >(); } } catch ( sdbc::SQLException const & ) { - OSL_ENSURE( false, - "BaseContent::createNewContent - Caught SQLException!" ); + OSL_FAIL( "BaseContent::createNewContent - Caught SQLException!" ); return Reference< XContent >(); } @@ -1215,8 +1211,7 @@ void SAL_CALL BaseContent::insert( sal_Int32 nMyCommandIdentifier, } catch ( sdbc::SQLException const & ) { - OSL_ENSURE( false, - "BaseContent::insert - Caught SQLException!" ); + OSL_FAIL( "BaseContent::insert - Caught SQLException!" ); contentTypeSet = false; } diff --git a/ucb/source/ucp/file/filinpstr.cxx b/ucb/source/ucp/file/filinpstr.cxx index 555a83bb0272..1299b33284ae 100644 --- a/ucb/source/ucp/file/filinpstr.cxx +++ b/ucb/source/ucp/file/filinpstr.cxx @@ -74,11 +74,11 @@ XInputStream_impl::~XInputStream_impl() } catch (io::IOException const &) { - OSL_ENSURE(false, "unexpected situation"); + OSL_FAIL("unexpected situation"); } catch (uno::RuntimeException const &) { - OSL_ENSURE(false, "unexpected situation"); + OSL_FAIL("unexpected situation"); } } diff --git a/ucb/source/ucp/file/filstr.cxx b/ucb/source/ucp/file/filstr.cxx index 63b8fd46b140..6ecf53620377 100644 --- a/ucb/source/ucp/file/filstr.cxx +++ b/ucb/source/ucp/file/filstr.cxx @@ -136,11 +136,11 @@ XStream_impl::~XStream_impl() } catch (io::IOException const &) { - OSL_ENSURE(false, "unexpected situation"); + OSL_FAIL("unexpected situation"); } catch (uno::RuntimeException const &) { - OSL_ENSURE(false, "unexpected situation"); + OSL_FAIL("unexpected situation"); } } diff --git a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx index 318b884b7cf1..8f86aa48abab 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx @@ -402,8 +402,7 @@ HierarchyDataSource::createInstanceWithArguments( if ( !bReadOnly && !bReadWrite ) { - OSL_ENSURE( false, - "HierarchyDataSource::createInstanceWithArguments - " + OSL_FAIL( "HierarchyDataSource::createInstanceWithArguments - " "Unsupported service specifier!" ); return uno::Reference< uno::XInterface >(); } @@ -434,8 +433,7 @@ HierarchyDataSource::createInstanceWithArguments( rtl::OUString aConfigPath; if ( !createConfigPath( aPath, aConfigPath ) ) { - OSL_ENSURE( false, - "HierarchyDataSource::" + OSL_FAIL( "HierarchyDataSource::" "createInstanceWithArguments - " "Invalid node path!" ); return uno::Reference< uno::XInterface >(); @@ -451,8 +449,7 @@ HierarchyDataSource::createInstanceWithArguments( } else { - OSL_ENSURE( false, - "HierarchyDataSource::createInstanceWithArguments - " + OSL_FAIL( "HierarchyDataSource::createInstanceWithArguments - " "Invalid type for property 'nodepath'!" ); return uno::Reference< uno::XInterface >(); } @@ -470,8 +467,7 @@ HierarchyDataSource::createInstanceWithArguments( } else { - OSL_ENSURE( false, - "HierarchyDataSource::createInstanceWithArguments - " + OSL_FAIL( "HierarchyDataSource::createInstanceWithArguments - " "Invalid type for property 'lazywrite'!" ); return uno::Reference< uno::XInterface >(); } @@ -481,8 +477,7 @@ HierarchyDataSource::createInstanceWithArguments( if ( !bHasNodePath ) { - OSL_ENSURE( false, - "HierarchyDataSource::createInstanceWithArguments - " + OSL_FAIL( "HierarchyDataSource::createInstanceWithArguments - " "No 'nodepath' property!" ); return uno::Reference< uno::XInterface >(); } @@ -528,16 +523,14 @@ HierarchyDataSource::createInstanceWithArguments( } catch ( uno::Exception const & ) { - OSL_ENSURE( false, - "HierarchyDataSource::createInstanceWithArguments - " + OSL_FAIL( "HierarchyDataSource::createInstanceWithArguments - " "Cannot instanciate configuration access!" ); throw; } if ( !xConfigAccess.is() ) { - OSL_ENSURE( false, - "HierarchyDataSource::createInstanceWithArguments - " + OSL_FAIL( "HierarchyDataSource::createInstanceWithArguments - " "Cannot instanciate configuration access!" ); return xConfigAccess; } @@ -572,8 +565,7 @@ HierarchyDataSource::getConfigProvider() } catch ( uno::Exception const & ) { - OSL_ENSURE( false, - "HierarchyDataSource::getConfigProvider - " + OSL_FAIL( "HierarchyDataSource::getConfigProvider - " "caught exception!" ); } } @@ -590,16 +582,14 @@ bool HierarchyDataSource::createConfigPath( { if ( rInPath.indexOf( '/' ) == 0 ) { - OSL_ENSURE( false, - "HierarchyDataSource::createConfigPath - " + OSL_FAIL( "HierarchyDataSource::createConfigPath - " "Leading slash in node path!" ); return false; } if ( rInPath.lastIndexOf( '/' ) == rInPath.getLength() - 1 ) { - OSL_ENSURE( false, - "HierarchyDataSource::createConfigPath - " + OSL_FAIL( "HierarchyDataSource::createConfigPath - " "Trailing slash in node path!" ); return false; } diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx index 2a594a0de784..9bcaafadc7e2 100644 --- a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx +++ b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx @@ -166,8 +166,7 @@ void SAL_CALL HierarchyContentProvider::initialize( throw( uno::Exception, uno::RuntimeException ) { if ( aArguments.getLength() > 0 ) - OSL_ENSURE( false, - "HierarchyContentProvider::initialize : not supported!" ); + OSL_FAIL( "HierarchyContentProvider::initialize : not supported!" ); } //========================================================================= diff --git a/ucb/source/ucp/odma/odma_inputstream.cxx b/ucb/source/ucp/odma/odma_inputstream.cxx index 5ea4b95416d2..1c291bd2121c 100644 --- a/ucb/source/ucp/odma/odma_inputstream.cxx +++ b/ucb/source/ucp/odma/odma_inputstream.cxx @@ -77,11 +77,11 @@ OOdmaStream::~OOdmaStream() } catch (io::IOException const &) { - OSL_ENSURE(false, "unexpected situation"); + OSL_FAIL("unexpected situation"); } catch (uno::RuntimeException const &) { - OSL_ENSURE(false, "unexpected situation"); + OSL_FAIL("unexpected situation"); } } // ----------------------------------------------------------------------------- diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 1c0634b79acf..cc859e623dae 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -2460,13 +2460,13 @@ bool Content::loadData( ContentProvider* pProvider, catch ( lang::IllegalArgumentException const & ) { // an illegal argument is provided - OSL_ENSURE( false, "Caught IllegalArgumentException!" ); + OSL_FAIL( "Caught IllegalArgumentException!" ); return false; } catch ( embed::InvalidStorageException const & ) { // this storage is in invalid state for any reason - OSL_ENSURE( false, "Caught InvalidStorageException!" ); + OSL_FAIL( "Caught InvalidStorageException!" ); return false; } } @@ -2485,7 +2485,7 @@ bool Content::storeData( const uno::Reference< io::XInputStream >& xData, ContentType eType = m_aProps.getType(); if ( ( eType == ROOT ) || ( eType == DOCUMENT ) ) { - OSL_ENSURE( false, "storeData not supported by root and documents!" ); + OSL_FAIL( "storeData not supported by root and documents!" ); return false; } @@ -2519,22 +2519,22 @@ bool Content::storeData( const uno::Reference< io::XInputStream >& xData, } catch ( beans::UnknownPropertyException const & ) { - OSL_ENSURE( false, "Property MediaType not supported!" ); + OSL_FAIL( "Property MediaType not supported!" ); return false; } catch ( beans::PropertyVetoException const & ) { - OSL_ENSURE( false, "Caught PropertyVetoException!" ); + OSL_FAIL( "Caught PropertyVetoException!" ); return false; } catch ( lang::IllegalArgumentException const & ) { - OSL_ENSURE( false, "Caught IllegalArgumentException!" ); + OSL_FAIL( "Caught IllegalArgumentException!" ); return false; } catch ( lang::WrappedTargetException const & ) { - OSL_ENSURE( false, "Caught WrappedTargetException!" ); + OSL_FAIL( "Caught WrappedTargetException!" ); return false; } @@ -2580,21 +2580,21 @@ bool Content::storeData( const uno::Reference< io::XInputStream >& xData, catch ( io::NotConnectedException const & ) { // readSomeBytes, writeBytes - OSL_ENSURE( false, "Caught NotConnectedException!" ); + OSL_FAIL( "Caught NotConnectedException!" ); closeOutputStream( xOut ); return false; } catch ( io::BufferSizeExceededException const & ) { // readSomeBytes, writeBytes - OSL_ENSURE( false, "Caught BufferSizeExceededException!" ); + OSL_FAIL( "Caught BufferSizeExceededException!" ); closeOutputStream( xOut ); return false; } catch ( io::IOException const & ) { // readSomeBytes, writeBytes - OSL_ENSURE( false, "Caught IOException!" ); + OSL_FAIL( "Caught IOException!" ); closeOutputStream( xOut ); return false; } @@ -2611,7 +2611,7 @@ bool Content::storeData( const uno::Reference< io::XInputStream >& xData, } else { - OSL_ENSURE( false, "Unknown content type!" ); + OSL_FAIL( "Unknown content type!" ); return false; } return true; @@ -2627,7 +2627,7 @@ bool Content::renameData( ContentType eType = m_aProps.getType(); if ( ( eType == ROOT ) || ( eType == DOCUMENT ) ) { - OSL_ENSURE( false, "renameData not supported by root and documents!" ); + OSL_FAIL( "renameData not supported by root and documents!" ); return false; } @@ -2648,37 +2648,37 @@ bool Content::renameData( catch ( embed::InvalidStorageException const & ) { // this storage is in invalid state for eny reason - OSL_ENSURE( false, "Caught InvalidStorageException!" ); + OSL_FAIL( "Caught InvalidStorageException!" ); return false; } catch ( lang::IllegalArgumentException const & ) { // an illegal argument is provided - OSL_ENSURE( false, "Caught IllegalArgumentException!" ); + OSL_FAIL( "Caught IllegalArgumentException!" ); return false; } catch ( container::NoSuchElementException const & ) { // there is no element with old name in this storage - OSL_ENSURE( false, "Caught NoSuchElementException!" ); + OSL_FAIL( "Caught NoSuchElementException!" ); return false; } catch ( container::ElementExistException const & ) { // an element with new name already exists in this storage - OSL_ENSURE( false, "Caught ElementExistException!" ); + OSL_FAIL( "Caught ElementExistException!" ); return false; } catch ( io::IOException const & ) { // in case of io errors during renaming - OSL_ENSURE( false, "Caught IOException!" ); + OSL_FAIL( "Caught IOException!" ); return false; } catch ( embed::StorageWrappedTargetException const & ) { // wraps other exceptions - OSL_ENSURE( false, "Caught StorageWrappedTargetException!" ); + OSL_FAIL( "Caught StorageWrappedTargetException!" ); return false; } @@ -2693,7 +2693,7 @@ bool Content::removeData() ContentType eType = m_aProps.getType(); if ( ( eType == ROOT ) || ( eType == DOCUMENT ) ) { - OSL_ENSURE( false, "removeData not supported by root and documents!" ); + OSL_FAIL( "removeData not supported by root and documents!" ); return false; } @@ -2712,31 +2712,31 @@ bool Content::removeData() catch ( embed::InvalidStorageException const & ) { // this storage is in invalid state for eny reason - OSL_ENSURE( false, "Caught InvalidStorageException!" ); + OSL_FAIL( "Caught InvalidStorageException!" ); return false; } catch ( lang::IllegalArgumentException const & ) { // an illegal argument is provided - OSL_ENSURE( false, "Caught IllegalArgumentException!" ); + OSL_FAIL( "Caught IllegalArgumentException!" ); return false; } catch ( container::NoSuchElementException const & ) { // there is no element with this name in this storage - OSL_ENSURE( false, "Caught NoSuchElementException!" ); + OSL_FAIL( "Caught NoSuchElementException!" ); return false; } catch ( io::IOException const & ) { // in case of io errors during renaming - OSL_ENSURE( false, "Caught IOException!" ); + OSL_FAIL( "Caught IOException!" ); return false; } catch ( embed::StorageWrappedTargetException const & ) { // wraps other exceptions - OSL_ENSURE( false, "Caught StorageWrappedTargetException!" ); + OSL_FAIL( "Caught StorageWrappedTargetException!" ); return false; } @@ -2751,7 +2751,7 @@ bool Content::copyData( const Uri & rSourceUri, const rtl::OUString & rNewName ) ContentType eType = m_aProps.getType(); if ( ( eType == ROOT ) || ( eType == STREAM ) ) { - OSL_ENSURE( false, "copyData not supported by root and streams!" ); + OSL_FAIL( "copyData not supported by root and streams!" ); return false; } @@ -2777,37 +2777,37 @@ bool Content::copyData( const Uri & rSourceUri, const rtl::OUString & rNewName ) catch ( embed::InvalidStorageException const & ) { // this storage is in invalid state for eny reason - OSL_ENSURE( false, "Caught InvalidStorageException!" ); + OSL_FAIL( "Caught InvalidStorageException!" ); return false; } catch ( lang::IllegalArgumentException const & ) { // an illegal argument is provided - OSL_ENSURE( false, "Caught IllegalArgumentException!" ); + OSL_FAIL( "Caught IllegalArgumentException!" ); return false; } catch ( container::NoSuchElementException const & ) { // there is no element with this name in this storage - OSL_ENSURE( false, "Caught NoSuchElementException!" ); + OSL_FAIL( "Caught NoSuchElementException!" ); return false; } catch ( container::ElementExistException const & ) { // there is no element with this name in this storage - OSL_ENSURE( false, "Caught ElementExistException!" ); + OSL_FAIL( "Caught ElementExistException!" ); return false; } catch ( io::IOException const & ) { // in case of io errors during renaming - OSL_ENSURE( false, "Caught IOException!" ); + OSL_FAIL( "Caught IOException!" ); return false; } catch ( embed::StorageWrappedTargetException const & ) { // wraps other exceptions - OSL_ENSURE( false, "Caught StorageWrappedTargetException!" ); + OSL_FAIL( "Caught StorageWrappedTargetException!" ); return false; } @@ -2829,12 +2829,12 @@ bool Content::commitStorage( const uno::Reference< embed::XStorage > & xStorage } catch ( io::IOException const & ) { - OSL_ENSURE( false, "Caught IOException!" ); + OSL_FAIL( "Caught IOException!" ); return false; } catch ( lang::WrappedTargetException const & ) { - OSL_ENSURE( false, "Caught WrappedTargetException!" ); + OSL_FAIL( "Caught WrappedTargetException!" ); return false; } @@ -2855,15 +2855,15 @@ bool Content::closeOutputStream( } catch ( io::NotConnectedException const & ) { - OSL_ENSURE( false, "Caught NotConnectedException!" ); + OSL_FAIL( "Caught NotConnectedException!" ); } catch ( io::BufferSizeExceededException const & ) { - OSL_ENSURE( false, "Caught BufferSizeExceededException!" ); + OSL_FAIL( "Caught BufferSizeExceededException!" ); } catch ( io::IOException const & ) { - OSL_ENSURE( false, "Caught IOException!" ); + OSL_FAIL( "Caught IOException!" ); } } return false; diff --git a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx index 319e2c8ad101..a3472dfd92e0 100644 --- a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx +++ b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx @@ -440,7 +440,7 @@ bool ResultSetDataSupplier::queryNamesOfChildren() m_pImpl->m_xContent->getIdentifier()->getContentIdentifier(), *pNamesOfChildren ) ) { - OSL_ENSURE( false, "Got no list of children!" ); + OSL_FAIL( "Got no list of children!" ); m_pImpl->m_bThrowException = sal_True; return false; } diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx index 7f32ed943e14..c8a036378d08 100644 --- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx +++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx @@ -118,7 +118,7 @@ getDocumentId( const uno::Reference< uno::XInterface > & xDoc ) } catch ( lang::WrappedTargetException const & ) { - OSL_ENSURE( false, "Caught WrappedTargetException!" ); + OSL_FAIL( "Caught WrappedTargetException!" ); } } @@ -645,11 +645,11 @@ bool OfficeDocumentsManager::isBasicIDE( } catch ( lang::IllegalArgumentException const & ) { - OSL_ENSURE( false, "Caught IllegalArgumentException!" ); + OSL_FAIL( "Caught IllegalArgumentException!" ); } catch ( frame::UnknownModuleException const & ) { - OSL_ENSURE( false, "Caught UnknownModuleException!" ); + OSL_FAIL( "Caught UnknownModuleException!" ); } if ( aModule.getLength() > 0 ) diff --git a/ucb/source/ucp/tdoc/tdoc_provider.cxx b/ucb/source/ucp/tdoc/tdoc_provider.cxx index 408cf216cdac..810582cc6f76 100644 --- a/ucb/source/ucp/tdoc/tdoc_provider.cxx +++ b/ucb/source/ucp/tdoc/tdoc_provider.cxx @@ -345,11 +345,11 @@ ContentProvider::queryStorage( const rtl::OUString & rUri, } catch ( embed::InvalidStorageException const & ) { - OSL_ENSURE( false, "Caught InvalidStorageException!" ); + OSL_FAIL( "Caught InvalidStorageException!" ); } catch ( lang::IllegalArgumentException const & ) { - OSL_ENSURE( false, "Caught IllegalArgumentException!" ); + OSL_FAIL( "Caught IllegalArgumentException!" ); } catch ( io::IOException const & ) { @@ -358,7 +358,7 @@ ContentProvider::queryStorage( const rtl::OUString & rUri, } catch ( embed::StorageWrappedTargetException const & ) { - OSL_ENSURE( false, "Caught embed::StorageWrappedTargetException!" ); + OSL_FAIL( "Caught embed::StorageWrappedTargetException!" ); } } return uno::Reference< embed::XStorage >(); @@ -384,11 +384,11 @@ ContentProvider::queryStorageClone( const rtl::OUString & rUri ) const } catch ( embed::InvalidStorageException const & ) { - OSL_ENSURE( false, "Caught InvalidStorageException!" ); + OSL_FAIL( "Caught InvalidStorageException!" ); } catch ( lang::IllegalArgumentException const & ) { - OSL_ENSURE( false, "Caught IllegalArgumentException!" ); + OSL_FAIL( "Caught IllegalArgumentException!" ); } catch ( io::IOException const & ) { @@ -397,7 +397,7 @@ ContentProvider::queryStorageClone( const rtl::OUString & rUri ) const } catch ( embed::StorageWrappedTargetException const & ) { - OSL_ENSURE( false, "Caught embed::StorageWrappedTargetException!" ); + OSL_FAIL( "Caught embed::StorageWrappedTargetException!" ); } } @@ -418,19 +418,19 @@ ContentProvider::queryInputStream( const rtl::OUString & rUri, } catch ( embed::InvalidStorageException const & ) { - OSL_ENSURE( false, "Caught InvalidStorageException!" ); + OSL_FAIL( "Caught InvalidStorageException!" ); } catch ( lang::IllegalArgumentException const & ) { - OSL_ENSURE( false, "Caught IllegalArgumentException!" ); + OSL_FAIL( "Caught IllegalArgumentException!" ); } catch ( io::IOException const & ) { - OSL_ENSURE( false, "Caught IOException!" ); + OSL_FAIL( "Caught IOException!" ); } catch ( embed::StorageWrappedTargetException const & ) { - OSL_ENSURE( false, "Caught embed::StorageWrappedTargetException!" ); + OSL_FAIL( "Caught embed::StorageWrappedTargetException!" ); } // catch ( packages::WrongPasswordException const & ) // { @@ -457,11 +457,11 @@ ContentProvider::queryOutputStream( const rtl::OUString & rUri, } catch ( embed::InvalidStorageException const & ) { - OSL_ENSURE( false, "Caught InvalidStorageException!" ); + OSL_FAIL( "Caught InvalidStorageException!" ); } catch ( lang::IllegalArgumentException const & ) { - OSL_ENSURE( false, "Caught IllegalArgumentException!" ); + OSL_FAIL( "Caught IllegalArgumentException!" ); } catch ( io::IOException const & ) { @@ -470,7 +470,7 @@ ContentProvider::queryOutputStream( const rtl::OUString & rUri, } catch ( embed::StorageWrappedTargetException const & ) { - OSL_ENSURE( false, "Caught embed::StorageWrappedTargetException!" ); + OSL_FAIL( "Caught embed::StorageWrappedTargetException!" ); } // catch ( packages::WrongPasswordException const & ) // { @@ -496,11 +496,11 @@ ContentProvider::queryStream( const rtl::OUString & rUri, } catch ( embed::InvalidStorageException const & ) { - OSL_ENSURE( false, "Caught InvalidStorageException!" ); + OSL_FAIL( "Caught InvalidStorageException!" ); } catch ( lang::IllegalArgumentException const & ) { - OSL_ENSURE( false, "Caught IllegalArgumentException!" ); + OSL_FAIL( "Caught IllegalArgumentException!" ); } catch ( io::IOException const & ) { @@ -509,7 +509,7 @@ ContentProvider::queryStream( const rtl::OUString & rUri, } catch ( embed::StorageWrappedTargetException const & ) { - OSL_ENSURE( false, "Caught embed::StorageWrappedTargetException!" ); + OSL_FAIL( "Caught embed::StorageWrappedTargetException!" ); } // catch ( packages::WrongPasswordException const & ) // { @@ -560,11 +560,11 @@ bool ContentProvider::queryNamesOfChildren( } catch ( embed::InvalidStorageException const & ) { - OSL_ENSURE( false, "Caught InvalidStorageException!" ); + OSL_FAIL( "Caught InvalidStorageException!" ); } catch ( lang::IllegalArgumentException const & ) { - OSL_ENSURE( false, "Caught IllegalArgumentException!" ); + OSL_FAIL( "Caught IllegalArgumentException!" ); } catch ( io::IOException const & ) { @@ -573,8 +573,7 @@ bool ContentProvider::queryNamesOfChildren( } catch ( embed::StorageWrappedTargetException const & ) { - OSL_ENSURE( false, - "Caught embed::StorageWrappedTargetException!" ); + OSL_FAIL( "Caught embed::StorageWrappedTargetException!" ); } } } diff --git a/ucb/source/ucp/tdoc/tdoc_stgelems.cxx b/ucb/source/ucp/tdoc/tdoc_stgelems.cxx index 86bb91d15d71..104d66fa4908 100644 --- a/ucb/source/ucp/tdoc/tdoc_stgelems.cxx +++ b/ucb/source/ucp/tdoc/tdoc_stgelems.cxx @@ -111,7 +111,7 @@ Storage::Storage( const uno::Reference< lang::XMultiServiceFactory > & xSMgr, } catch ( uno::Exception const & ) { - OSL_ENSURE( false, "Storage::Storage: Caught exception!" ); + OSL_FAIL( "Storage::Storage: Caught exception!" ); } OSL_ENSURE( m_xAggProxy.is(), @@ -157,7 +157,7 @@ Storage::~Storage() } catch ( ... ) { - OSL_ENSURE( false, "Storage::~Storage - Caught exception!" ); + OSL_FAIL( "Storage::~Storage - Caught exception!" ); } } } @@ -620,7 +620,7 @@ OutputStream::OutputStream( } catch ( uno::Exception const & ) { - OSL_ENSURE( false, "OutputStream::OutputStream: Caught exception!" ); + OSL_FAIL( "OutputStream::OutputStream: Caught exception!" ); } OSL_ENSURE( m_xAggProxy.is(), @@ -821,7 +821,7 @@ Stream::Stream( } catch ( uno::Exception const & ) { - OSL_ENSURE( false, "OutputStream::OutputStream: Caught exception!" ); + OSL_FAIL( "OutputStream::OutputStream: Caught exception!" ); } OSL_ENSURE( m_xAggProxy.is(), diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx index 42451a53ed4e..346dec1ce73b 100644 --- a/ucb/source/ucp/tdoc/tdoc_storage.cxx +++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx @@ -311,8 +311,7 @@ StorageElementFactory::createOutputStream( const rtl::OUString & rUri, // Each stream must have a parent storage. if ( !xParentStorage.is() ) { - OSL_ENSURE( false, - "StorageElementFactory::createOutputStream - " + OSL_FAIL( "StorageElementFactory::createOutputStream - " "Unable to create parent storage!" ); return uno::Reference< io::XOutputStream >(); } @@ -323,8 +322,7 @@ StorageElementFactory::createOutputStream( const rtl::OUString & rUri, if ( !xStream.is() ) { - OSL_ENSURE( false, - "StorageElementFactory::createOutputStream - " + OSL_FAIL( "StorageElementFactory::createOutputStream - " "Unable to create stream!" ); return uno::Reference< io::XOutputStream >(); } @@ -359,8 +357,7 @@ StorageElementFactory::createStream( const rtl::OUString & rUri, // Each stream must have a parent storage. if ( !xParentStorage.is() ) { - OSL_ENSURE( false, - "StorageElementFactory::createStream - " + OSL_FAIL( "StorageElementFactory::createStream - " "Unable to create parent storage!" ); return uno::Reference< io::XStream >(); } @@ -371,8 +368,7 @@ StorageElementFactory::createStream( const rtl::OUString & rUri, if ( !xStream.is() ) { - OSL_ENSURE( false, - "StorageElementFactory::createStream - " + OSL_FAIL( "StorageElementFactory::createStream - " "Unable to create stream!" ); return uno::Reference< io::XStream >(); } @@ -502,8 +498,8 @@ uno::Reference< embed::XStorage > StorageElementFactory::queryStorage( } else { - OSL_ENSURE( - false, "Bug! Value of property OpenMode has wrong type!" ); + OSL_FAIL( + "Bug! Value of property OpenMode has wrong type!" ); throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( @@ -513,7 +509,7 @@ uno::Reference< embed::XStorage > StorageElementFactory::queryStorage( } catch ( beans::UnknownPropertyException const & e ) { - OSL_ENSURE( false, "Property OpenMode not supported!" ); + OSL_FAIL( "Property OpenMode not supported!" ); throw embed::StorageWrappedTargetException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( @@ -523,7 +519,7 @@ uno::Reference< embed::XStorage > StorageElementFactory::queryStorage( } catch ( lang::WrappedTargetException const & e ) { - OSL_ENSURE( false, "Caught WrappedTargetException!" ); + OSL_FAIL( "Caught WrappedTargetException!" ); throw embed::StorageWrappedTargetException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( @@ -643,8 +639,7 @@ StorageElementFactory::queryStream( break; default: - OSL_ENSURE( false, - "StorageElementFactory::queryStream : Unknown open mode!" ); + OSL_FAIL( "StorageElementFactory::queryStream : Unknown open mode!" ); throw embed::InvalidStorageException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 5822704b4b0e..de5ac9102b20 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -352,7 +352,7 @@ namespace aMessage.append( "no type found for '" ); aMessage.append( ::rtl::OUStringToOString( i_rTypeName, RTL_TEXTENCODING_UTF8 ) ); aMessage.append( "'" ); - OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() ); + OSL_FAIL( aMessage.makeStringAndClear().getStr() ); #endif return false; } @@ -1038,8 +1038,7 @@ UUIInteractionHelper::getInteractionHandlerList( if ( !( xHierNameAccess->getByHierarchicalName( aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) { - OSL_ENSURE( false, - "GetInteractionHandlerList - " + OSL_FAIL( "GetInteractionHandlerList - " "Error getting item value!" ); continue; } @@ -1053,8 +1052,7 @@ UUIInteractionHelper::getInteractionHandlerList( { // getByHierarchicalName - OSL_ENSURE( false, - "GetInteractionHandlerList - " + OSL_FAIL( "GetInteractionHandlerList - " "caught NoSuchElementException!" ); } } @@ -1066,7 +1064,7 @@ UUIInteractionHelper::getInteractionHandlerList( } catch ( uno::Exception const & ) { - OSL_ENSURE( false, "GetInteractionHandlerList - Caught Exception!" ); + OSL_FAIL( "GetInteractionHandlerList - Caught Exception!" ); } } @@ -1367,8 +1365,7 @@ UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest( s_bDeferredToNextSession = true; break; default: - OSL_ENSURE( false, - "UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest: " + OSL_FAIL( "UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest: " "unexpected dialog return value!" ); break; } diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 5c6b6fafcf08..e8a0ed79d38b 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -1789,7 +1789,7 @@ Db* DataBaseIterator::nextDb( rtl::OUString* o_pExtensionPath, rtl::OUString* o_ } case END_REACHED: - OSL_ENSURE( false, "DataBaseIterator::nextDb(): Invalid case END_REACHED" ); + OSL_FAIL( "DataBaseIterator::nextDb(): Invalid case END_REACHED" ); break; } } @@ -1915,7 +1915,7 @@ rtl::OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension ) } case END_REACHED: - OSL_ENSURE( false, "DataBaseIterator::nextDbFile(): Invalid case END_REACHED" ); + OSL_FAIL( "DataBaseIterator::nextDbFile(): Invalid case END_REACHED" ); break; } } @@ -1989,7 +1989,7 @@ Reference< XHierarchicalNameAccess > JarFileIterator::nextJarFile } case END_REACHED: - OSL_ENSURE( false, "JarFileIterator::nextJarFile(): Invalid case END_REACHED" ); + OSL_FAIL( "JarFileIterator::nextJarFile(): Invalid case END_REACHED" ); break; } } @@ -2122,7 +2122,7 @@ rtl::OUString IndexFolderIterator::nextIndexFolder( bool& o_rbExtension, bool& o } case END_REACHED: - OSL_ENSURE( false, "IndexFolderIterator::nextIndexFolder(): Invalid case END_REACHED" ); + OSL_FAIL( "IndexFolderIterator::nextIndexFolder(): Invalid case END_REACHED" ); break; } } diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 991e978862e1..6b74767acbed 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -1225,7 +1225,7 @@ rtl::OUString TreeFileIterator::nextTreeFile( sal_Int32& rnFileSize ) } case END_REACHED: - OSL_ENSURE( false, "DataBaseIterator::nextTreeFile(): Invalid case END_REACHED" ); + OSL_FAIL( "DataBaseIterator::nextTreeFile(): Invalid case END_REACHED" ); break; } } diff --git a/xmloff/source/chart/ColorPropertySet.cxx b/xmloff/source/chart/ColorPropertySet.cxx index 273080566cc6..e4a8525f5a1f 100644 --- a/xmloff/source/chart/ColorPropertySet.cxx +++ b/xmloff/source/chart/ColorPropertySet.cxx @@ -156,7 +156,7 @@ void SAL_CALL ColorPropertySet::addPropertyChangeListener( const OUString& /* aP lang::WrappedTargetException, uno::RuntimeException) { - OSL_ENSURE( false, "Not Implemented" ); + OSL_FAIL( "Not Implemented" ); return; } @@ -165,7 +165,7 @@ void SAL_CALL ColorPropertySet::removePropertyChangeListener( const OUString& /* lang::WrappedTargetException, uno::RuntimeException) { - OSL_ENSURE( false, "Not Implemented" ); + OSL_FAIL( "Not Implemented" ); return; } @@ -174,7 +174,7 @@ void SAL_CALL ColorPropertySet::addVetoableChangeListener( const OUString& /* Pr lang::WrappedTargetException, uno::RuntimeException) { - OSL_ENSURE( false, "Not Implemented" ); + OSL_FAIL( "Not Implemented" ); return; } @@ -183,7 +183,7 @@ void SAL_CALL ColorPropertySet::removeVetoableChangeListener( const OUString& /* lang::WrappedTargetException, uno::RuntimeException) { - OSL_ENSURE( false, "Not Implemented" ); + OSL_FAIL( "Not Implemented" ); return; } diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 30f14a171032..1dda69270891 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -161,7 +161,7 @@ void lcl_MoveDataToCandleStickSeries( } catch( uno::Exception & ) { - OSL_ENSURE( false, "Exception caught while moving data to candlestick series" ); + OSL_FAIL( "Exception caught while moving data to candlestick series" ); } } diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index ba74da15efb4..f236a0c41df1 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -366,7 +366,7 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Referen catch( uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, OUStringToOString( + OSL_FAIL( OUStringToOString( OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught. Type: " )) + OUString::createFromAscii( typeid( ex ).name()) + OUString( RTL_CONSTASCII_USTRINGPARAM( ", Message: " )) + @@ -484,7 +484,7 @@ bool lcl_isSeriesAttachedToFirstAxis( catch( uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, OUStringToOString( + OSL_FAIL( OUStringToOString( OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught. Type: " )) + OUString::createFromAscii( typeid( ex ).name()) + OUString( RTL_CONSTASCII_USTRINGPARAM( ", Message: " )) + @@ -3820,7 +3820,7 @@ void SchXMLExportHelper_Impl::InitRangeSegmentationProperties( const Reference< catch( uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, OUStringToOString( + OSL_FAIL( OUStringToOString( OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught. Type: " )) + OUString::createFromAscii( typeid( ex ).name()) + OUString( RTL_CONSTASCII_USTRINGPARAM( ", Message: " )) + diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index b01a4f995cec..1057d3d07ce6 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -549,7 +549,7 @@ void SchXMLImportHelper::DeleteDataSeries( catch( uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, OUStringToOString( + OSL_FAIL( OUStringToOString( OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught. Type: " )) + OUString::createFromAscii( typeid( ex ).name()) + OUString( RTL_CONSTASCII_USTRINGPARAM( ", Message: " )) + @@ -632,7 +632,7 @@ Reference< chart2::XDataSeries > SchXMLImportHelper::GetNewDataSeries( catch( uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, OUStringToOString( + OSL_FAIL( OUStringToOString( OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught. Type: " )) + OUString::createFromAscii( typeid( ex ).name()) + OUString( RTL_CONSTASCII_USTRINGPARAM( ", Message: " )) + @@ -645,7 +645,7 @@ Reference< chart2::XDataSeries > SchXMLImportHelper::GetNewDataSeries( Reference< chart2::data::XLabeledDataSequence > SchXMLImportHelper::GetNewLabeledDataSequence() { // @todo: remove this asap - OSL_ENSURE( false, "Do not call this method" ); + OSL_FAIL( "Do not call this method" ); Reference< chart2::data::XLabeledDataSequence > xResult; // DO NOT USED -- DEPRECATED. Use SchXMLTools::GetNewLabeledDataSequence() instead return xResult; diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index 92a9239cfe70..6295e0958ba2 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -464,7 +464,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib catch( uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, ::rtl::OUStringToOString( + OSL_FAIL( ::rtl::OUStringToOString( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught. Type: " )) + ::rtl::OUString::createFromAscii( typeid( ex ).name()) + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ", Message: " )) + diff --git a/xmloff/source/chart/SchXMLSeriesHelper.cxx b/xmloff/source/chart/SchXMLSeriesHelper.cxx index 5996da5c89fd..4519b2c12ddd 100644 --- a/xmloff/source/chart/SchXMLSeriesHelper.cxx +++ b/xmloff/source/chart/SchXMLSeriesHelper.cxx @@ -83,7 +83,7 @@ using ::rtl::OUString; { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, OUStringToOString( OUString( + OSL_FAIL( OUStringToOString( OUString( OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught. Type: " )) + OUString::createFromAscii( typeid( ex ).name()) + OUString( RTL_CONSTASCII_USTRINGPARAM( ", Message: " )) + @@ -220,7 +220,7 @@ Reference< chart2::XDataSeries > SchXMLSeriesHelper::getFirstCandleStickSeries( } catch( const uno::Exception & ) { - OSL_ENSURE( false, "Exception caught" ); + OSL_FAIL( "Exception caught" ); } return xResult; } diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index dbd8c395331b..d858833585ee 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -493,7 +493,7 @@ void CreateCategories( catch( const lang::IllegalArgumentException & ex ) { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, ::rtl::OUStringToOString( + OSL_FAIL( ::rtl::OUStringToOString( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IllegalArgumentException caught, Message: " )) + ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr()); } @@ -515,7 +515,7 @@ void CreateCategories( } catch( uno::Exception & ) { - OSL_ENSURE( false, "Exception caught while creating Categories" ); + OSL_FAIL( "Exception caught while creating Categories" ); } } @@ -670,7 +670,7 @@ void setXMLRangePropertyAtDataSequence( catch( const uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, ::rtl::OUStringToOString( + OSL_FAIL( ::rtl::OUStringToOString( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught, Message: " )) + ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr()); } @@ -700,7 +700,7 @@ bool getXMLRangePropertyFromDataSequence( catch( const uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, ::rtl::OUStringToOString( + OSL_FAIL( ::rtl::OUStringToOString( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught, Message: " )) + ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr()); } @@ -735,7 +735,7 @@ void copyProperties( } catch( const uno::Exception & ) { - OSL_ENSURE( false, "Copying property sets failed!" ); + OSL_FAIL( "Copying property sets failed!" ); } } diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx index fd931e39fc88..0f3cdfd6e1e1 100644 --- a/xmloff/source/core/RDFaExportHelper.cxx +++ b/xmloff/source/core/RDFaExportHelper.cxx @@ -224,7 +224,7 @@ RDFaExportHelper::AddRDFa( } catch (uno::Exception &) { - OSL_ENSURE(false, "AddRDFa: exception"); + OSL_FAIL("AddRDFa: exception"); } } diff --git a/xmloff/source/core/RDFaImportHelper.cxx b/xmloff/source/core/RDFaImportHelper.cxx index 2e4c5db72677..043b9f70e5fa 100644 --- a/xmloff/source/core/RDFaImportHelper.cxx +++ b/xmloff/source/core/RDFaImportHelper.cxx @@ -308,7 +308,7 @@ RDFaInserter::MakeURI( ::rtl::OUString const & i_rURI) const } catch (uno::Exception &) { - OSL_ENSURE(false, "MakeURI: cannot create URI"); + OSL_FAIL("MakeURI: cannot create URI"); return 0; } } @@ -403,7 +403,7 @@ void RDFaInserter::InsertRDFaEntry( } catch (uno::Exception &) { - OSL_ENSURE(false, "InsertRDFaEntry: setStatementRDFa failed?"); + OSL_FAIL("InsertRDFaEntry: setStatementRDFa failed?"); } } @@ -455,12 +455,12 @@ RDFaImportHelper::AddRDFa( { if (!i_xObject.is()) { - OSL_ENSURE(false, "AddRDFa: invalid arg: null textcontent"); + OSL_FAIL("AddRDFa: invalid arg: null textcontent"); return; } if (!i_pRDFaAttributes.get()) { - OSL_ENSURE(false, "AddRDFa: invalid arg: null RDFa attributes"); + OSL_FAIL("AddRDFa: invalid arg: null RDFa attributes"); return; } m_RDFaEntries.push_back(RDFaEntry(i_xObject, i_pRDFaAttributes)); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 6eb0e090cc5f..e6e3d996c300 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -2503,7 +2503,7 @@ SvXMLExport::AddAttributeXmlId(uno::Reference<uno::XInterface> const & i_xIfc) } else { - OSL_ENSURE(false, "SvXMLExport::AddAttributeXmlId: " + OSL_FAIL("SvXMLExport::AddAttributeXmlId: " "invalid stream name"); } } diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 8e5c76b53770..778506a8fcd5 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1966,7 +1966,7 @@ void SvXMLImport::SetXmlId(uno::Reference<uno::XInterface> const & i_xIfc, } } } catch (uno::Exception &) { - OSL_ENSURE(false, "SvXMLImport::SetXmlId: exception?"); + OSL_FAIL("SvXMLImport::SetXmlId: exception?"); } } } diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 3ab4a9f6506e..7e1f2ac55f18 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -338,7 +338,7 @@ namespace xmloff ::rtl::OString aMessage( "OElementImport::implImportGenericProperties: encountered an unknown property (" ); aMessage += ::rtl::OUStringToOString( aPropValues->Name, RTL_TEXTENCODING_ASCII_US ); aMessage += "), but component is no PropertyBag!"; - OSL_ENSURE( false, aMessage.getStr() ); + OSL_FAIL( aMessage.getStr() ); #endif continue; } @@ -374,7 +374,7 @@ namespace xmloff if ( bPropIsSequence != bValueIsSequence ) { - OSL_ENSURE( false, "OElementImport::implImportGenericProperties: either both value and property should be a sequence, or none of them!" ); + OSL_FAIL( "OElementImport::implImportGenericProperties: either both value and property should be a sequence, or none of them!" ); continue; } @@ -428,13 +428,13 @@ namespace xmloff aPropValues->Value <<= static_cast< sal_Int64 >( nVal ); break; default: - OSL_ENSURE( false, "OElementImport::implImportGenericProperties: unsupported value type!" ); + OSL_FAIL( "OElementImport::implImportGenericProperties: unsupported value type!" ); break; } } break; default: - OSL_ENSURE( false, "OElementImport::implImportGenericProperties: non-double values not supported!" ); + OSL_FAIL( "OElementImport::implImportGenericProperties: non-double values not supported!" ); break; } } diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx index 6cab1933a51b..1ea002e00ee2 100644 --- a/xmloff/source/forms/layerimport.cxx +++ b/xmloff/source/forms/layerimport.cxx @@ -546,7 +546,7 @@ SvXMLImportContext* OFormLayerXMLImport_Impl::createContext(const sal_uInt16 _nP if ( !pContext ) { - OSL_ENSURE( false, "unknown element" ); + OSL_FAIL( "unknown element" ); pContext = new SvXMLImportContext(m_rImporter, _nPrefix, _rLocalName); } diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx index 30a7e709c35d..ff6f941e9917 100644 --- a/xmloff/source/forms/propertyimport.cxx +++ b/xmloff/source/forms/propertyimport.cxx @@ -542,8 +542,7 @@ void OListPropertyContext::StartElement( const Reference< sax::XAttributeList >& } else { - OSL_ENSURE( false, - ::rtl::OString( "OListPropertyContext::StartElement: unknown child element (\"") + OSL_FAIL( ::rtl::OString( "OListPropertyContext::StartElement: unknown child element (\"") += ::rtl::OString( sAttributeName.getStr(), sAttributeName.getLength(), RTL_TEXTENCODING_ASCII_US ) += ::rtl::OString( "\")!" ) ); } @@ -628,8 +627,7 @@ void OListValueContext::StartElement( const Reference< sax::XAttributeList >& _r } } - OSL_ENSURE( false, - ::rtl::OString( "OListValueContext::StartElement: unknown child element (\"") + OSL_FAIL( ::rtl::OString( "OListValueContext::StartElement: unknown child element (\"") += ::rtl::OString( sAttributeName.getStr(), sAttributeName.getLength(), RTL_TEXTENCODING_ASCII_US ) += ::rtl::OString( "\")!" ) ); } diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx index 778fe8255a52..47f4eeed3714 100644 --- a/xmloff/source/text/XMLIndexTOCContext.cxx +++ b/xmloff/source/text/XMLIndexTOCContext.cxx @@ -362,7 +362,7 @@ SvXMLImportContext* XMLIndexTOCContext::CreateChildContext( break; default: - OSL_ENSURE(false, "index type not implemented"); + OSL_FAIL("index type not implemented"); break; } } diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index ffd869c85724..6616e285f1d8 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -305,7 +305,7 @@ void XMLSectionExport::ExportSectionEnd( break; default: - OSL_ENSURE(false, "unknown index type"); + OSL_FAIL("unknown index type"); // default: skip index! break; } @@ -331,7 +331,7 @@ void XMLSectionExport::ExportSectionEnd( } else { - OSL_ENSURE(false, "Need element name!"); + OSL_FAIL("Need element name!"); } } // else: autostyles -> ignore @@ -375,7 +375,7 @@ void XMLSectionExport::ExportIndexStart( default: // skip index - OSL_ENSURE(false, "unknown index type"); + OSL_FAIL("unknown index type"); break; } } diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index 68f929fd3c5d..8338d398d17b 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -382,7 +382,7 @@ Reference<XTextContent> XMLTextMarkImportContext::CreateAndInsertMark( if (!xIfc.is()) { - OSL_ENSURE(false, "CreateAndInsertMark: cannot create service?"); + OSL_FAIL("CreateAndInsertMark: cannot create service?"); return 0; } @@ -396,7 +396,7 @@ Reference<XTextContent> XMLTextMarkImportContext::CreateAndInsertMark( { if (sMarkName.getLength()) { - OSL_ENSURE(false, "name given, but XNamed not supported?"); + OSL_FAIL("name given, but XNamed not supported?"); return 0; } } @@ -419,7 +419,7 @@ Reference<XTextContent> XMLTextMarkImportContext::CreateAndInsertMark( } catch (com::sun::star::lang::IllegalArgumentException &) { - OSL_ENSURE(false, "CreateAndInsertMark: cannot insert?"); + OSL_FAIL("CreateAndInsertMark: cannot insert?"); return 0; } } diff --git a/xmloff/source/text/XMLTextNumRuleInfo.cxx b/xmloff/source/text/XMLTextNumRuleInfo.cxx index a17da2ea4b72..a703f57804bd 100644 --- a/xmloff/source/text/XMLTextNumRuleInfo.cxx +++ b/xmloff/source/text/XMLTextNumRuleInfo.cxx @@ -172,7 +172,7 @@ void XMLTextNumRuleInfo::Set( { if( !(xPropSet->getPropertyValue( msNumberingIsNumber ) >>= mbIsNumbered ) ) { - OSL_ENSURE( false, "numbered paragraph without number info" ); + OSL_FAIL( "numbered paragraph without number info" ); mbIsNumbered = sal_False; } } diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx index 2444c1de79f9..58bedf74ee81 100644 --- a/xmloff/source/text/txtlists.cxx +++ b/xmloff/source/text/txtlists.cxx @@ -352,7 +352,7 @@ XMLTextListsHelper::GetNumberedParagraphListId( const ::rtl::OUString i_StyleName) { if (!i_StyleName.getLength()) { - OSL_ENSURE(false, "invalid numbered-paragraph: no style-name"); + OSL_FAIL("invalid numbered-paragraph: no style-name"); } if (i_StyleName.getLength() && (i_Level < mLastNumberedParagraphs.size()) diff --git a/xmloff/source/transform/ChartPlotAreaOASISTContext.cxx b/xmloff/source/transform/ChartPlotAreaOASISTContext.cxx index 147d262ac864..cbe04f9dfc63 100644 --- a/xmloff/source/transform/ChartPlotAreaOASISTContext.cxx +++ b/xmloff/source/transform/ChartPlotAreaOASISTContext.cxx @@ -150,7 +150,7 @@ void XMLAxisOASISContext::StartElement( } else { - OSL_ENSURE( false, "ChartAxis: Invalid attribute value" ); + OSL_FAIL( "ChartAxis: Invalid attribute value" ); } if( eToken != XML_TOKEN_INVALID ) diff --git a/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx b/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx index 2f338465368f..eacaa0fa0fae 100644 --- a/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx +++ b/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx @@ -114,7 +114,7 @@ void XMLAxisOOoContext::StartElement( } else { - OSL_ENSURE( false, "ChartAxis: Invalid attribute value" ); + OSL_FAIL( "ChartAxis: Invalid attribute value" ); } if( eToken != XML_TOKEN_INVALID ) diff --git a/xmloff/source/transform/EventOOoTContext.cxx b/xmloff/source/transform/EventOOoTContext.cxx index a40516bc2c9e..f2caaf20427e 100644 --- a/xmloff/source/transform/EventOOoTContext.cxx +++ b/xmloff/source/transform/EventOOoTContext.cxx @@ -77,7 +77,7 @@ void XMLTransformerOOoEventMap_Impl::AddMap( XMLTransformerEventMapEntry *pInit if( !insert( aVal ).second ) { - OSL_ENSURE( false, "duplicate OOo event name extry" ); + OSL_FAIL( "duplicate OOo event name extry" ); } ++pInit; diff --git a/xmloff/source/transform/StyleOASISTContext.cxx b/xmloff/source/transform/StyleOASISTContext.cxx index aa8ee0f4ebe1..b90047937e6d 100644 --- a/xmloff/source/transform/StyleOASISTContext.cxx +++ b/xmloff/source/transform/StyleOASISTContext.cxx @@ -707,7 +707,7 @@ OUString XMLPropertiesTContext_Impl::MergeUnderline( eUnderline = XML_BOLD_WAVE; break; default: - OSL_ENSURE( false, "xmloff::XMLPropertiesTContext_Impl::MergeUnderline(), missing underline case!" ); + OSL_FAIL( "xmloff::XMLPropertiesTContext_Impl::MergeUnderline(), missing underline case!" ); break; } } @@ -722,7 +722,7 @@ OUString XMLPropertiesTContext_Impl::MergeUnderline( eUnderline = XML_NONE; break; default: - OSL_ENSURE( false, "xmloff::XMLPropertiesTContext_Impl::MergeUnderline(), missing underline case!" ); + OSL_FAIL( "xmloff::XMLPropertiesTContext_Impl::MergeUnderline(), missing underline case!" ); break; } } diff --git a/xmloff/source/transform/StyleOOoTContext.cxx b/xmloff/source/transform/StyleOOoTContext.cxx index 0d5e684841a8..63524619298a 100644 --- a/xmloff/source/transform/StyleOOoTContext.cxx +++ b/xmloff/source/transform/StyleOOoTContext.cxx @@ -609,7 +609,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement( bDouble = sal_False; break; default: - OSL_ENSURE( false, "xmloff::XMLPropertiesOOoTContext_Impl::StartElement(), unknown underline token!" ); + OSL_FAIL( "xmloff::XMLPropertiesOOoTContext_Impl::StartElement(), unknown underline token!" ); break; } pContext->AddAttribute( @@ -712,7 +712,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement( break; default: - OSL_ENSURE( false, "invalid spline type" ); + OSL_FAIL( "invalid spline type" ); pContext->AddAttribute( aNewAttrName, GetXMLToken( XML_NONE )); break; @@ -773,7 +773,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement( eToken = XML_HOURGLASS; break; default: - OSL_ENSURE( false, "invalid named symbol" ); + OSL_FAIL( "invalid named symbol" ); break; } @@ -804,7 +804,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement( aNewAttrName, GetXMLToken( XML_IMAGE )); break; default: - OSL_ENSURE( false, "invalid symbol type" ); + OSL_FAIL( "invalid symbol type" ); pContext->AddAttribute( aNewAttrName, GetXMLToken( XML_NONE )); break; diff --git a/xmloff/source/xforms/xformsimport.cxx b/xmloff/source/xforms/xformsimport.cxx index 62a52c27fef3..5ada40188089 100644 --- a/xmloff/source/xforms/xformsimport.cxx +++ b/xmloff/source/xforms/xformsimport.cxx @@ -158,7 +158,7 @@ void applyXFormsSettings( const Reference< XNameAccess >& _rXForms, const Sequen Reference< XNameAccess > xModelSettings( aSettings.get( "XFormModels" ), UNO_QUERY ); if ( !xModelSettings.is() ) { - OSL_ENSURE( false, "applyXFormsSettings: wrong type for the XFormModels settings!" ); + OSL_FAIL( "applyXFormsSettings: wrong type for the XFormModels settings!" ); return; } @@ -177,7 +177,7 @@ void applyXFormsSettings( const Reference< XNameAccess >& _rXForms, const Sequen // the model itself if ( !_rXForms->hasByName( *pModelName ) ) { - OSL_ENSURE( false, "applyXFormsSettings: have settings for a non-existent XForms model!" ); + OSL_FAIL( "applyXFormsSettings: have settings for a non-existent XForms model!" ); continue; } @@ -192,7 +192,7 @@ void applyXFormsSettings( const Reference< XNameAccess >& _rXForms, const Sequen { if ( !xModelPSI->hasPropertyByName( pSetting->Name ) ) { - OSL_ENSURE( false, "applyXFormsSettings: non-existent model property!" ); + OSL_FAIL( "applyXFormsSettings: non-existent model property!" ); continue; } |