From 5ad692096323fcdf03823352b70bb7e71660919c Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Sat, 12 Mar 2011 11:29:14 +0100 Subject: Move OSL_ENSURE(false,...) to OSL_FAIL(...) --- .../source/extended/accessibleeditbrowseboxcell.cxx | 2 +- accessibility/source/extended/textwindowaccessibility.cxx | 2 +- basctl/source/basicide/basobj2.cxx | 4 ++-- basctl/source/basicide/basobj3.cxx | 2 +- basctl/source/basicide/scriptdocument.cxx | 2 +- cui/source/customize/macropg.cxx | 2 +- extensions/source/config/ldap/ldapaccess.cxx | 2 +- extensions/source/logging/filehandler.cxx | 2 +- extensions/source/plugin/aqua/sysplug.cxx | 4 ++-- extensions/source/plugin/win/sysplug.cxx | 4 ++-- extensions/source/propctrlr/browserlistbox.cxx | 2 +- extensions/source/propctrlr/composeduiupdate.cxx | 4 ++-- extensions/source/propctrlr/formcomponenthandler.cxx | 12 ++++++------ extensions/source/propctrlr/formgeometryhandler.cxx | 10 +++++----- extensions/source/propctrlr/genericpropertyhandler.cxx | 4 ++-- extensions/source/propctrlr/propcontroller.cxx | 4 ++-- extensions/source/propctrlr/propertycomposer.cxx | 4 ++-- extensions/source/propctrlr/stringrepresentation.cxx | 4 ++-- extensions/source/resource/oooresourceloader.cxx | 4 ++-- extensions/source/update/check/updatehdl.cxx | 14 +++++++------- extensions/source/update/check/updateprotocol.cxx | 4 ++-- forms/source/component/ComboBox.cxx | 2 +- forms/source/component/FormComponent.cxx | 6 +++--- forms/source/component/Grid.cxx | 2 +- forms/source/component/ImageControl.cxx | 6 +++--- forms/source/component/ListBox.cxx | 12 ++++++------ forms/source/component/refvaluecomponent.cxx | 2 +- forms/source/solar/control/navtoolbar.cxx | 2 +- forms/source/xforms/datatypes.cxx | 2 +- forms/source/xforms/model.cxx | 2 +- forms/source/xforms/model_ui.cxx | 8 ++++---- package/source/zipapi/ZipOutputStream.cxx | 10 +++++----- 32 files changed, 73 insertions(+), 73 deletions(-) diff --git a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx index 5312717034ee..30c300ced2a8 100644 --- a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx +++ b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx @@ -259,7 +259,7 @@ namespace accessibility catch( const Exception& e ) { (void)e; - OSL_ENSURE( false, "EditBrowseBoxTableCellAccess::disposing: caught an exception while disposing the context!" ); + OSL_FAIL( "EditBrowseBoxTableCellAccess::disposing: caught an exception while disposing the context!" ); } } diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index f3b209d419bc..2d0b0b5d20fe 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -2003,7 +2003,7 @@ void Document::handleParagraphNotifications() break; } default: - OSL_ENSURE(false, "bad buffered hint"); + OSL_FAIL( "bad buffered hint"); break; } } diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx index a5b441cdb1ab..962f70254d72 100644 --- a/basctl/source/basicide/basobj2.cxx +++ b/basctl/source/basicide/basobj2.cxx @@ -167,7 +167,7 @@ bool RenameModule( Window* pErrorParent, const ScriptDocument& rDocument, const { if ( !rDocument.hasModule( rLibName, rOldName ) ) { - OSL_ENSURE( false, "BasicIDE::RenameModule: old module name is invalid!" ); + OSL_FAIL( "BasicIDE::RenameModule: old module name is invalid!" ); return false; } @@ -300,7 +300,7 @@ bool RenameModule( Window* pErrorParent, const ScriptDocument& rDocument, const xLimitToDocument.set( xScripts, UNO_QUERY ); if ( !xLimitToDocument.is() ) { - OSL_ENSURE( false, "BasicIDE::ChooseMacro: a script container which is no document!?" ); + OSL_FAIL( "BasicIDE::ChooseMacro: a script container which is no document!?" ); xLimitToDocument = rxLimitToDocument; } } diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx index 1bf6081c6f0c..42a6cd37f159 100644 --- a/basctl/source/basicide/basobj3.cxx +++ b/basctl/source/basicide/basobj3.cxx @@ -178,7 +178,7 @@ bool RenameDialog( Window* pErrorParent, const ScriptDocument& rDocument, const { if ( !rDocument.hasDialog( rLibName, rOldName ) ) { - OSL_ENSURE( false, "BasicIDE::RenameDialog: old module name is invalid!" ); + OSL_FAIL( "BasicIDE::RenameDialog: old module name is invalid!" ); return false; } diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx index 069fb87d9b82..5bb34af6a2fa 100644 --- a/basctl/source/basicide/scriptdocument.cxx +++ b/basctl/source/basicide/scriptdocument.cxx @@ -1134,7 +1134,7 @@ namespace basctl } } - OSL_ENSURE( false, "ScriptDocument::getDocumentForBasicManager: did not find a document for this manager!" ); + OSL_FAIL( "ScriptDocument::getDocumentForBasicManager: did not find a document for this manager!" ); return ScriptDocument( NoDocument ); } diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 3f26f09d9761..fe6dbf5da750 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -542,7 +542,7 @@ void _SvxMacroTabPage::DisplayAppEvents( bool appEvents) EventsHash::iterator h_it = eventsHash->find( sEventName ); if( h_it == eventsHash->end() ) { - OSL_ENSURE( false, "_SvxMacroTabPage::DisplayAppEvents: something's suspicious here!" ); + OSL_FAIL( "_SvxMacroTabPage::DisplayAppEvents: something's suspicious here!" ); continue; } diff --git a/extensions/source/config/ldap/ldapaccess.cxx b/extensions/source/config/ldap/ldapaccess.cxx index 0d50f32ce945..a99ac7e18f6c 100644 --- a/extensions/source/config/ldap/ldapaccess.cxx +++ b/extensions/source/config/ldap/ldapaccess.cxx @@ -269,7 +269,7 @@ void LdapConnection::initConnection() } else { - OSL_ENSURE( false, "LdapConnection::findUserDn-could not get DN for User "); + OSL_FAIL( "LdapConnection::findUserDn-could not get DN for User "); } return userDn ; diff --git a/extensions/source/logging/filehandler.cxx b/extensions/source/logging/filehandler.cxx index e0680441a85a..8aef979c00c1 100644 --- a/extensions/source/logging/filehandler.cxx +++ b/extensions/source/logging/filehandler.cxx @@ -208,7 +208,7 @@ namespace logging sMessage.append( ::rtl::OString( m_sFileURL.getStr(), m_sFileURL.getLength(), osl_getThreadTextEncoding() ) ); sMessage.append( "\nerror code: " ); sMessage.append( (sal_Int32)res ); - OSL_ENSURE( false, sMessage.makeStringAndClear() ); + OSL_FAIL( sMessage.makeStringAndClear() ); } #endif if ( m_eFileValidity == eValid ) diff --git a/extensions/source/plugin/aqua/sysplug.cxx b/extensions/source/plugin/aqua/sysplug.cxx index 6b4c93202b85..4d9bf9fa32ce 100644 --- a/extensions/source/plugin/aqua/sysplug.cxx +++ b/extensions/source/plugin/aqua/sysplug.cxx @@ -488,11 +488,11 @@ long MacPluginComm::doIt() break; case eNPP_Initialize: TRACE( "eNPP_Initialize" ); - OSL_ENSURE( false, "NPP_Initialize: not implemented!" ); + OSL_FAIL( "NPP_Initialize: not implemented!" ); break; case eNPP_GetJavaClass: TRACE( "eNPP_GetJavaClass" ); - OSL_ENSURE( false, "NPP_GetJavaClass: not implemented!" ); + OSL_FAIL( "NPP_GetJavaClass: not implemented!" ); break; } return nRet; diff --git a/extensions/source/plugin/win/sysplug.cxx b/extensions/source/plugin/win/sysplug.cxx index 59e62c15188d..a65ff1b5e766 100644 --- a/extensions/source/plugin/win/sysplug.cxx +++ b/extensions/source/plugin/win/sysplug.cxx @@ -271,11 +271,11 @@ long PluginComm_Impl::doIt() break; case eNPP_Initialize: TRACE( "eNPP_Initialize" ); - OSL_ENSURE( false, "NPP_Initialize: not implemented!" ); + OSL_FAIL( "NPP_Initialize: not implemented!" ); break; case eNPP_GetJavaClass: TRACE( "eNPP_GetJavaClass" ); - OSL_ENSURE( false, "NPP_GetJavaClass: not implemented!" ); + OSL_FAIL( "NPP_GetJavaClass: not implemented!" ); break; } return nRet; diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx index 5ea742fb4bf9..97af90f577a7 100644 --- a/extensions/source/propctrlr/browserlistbox.cxx +++ b/extensions/source/propctrlr/browserlistbox.cxx @@ -1264,7 +1264,7 @@ namespace pcr m_aOrderedLines[ nFocusControlPos ]->second.pLine->GrabFocus(); } else - OSL_ENSURE( false, "OBrowserListBox::PreNotify: internal error, invalid focus control position!" ); + OSL_FAIL( "OBrowserListBox::PreNotify: internal error, invalid focus control position!" ); } } diff --git a/extensions/source/propctrlr/composeduiupdate.cxx b/extensions/source/propctrlr/composeduiupdate.cxx index f78349c651e5..e7b8c072438a 100644 --- a/extensions/source/propctrlr/composeduiupdate.cxx +++ b/extensions/source/propctrlr/composeduiupdate.cxx @@ -374,7 +374,7 @@ namespace pcr //-------------------------------------------------------------------- void SAL_CALL CachedInspectorUI::registerControlObserver( const Reference< XPropertyControlObserver >& _Observer ) throw (RuntimeException) { - OSL_ENSURE( false, "CachedInspectorUI::registerControlObserver: not expected to be called!" ); + OSL_FAIL( "CachedInspectorUI::registerControlObserver: not expected to be called!" ); // CachedInspectorUI is used as context for the controls, and we don't expect them to // register listeners themself m_rMaster.getDelegatorUI()->registerControlObserver( _Observer ); @@ -383,7 +383,7 @@ namespace pcr //-------------------------------------------------------------------- void SAL_CALL CachedInspectorUI::revokeControlObserver( const Reference< XPropertyControlObserver >& _Observer ) throw (RuntimeException) { - OSL_ENSURE( false, "CachedInspectorUI::revokeControlObserver: not expected to be called!" ); + OSL_FAIL( "CachedInspectorUI::revokeControlObserver: not expected to be called!" ); // CachedInspectorUI is used as context for the controls, and we don't expect them to // register listeners themself m_rMaster.getDelegatorUI()->revokeControlObserver( _Observer ); diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 3344a8a62c8b..9fa37ded4217 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -618,7 +618,7 @@ namespace pcr case 1: nWritingMode = WritingMode2::RL_TB; break; case 2: nWritingMode = WritingMode2::CONTEXT; break; default: - OSL_ENSURE( false, "FormComponentPropertyHandler::convertToPropertyValue: unexpected 'normalized value' for WritingMode!" ); + OSL_FAIL( "FormComponentPropertyHandler::convertToPropertyValue: unexpected 'normalized value' for WritingMode!" ); nWritingMode = WritingMode2::CONTEXT; break; } @@ -754,7 +754,7 @@ namespace pcr case WritingMode2::RL_TB: nNormalized = 1; break; case WritingMode2::CONTEXT: nNormalized = 2; break; default: - OSL_ENSURE( false, "FormComponentPropertyHandler::convertToControlValue: unsupported API value for WritingMode!" ); + OSL_FAIL( "FormComponentPropertyHandler::convertToControlValue: unsupported API value for WritingMode!" ); nNormalized = 2; break; } @@ -2015,7 +2015,7 @@ namespace pcr break; default: - OSL_ENSURE( false, "FormComponentPropertyHandler::impl_updateDependentProperty_nothrow: unexpected property to update!" ); + OSL_FAIL( "FormComponentPropertyHandler::impl_updateDependentProperty_nothrow: unexpected property to update!" ); break; } // switch @@ -3140,7 +3140,7 @@ namespace pcr return sValue; } - OSL_ENSURE( false, "ValueListCommandUI::getSQLCommand: unexpected property type!" ); + OSL_FAIL( "ValueListCommandUI::getSQLCommand: unexpected property type!" ); return sValue; } @@ -3215,7 +3215,7 @@ namespace pcr xCommandUI = new ValueListCommandUI( xComponentProperties ); break; default: - OSL_ENSURE( false, "FormComponentPropertyHandler::OnDesignerClosed: invalid property id!" ); + OSL_FAIL( "FormComponentPropertyHandler::OnDesignerClosed: invalid property id!" ); return false; } @@ -3296,7 +3296,7 @@ namespace pcr } catch( const Exception& ) { - OSL_ENSURE( false, "FormComponentPropertyHandler::impl_hasValidDataSourceSignature_nothrow: caught an exception!" ); + OSL_FAIL( "FormComponentPropertyHandler::impl_hasValidDataSourceSignature_nothrow: caught an exception!" ); } } return bHas; diff --git a/extensions/source/propctrlr/formgeometryhandler.cxx b/extensions/source/propctrlr/formgeometryhandler.cxx index 209b466cfe9f..d93f023e4add 100644 --- a/extensions/source/propctrlr/formgeometryhandler.cxx +++ b/extensions/source/propctrlr/formgeometryhandler.cxx @@ -376,7 +376,7 @@ namespace pcr break; default: - OSL_ENSURE( false, "FormGeometryHandler::getPropertyValue: huh?" ); + OSL_FAIL( "FormGeometryHandler::getPropertyValue: huh?" ); break; } } @@ -443,7 +443,7 @@ namespace pcr break; default: - OSL_ENSURE( false, "FormGeometryHandler::getPropertyValue: huh?" ); + OSL_FAIL( "FormGeometryHandler::getPropertyValue: huh?" ); break; } } @@ -491,7 +491,7 @@ namespace pcr break; default: - OSL_ENSURE( false, "FormGeometryHandler::describePropertyLine: huh?" ); + OSL_FAIL( "FormGeometryHandler::describePropertyLine: huh?" ); break; } } @@ -547,7 +547,7 @@ namespace pcr } break; default: - OSL_ENSURE( false, "FormGeometryHandler::actuatingPropertyChanged: not registered for this property!" ); + OSL_FAIL( "FormGeometryHandler::actuatingPropertyChanged: not registered for this property!" ); break; } } @@ -706,7 +706,7 @@ namespace pcr break; default: - OSL_ENSURE( false, "FormGeometryHandler::impl_setSheetAnchorType_nothrow: illegal anchor type!" ); + OSL_FAIL( "FormGeometryHandler::impl_setSheetAnchorType_nothrow: illegal anchor type!" ); break; } } diff --git a/extensions/source/propctrlr/genericpropertyhandler.cxx b/extensions/source/propctrlr/genericpropertyhandler.cxx index f273f948e0e4..2c684db31bcc 100644 --- a/extensions/source/propctrlr/genericpropertyhandler.cxx +++ b/extensions/source/propctrlr/genericpropertyhandler.cxx @@ -516,7 +516,7 @@ namespace pcr } catch( const UnknownPropertyException& ) { - OSL_ENSURE( false, "GenericPropertyHandler::addPropertyChangeListener:\nThe inspected component does not allow registering for all properties at once! This violates the interface contract!" ); + OSL_FAIL( "GenericPropertyHandler::addPropertyChangeListener:\nThe inspected component does not allow registering for all properties at once! This violates the interface contract!" ); } } } @@ -533,7 +533,7 @@ namespace pcr } catch( const UnknownPropertyException& ) { - OSL_ENSURE( false, "GenericPropertyHandler::removePropertyChangeListener:\nThe inspected component does not allow de-registering for all properties at once! This violates the interface contract!" ); + OSL_FAIL( "GenericPropertyHandler::removePropertyChangeListener:\nThe inspected component does not allow de-registering for all properties at once! This violates the interface contract!" ); } } m_aPropertyListeners.removeInterface( _rxListener ); diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx index 2499e9aaa360..13e50d559e49 100644 --- a/extensions/source/propctrlr/propcontroller.cxx +++ b/extensions/source/propctrlr/propcontroller.cxx @@ -1257,7 +1257,7 @@ namespace pcr ::rtl::OString sMessage( "OPropertyBrowserController::UpdateUI: empty category provided for property '" ); sMessage += ::rtl::OString( property->second.Name.getStr(), property->second.Name.getLength(), osl_getThreadTextEncoding() ); sMessage += "'!"; - OSL_ENSURE( false, sMessage ); + OSL_FAIL( sMessage ); } #endif // finally insert this property control @@ -1365,7 +1365,7 @@ namespace pcr // also okay, we expect that the handler has disabled the UI as necessary break; default: - OSL_ENSURE( false, "OPropertyBrowserController::Clicked: unknown result value!" ); + OSL_FAIL( "OPropertyBrowserController::Clicked: unknown result value!" ); break; } } diff --git a/extensions/source/propctrlr/propertycomposer.cxx b/extensions/source/propctrlr/propertycomposer.cxx index 4f88c2a0bed9..d8b97c0c9faf 100644 --- a/extensions/source/propctrlr/propertycomposer.cxx +++ b/extensions/source/propctrlr/propertycomposer.cxx @@ -355,7 +355,7 @@ namespace pcr case InteractiveSelectionResult_Success: case InteractiveSelectionResult_Pending: - OSL_ENSURE( false, "PropertyComposer::onInteractivePropertySelection: no chance to forward the new value to the other handlers!" ); + OSL_FAIL( "PropertyComposer::onInteractivePropertySelection: no chance to forward the new value to the other handlers!" ); // This means that we cannot know the new property value, which either has already been set // at the first component ("Success"), or will be set later on once the asynchronous input // is finished ("Pending"). So, we also cannot forward this new property value to the other @@ -372,7 +372,7 @@ namespace pcr break; default: - OSL_ENSURE( false, "OPropertyBrowserController::onInteractivePropertySelection: unknown result value!" ); + OSL_FAIL( "OPropertyBrowserController::onInteractivePropertySelection: unknown result value!" ); break; } diff --git a/extensions/source/propctrlr/stringrepresentation.cxx b/extensions/source/propctrlr/stringrepresentation.cxx index 0fbcc391b799..318b14293d6f 100644 --- a/extensions/source/propctrlr/stringrepresentation.cxx +++ b/extensions/source/propctrlr/stringrepresentation.cxx @@ -428,7 +428,7 @@ bool StringRepresentation::convertGenericValueToString( const uno::Any& _rValue, // some structs case uno::TypeClass_STRUCT: - OSL_ENSURE( false, "StringRepresentation::convertGenericValueToString(STRUCT): this is dead code - isn't it?" ); + OSL_FAIL( "StringRepresentation::convertGenericValueToString(STRUCT): this is dead code - isn't it?" ); if ( _rValue.getValueType().equals( ::getCppuType( static_cast< util::Date* >( NULL ) ) ) ) { // weird enough, the string representation of dates, as used @@ -572,7 +572,7 @@ bool StringRepresentation::convertStringToGenericValue( const ::rtl::OUString& _ break; case uno::TypeClass_STRUCT: - OSL_ENSURE( false, "StringRepresentation::convertStringToGenericValue(STRUCT): this is dead code - isn't it?" ); + OSL_FAIL( "StringRepresentation::convertStringToGenericValue(STRUCT): this is dead code - isn't it?" ); if ( _rTargetType.equals( ::getCppuType( static_cast< util::Date* >( NULL ) ) ) ) { // weird enough, the string representation of dates, as used diff --git a/extensions/source/resource/oooresourceloader.cxx b/extensions/source/resource/oooresourceloader.cxx index ff87b3d51724..ee5cc2a0ea3f 100644 --- a/extensions/source/resource/oooresourceloader.cxx +++ b/extensions/source/resource/oooresourceloader.cxx @@ -447,7 +447,7 @@ namespace res Sequence< ::rtl::OUString > SAL_CALL OpenOfficeResourceBundle::getElementNames( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - OSL_ENSURE( false, "OpenOfficeResourceBundle::getElementNames: not implemented!" ); + OSL_FAIL( "OpenOfficeResourceBundle::getElementNames: not implemented!" ); // the (Simple)ResManager does not provide an API to enumerate the resources return Sequence< ::rtl::OUString >( ); } @@ -478,7 +478,7 @@ namespace res ::sal_Bool SAL_CALL OpenOfficeResourceBundle::hasElements( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - OSL_ENSURE( false, "OpenOfficeResourceBundle::hasElements: not implemented!" ); + OSL_FAIL( "OpenOfficeResourceBundle::hasElements: not implemented!" ); // the (Simple)ResManager does not provide an API to enumerate the resources return ::sal_Bool( ); } diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index 364d975c537a..0e08d417bcd7 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -379,7 +379,7 @@ void SAL_CALL UpdateHandler::actionPerformed( awt::ActionEvent const & rEvent ) case HELP_BUTTON: break; default: - OSL_ENSURE( false, "UpdateHandler::actionPerformed: unknown command!" ); + OSL_FAIL( "UpdateHandler::actionPerformed: unknown command!" ); } } @@ -649,7 +649,7 @@ rtl::OUString UpdateHandler::loadString( const uno::Reference< resource::XResour } catch( const uno::Exception& ) { - OSL_ENSURE( false, "UpdateHandler::loadString: caught an exception!" ); + OSL_FAIL( "UpdateHandler::loadString: caught an exception!" ); sString = UNISTRING("Missing ") + sKey; } @@ -685,7 +685,7 @@ void UpdateHandler::loadStrings() } catch( const uno::Exception& ) { - OSL_ENSURE( false, "UpdateHandler::loadStrings: could not create the resource loader!" ); + OSL_FAIL( "UpdateHandler::loadStrings: could not create the resource loader!" ); } if ( !xLoader.is() ) return; @@ -698,7 +698,7 @@ void UpdateHandler::loadStrings() } catch( const resource::MissingResourceException& ) { - OSL_ENSURE( false, "UpdateHandler::loadStrings: missing the resource bundle!" ); + OSL_FAIL( "UpdateHandler::loadStrings: missing the resource bundle!" ); } if ( !xBundle.is() ) return; @@ -791,7 +791,7 @@ void UpdateHandler::setControlProperty( const rtl::OUString &rCtrlName, } catch( const beans::UnknownPropertyException& ) { - OSL_ENSURE( false, "UpdateHandler::setControlProperty: caught an exception!" ); + OSL_FAIL( "UpdateHandler::setControlProperty: caught an exception!" ); } } @@ -802,7 +802,7 @@ void UpdateHandler::showControl( const rtl::OUString &rCtrlName, bool bShow ) if ( !xContainer.is() ) { - OSL_ENSURE( false, "UpdateHandler::showControl: could not get control container!" ); + OSL_FAIL( "UpdateHandler::showControl: could not get control container!" ); return; } @@ -818,7 +818,7 @@ void UpdateHandler::focusControl( DialogControls eID ) if ( !xContainer.is() ) { - OSL_ENSURE( false, "UpdateHandler::focusControl: could not get control container!" ); + OSL_FAIL( "UpdateHandler::focusControl: could not get control container!" ); return; } diff --git a/extensions/source/update/check/updateprotocol.cxx b/extensions/source/update/check/updateprotocol.cxx index 9ba37b67308c..7de4681b9d62 100644 --- a/extensions/source/update/check/updateprotocol.cxx +++ b/extensions/source/update/check/updateprotocol.cxx @@ -282,7 +282,7 @@ bool checkForExtensionUpdates( const uno::Reference< uno::XComponentContext > & } catch( const uno::Exception& ) { - OSL_ENSURE( false, "checkForExtensionUpdates: could not create the PackageInformationProvider!" ); + OSL_FAIL( "checkForExtensionUpdates: could not create the PackageInformationProvider!" ); } if ( !xInfoProvider.is() ) return false; @@ -308,7 +308,7 @@ bool checkForPendingUpdates( const uno::Reference< uno::XComponentContext > & rx } catch( const uno::Exception& ) { - OSL_ENSURE( false, "checkForExtensionUpdates: could not create the PackageInformationProvider!" ); + OSL_FAIL( "checkForExtensionUpdates: could not create the PackageInformationProvider!" ); } if ( !xInfoProvider.is() ) return false; diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index 4ddf4532f51b..f2c8cbfa2ccf 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -668,7 +668,7 @@ void OComboBoxModel::loadData( bool _bForce ) } break; default: - OSL_ENSURE( false, "OComboBoxModel::loadData: unreachable!" ); + OSL_FAIL( "OComboBoxModel::loadData: unreachable!" ); break; } } diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 53881a3e2ac2..6cf05e78359e 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -992,7 +992,7 @@ Any OControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const if ( m_aPropertyBagHelper.hasDynamicPropertyByHandle( _nHandle ) ) m_aPropertyBagHelper.getDynamicPropertyDefaultByHandle( _nHandle, aReturn ); else - OSL_ENSURE( false, "OControlModel::convertFastPropertyValue: unknown handle!" ); + OSL_FAIL( "OControlModel::convertFastPropertyValue: unknown handle!" ); } return aReturn; } @@ -1050,7 +1050,7 @@ sal_Bool OControlModel::convertFastPropertyValue( if ( m_aPropertyBagHelper.hasDynamicPropertyByHandle( _nHandle ) ) bModified = m_aPropertyBagHelper.convertDynamicFastPropertyValue( _nHandle, _rValue, _rConvertedValue, _rOldValue ); else - OSL_ENSURE( false, "OControlModel::convertFastPropertyValue: unknown handle!" ); + OSL_FAIL( "OControlModel::convertFastPropertyValue: unknown handle!" ); break; } return bModified; @@ -1084,7 +1084,7 @@ void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const A if ( m_aPropertyBagHelper.hasDynamicPropertyByHandle( _nHandle ) ) m_aPropertyBagHelper.setDynamicFastPropertyValue( _nHandle, _rValue ); else - OSL_ENSURE( false, "OControlModel::setFastPropertyValue_NoBroadcast: unknown handle!" ); + OSL_FAIL( "OControlModel::setFastPropertyValue_NoBroadcast: unknown handle!" ); break; } } diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index 7fdb83591834..274e77fbd407 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -256,7 +256,7 @@ Reference< XRowSet > SAL_CALL OGridControlModel::getRowSet( ) throw (RuntimeExc //------------------------------------------------------------------------------ void SAL_CALL OGridControlModel::setRowSet( const Reference< XRowSet >& /*_rxDataSource*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "OGridControlModel::setRowSet: not supported!" ); + OSL_FAIL( "OGridControlModel::setRowSet: not supported!" ); } //-------------------------------------------------------------------- diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index e11ace8dd091..23cb10bd064e 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -488,7 +488,7 @@ sal_Bool OImageControlModel::impl_handleNewImageURL_lck( ValueChangeInstigator _ break; case ImageStoreInvalid: - OSL_ENSURE( false, "OImageControlModel::impl_handleNewImageURL_lck: image storage type type!" ); + OSL_FAIL( "OImageControlModel::impl_handleNewImageURL_lck: image storage type type!" ); break; } @@ -588,7 +588,7 @@ Any OImageControlModel::translateDbColumnToControlValue() return makeAny( sImageLink ); } case ImageStoreInvalid: - OSL_ENSURE( false, "OImageControlModel::translateDbColumnToControlValue: invalid field type!" ); + OSL_FAIL( "OImageControlModel::translateDbColumnToControlValue: invalid field type!" ); break; } return Any(); @@ -630,7 +630,7 @@ void OImageControlModel::doSetControlValue( const Any& _rValue ) break; case ImageStoreInvalid: - OSL_ENSURE( false, "OImageControlModel::doSetControlValue: invalid field type!" ); + OSL_FAIL( "OImageControlModel::doSetControlValue: invalid field type!" ); break; } // switch ( lcl_getImageStoreType( getFieldType() ) ) diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index 213f58558a6f..ac56e7fd8395 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -339,7 +339,7 @@ namespace frm break; case PROPERTY_ID_VALUE_SEQ : - OSL_ENSURE( false, "ValueItemList is read-only!" ); + OSL_FAIL( "ValueItemList is read-only!" ); throw PropertyVetoException(); case PROPERTY_ID_DEFAULT_SELECT_SEQ : @@ -390,7 +390,7 @@ namespace frm break; case PROPERTY_ID_VALUE_SEQ : - OSL_ENSURE( false, "ValueItemList is read-only!" ); + OSL_FAIL( "ValueItemList is read-only!" ); throw PropertyVetoException(); case PROPERTY_ID_DEFAULT_SELECT_SEQ : @@ -894,7 +894,7 @@ namespace frm } break; default: - OSL_ENSURE( false, "OListBoxModel::loadData: unreachable!" ); + OSL_FAIL( "OListBoxModel::loadData: unreachable!" ); break; } } @@ -996,7 +996,7 @@ namespace frm size_t selectedValue = aSelectedIndices[0]; if ( selectedValue >= aValues.size() ) { - OSL_ENSURE( false, "OListBoxModel::getFirstSelectedValue: inconsistent selection/valuelist!" ); + OSL_FAIL( "OListBoxModel::getFirstSelectedValue: inconsistent selection/valuelist!" ); return s_aEmptyVaue; } @@ -1035,7 +1035,7 @@ namespace frm Reference< XPropertySet > xBoundField( getField() ); if ( !xBoundField.is() ) { - OSL_ENSURE( false, "OListBoxModel::translateDbColumnToControlValue: no field? How could that happen?!" ); + OSL_FAIL( "OListBoxModel::translateDbColumnToControlValue: no field? How could that happen?!" ); return Any(); } @@ -1143,7 +1143,7 @@ namespace frm default: break; } - OSL_ENSURE( false, "lcl_getCurrentExchangeType: unsupported (unexpected) exchange type!" ); + OSL_FAIL( "lcl_getCurrentExchangeType: unsupported (unexpected) exchange type!" ); return eEntry; } } diff --git a/forms/source/component/refvaluecomponent.cxx b/forms/source/component/refvaluecomponent.cxx index ab32ff5bcce3..9fdf49d5117d 100644 --- a/forms/source/component/refvaluecomponent.cxx +++ b/forms/source/component/refvaluecomponent.cxx @@ -218,7 +218,7 @@ namespace frm } else { - OSL_ENSURE( false, "OReferenceValueComponent::translateExternalValueToControlValue: unexpected value type!" ); + OSL_FAIL( "OReferenceValueComponent::translateExternalValueToControlValue: unexpected value type!" ); } return makeAny( nState ); diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index b1c6f0d3a588..b408b7052578 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -102,7 +102,7 @@ namespace frm if ( pAsciiCommandName != NULL ) return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:" ) ) + ::rtl::OUString::createFromAscii( pAsciiCommandName ); - OSL_ENSURE( false, "lcl_getCommandURL: unknown FormFeature!" ); + OSL_FAIL( "lcl_getCommandURL: unknown FormFeature!" ); return ::rtl::OUString(); } } diff --git a/forms/source/xforms/datatypes.cxx b/forms/source/xforms/datatypes.cxx index 329e65b76cc8..c8c76c8d848f 100644 --- a/forms/source/xforms/datatypes.cxx +++ b/forms/source/xforms/datatypes.cxx @@ -503,7 +503,7 @@ namespace xforms break; default: - OSL_ENSURE( false, "OValueLimitedType::_explainInvalid: unknown reason!" ); + OSL_FAIL( "OValueLimitedType::_explainInvalid: unknown reason!" ); break; } diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx index 26074f2a1c6f..e463a4b9e3ad 100644 --- a/forms/source/xforms/model.cxx +++ b/forms/source/xforms/model.cxx @@ -385,7 +385,7 @@ bool Model::setSimpleContent( const XNode_t& xConstNode, default: { - OSL_ENSURE( false, "bound to unknown node type?" ); + OSL_FAIL( "bound to unknown node type?" ); } break; diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx index f78bccfea00b..1ed98a49a709 100644 --- a/forms/source/xforms/model_ui.cxx +++ b/forms/source/xforms/model_ui.cxx @@ -257,7 +257,7 @@ OUString Model::getDefaultBindingExpressionForNode( default: // unknown type? fail! - OSL_ENSURE( false, "unknown node type!" ); + OSL_FAIL( "unknown node type!" ); xCurrent.set( NULL ); aBuffer.makeStringAndClear(); // we'll remove the slash below @@ -332,7 +332,7 @@ OUString Model::getNodeDisplayName( const XNode_t& xNode, default: // unknown type? fail! - OSL_ENSURE( false, "unknown node type!" ); + OSL_FAIL( "unknown node type!" ); break; } @@ -355,7 +355,7 @@ OUString Model::getNodeName( const XNode_t& xNode ) case NodeType_DOCUMENT_NODE: default: // unknown type? fail! - OSL_ENSURE( false, "no name for this node type!" ); + OSL_FAIL( "no name for this node type!" ); break; } @@ -684,7 +684,7 @@ Model::XNode_t Model::renameNode( const XNode_t& xNode, } else { - OSL_ENSURE( false, "can't rename this node type" ); + OSL_FAIL( "can't rename this node type" ); } // adjust bindings (if necessary): diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx index 1ba30b2cb3d3..4e08b7e8520d 100644 --- a/package/source/zipapi/ZipOutputStream.cxx +++ b/package/source/zipapi/ZipOutputStream.cxx @@ -129,7 +129,7 @@ void SAL_CALL ZipOutputStream::closeEntry( ) { if (pEntry->nSize != aDeflater.getTotalIn()) { - OSL_ENSURE(false,"Invalid entry size"); + OSL_FAIL("Invalid entry size"); } if (pEntry->nCompressedSize != aDeflater.getTotalOut()) { @@ -139,7 +139,7 @@ void SAL_CALL ZipOutputStream::closeEntry( ) } if (pEntry->nCrc != aCRC.getValue()) { - OSL_ENSURE(false,"Invalid entry CRC-32"); + OSL_FAIL("Invalid entry CRC-32"); } } else @@ -156,10 +156,10 @@ void SAL_CALL ZipOutputStream::closeEntry( ) break; case STORED: if (!((pEntry->nFlag & 8) == 0)) - OSL_ENSURE ( false, "Serious error, one of compressed size, size or CRC was -1 in a STORED stream"); + OSL_FAIL( "Serious error, one of compressed size, size or CRC was -1 in a STORED stream"); break; default: - OSL_ENSURE(false,"Invalid compression method"); + OSL_FAIL("Invalid compression method"); break; } @@ -230,7 +230,7 @@ void SAL_CALL ZipOutputStream::finish( ) closeEntry(); if (aZipList.size() < 1) - OSL_ENSURE(false,"Zip file must have at least one entry!\n"); + OSL_FAIL("Zip file must have at least one entry!\n"); sal_Int32 nOffset= static_cast < sal_Int32 > (aChucker.GetPosition()); for (sal_Int32 i =0, nEnd = aZipList.size(); i < nEnd; i++) -- cgit v1.2.3