diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2011-03-12 11:43:16 +0100 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2011-03-12 14:12:37 +0100 |
commit | 1f635676ccfa3bbbaafb98df9bb6de8c51a29b6a (patch) | |
tree | 5fec68ba449329d90216402443627384d5a68043 | |
parent | e01652f342aea58c7323e8e98f155706d3785972 (diff) |
Move OSL_ENSURE(false,...) to OSL_FAIL(...)
83 files changed, 210 insertions, 222 deletions
diff --git a/binfilter/bf_forms/source/component/forms_Filter.cxx b/binfilter/bf_forms/source/component/forms_Filter.cxx index b9422184f..96c3f2449 100644 --- a/binfilter/bf_forms/source/component/forms_Filter.cxx +++ b/binfilter/bf_forms/source/component/forms_Filter.cxx @@ -510,7 +510,7 @@ namespace frm //--------------------------------------------------------------------- sal_Bool SAL_CALL OFilterControl::commit() throw(RuntimeException) { - OSL_ENSURE( false, "OFilterControl::commit: dead code!" ); + OSL_FAIL( "OFilterControl::commit: dead code!" ); return sal_False; } diff --git a/binfilter/bf_forms/source/component/forms_errorbroadcaster.cxx b/binfilter/bf_forms/source/component/forms_errorbroadcaster.cxx index 899b6ebd1..e961c0fc4 100644 --- a/binfilter/bf_forms/source/component/forms_errorbroadcaster.cxx +++ b/binfilter/bf_forms/source/component/forms_errorbroadcaster.cxx @@ -74,7 +74,7 @@ namespace frm //------------------------------------------------------------------------------ void SAL_CALL OErrorBroadcaster::onError( const SQLException& /*_rException*/, const ::rtl::OUString& /*_rContextDescription*/ ) { - OSL_ENSURE( false, "OErrorBroadcaster::onError: dead code!" ); + OSL_FAIL( "OErrorBroadcaster::onError: dead code!" ); } //------------------------------------------------------------------------------ diff --git a/binfilter/bf_sch/source/core/sch_SchAddInCollection.cxx b/binfilter/bf_sch/source/core/sch_SchAddInCollection.cxx index 689e28754..ead6dc8f0 100644 --- a/binfilter/bf_sch/source/core/sch_SchAddInCollection.cxx +++ b/binfilter/bf_sch/source/core/sch_SchAddInCollection.cxx @@ -93,8 +93,7 @@ using namespace ::com::sun::star; /*N*/ } /*N*/ catch( const uno::Exception& aEx ) /*N*/ { -/*N*/ OSL_ENSURE( false, -/*N*/ ::rtl::OUStringToOString( +/*N*/ OSL_FAIL( ::rtl::OUStringToOString( /*N*/ ::rtl::OUString( /*N*/ RTL_CONSTASCII_USTRINGPARAM( /*N*/ "Couldn't initialize add-in collection: " )) + diff --git a/binfilter/bf_sfx2/source/appl/sfx2_imestatuswindow.cxx b/binfilter/bf_sfx2/source/appl/sfx2_imestatuswindow.cxx index 7516dc148..21d9e5987 100644 --- a/binfilter/bf_sfx2/source/appl/sfx2_imestatuswindow.cxx +++ b/binfilter/bf_sfx2/source/appl/sfx2_imestatuswindow.cxx @@ -69,7 +69,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. } @@ -87,7 +87,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/binfilter/bf_svtools/source/config/svt_inetoptions.cxx b/binfilter/bf_svtools/source/config/svt_inetoptions.cxx index 1e3c4f07e..03c3031a9 100644 --- a/binfilter/bf_svtools/source/config/svt_inetoptions.cxx +++ b/binfilter/bf_svtools/source/config/svt_inetoptions.cxx @@ -270,8 +270,7 @@ SvtInetOptions::Impl::Impl(): for (sal_Int32 i = 0; i < ENTRY_COUNT; ++i) aKeys[i] = m_aEntries[i].m_aName; if (!EnableNotification(aKeys)) - OSL_ENSURE(false, - "SvtInetOptions::Impl::Impl(): Bad EnableNotifications()"); + OSL_FAIL("SvtInetOptions::Impl::Impl(): Bad EnableNotifications()"); } //============================================================================ diff --git a/binfilter/bf_sw/source/core/doc/sw_docdraw.cxx b/binfilter/bf_sw/source/core/doc/sw_docdraw.cxx index df84b306b..64b40dea3 100644 --- a/binfilter/bf_sw/source/core/doc/sw_docdraw.cxx +++ b/binfilter/bf_sw/source/core/doc/sw_docdraw.cxx @@ -264,7 +264,7 @@ bool SwDoc::IsVisibleLayerId( const SdrLayerID& _nLayerId ) } else { - OSL_ENSURE( false, "<SwDoc::IsVisibleLayerId(..)> - unknown layer ID." ); + OSL_FAIL( "<SwDoc::IsVisibleLayerId(..)> - unknown layer ID." ); bRetVal = false; } @@ -297,12 +297,12 @@ SdrLayerID SwDoc::GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisible _nInvisibleLayerId == GetHellId() || _nInvisibleLayerId == GetControlsId() ) { - OSL_ENSURE( false, "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID already an invisible one." ); + OSL_FAIL( "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID already an invisible one." ); nVisibleLayerId = _nInvisibleLayerId; } else { - OSL_ENSURE( false, "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID is unknown." ); + OSL_FAIL( "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID is unknown." ); nVisibleLayerId = _nInvisibleLayerId; } @@ -335,12 +335,12 @@ SdrLayerID SwDoc::GetInvisibleLayerIdByVisibleOne( const SdrLayerID& _nVisibleLa _nVisibleLayerId == GetInvisibleHellId() || _nVisibleLayerId == GetInvisibleControlsId() ) { - OSL_ENSURE( false, "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID already an invisible one." ); + OSL_FAIL( "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID already an invisible one." ); nInvisibleLayerId = _nVisibleLayerId; } else { - OSL_ENSURE( false, "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID is unknown." ); + OSL_FAIL( "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID is unknown." ); nInvisibleLayerId = _nVisibleLayerId; } diff --git a/binfilter/bf_sw/source/core/draw/sw_dcontact.cxx b/binfilter/bf_sw/source/core/draw/sw_dcontact.cxx index 790dd6f89..f7faf5fda 100644 --- a/binfilter/bf_sw/source/core/draw/sw_dcontact.cxx +++ b/binfilter/bf_sw/source/core/draw/sw_dcontact.cxx @@ -917,7 +917,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch ) if ( !GetMaster()->IsInserted() ) { // debug assert - OSL_ENSURE( false, "<SwDrawContact::ConnectToLayout(..)> - master drawing object not inserted!?" ); + OSL_FAIL( "<SwDrawContact::ConnectToLayout(..)> - master drawing object not inserted!?" ); pDrawFrmFmt->GetDoc()->GetDrawModel()->GetPage(0)-> InsertObject( GetMaster(), GetMaster()->GetOrdNumDirect() ); diff --git a/binfilter/bf_sw/source/core/layout/sw_calcmove.cxx b/binfilter/bf_sw/source/core/layout/sw_calcmove.cxx index e7b3a896a..6d6fd2acf 100644 --- a/binfilter/bf_sw/source/core/layout/sw_calcmove.cxx +++ b/binfilter/bf_sw/source/core/layout/sw_calcmove.cxx @@ -1571,7 +1571,7 @@ namespace binfilter { /*?*/ // doesn't makes sense. Thus, return TRUE. /*?*/ if ( IsAnFollow( pFrm ) && !pFrm->IsValid() ) /*?*/ { -/*?*/ OSL_ENSURE( false, "Only a warning for task 108824:/n<SwCntntFrm::_WouldFit(..) - follow not valid!" ); +/*?*/ OSL_FAIL( "Only a warning for task 108824:/n<SwCntntFrm::_WouldFit(..) - follow not valid!" ); /*?*/ return TRUE; /*?*/ } /*N*/ } diff --git a/binfilter/bf_sw/source/core/layout/sw_fly.cxx b/binfilter/bf_sw/source/core/layout/sw_fly.cxx index 53067a069..216a628fa 100644 --- a/binfilter/bf_sw/source/core/layout/sw_fly.cxx +++ b/binfilter/bf_sw/source/core/layout/sw_fly.cxx @@ -1612,8 +1612,7 @@ void SwFrm::AppendVirtDrawObj( SwDrawContact* _pDrawContact, { case FLY_AUTO_CNTNT: { - OSL_ENSURE( false, - "<SwFrm::AppendVirtDrawObj(..)> - at character anchored drawing objects aren't supported." ); + OSL_FAIL( "<SwFrm::AppendVirtDrawObj(..)> - at character anchored drawing objects aren't supported." ); } break; case FLY_PAGE: @@ -1635,7 +1634,7 @@ void SwFrm::AppendVirtDrawObj( SwDrawContact* _pDrawContact, /*nothing to do*/; } break; - default: OSL_ENSURE( false, "<SwFrm::AppendVirtDrawObj(..) - unknown anchor type." ); + default: OSL_FAIL( "<SwFrm::AppendVirtDrawObj(..) - unknown anchor type." ); } //Bei der Seite anmelden; kann sein, dass noch keine da ist - die diff --git a/binfilter/bf_sw/source/core/text/sw_porfly.cxx b/binfilter/bf_sw/source/core/text/sw_porfly.cxx index db9809678..31877df9b 100644 --- a/binfilter/bf_sw/source/core/text/sw_porfly.cxx +++ b/binfilter/bf_sw/source/core/text/sw_porfly.cxx @@ -353,7 +353,7 @@ namespace binfilter { /*N*/ pSdrObj = GetDrawContact()->GetDrawObjectByAnchorFrm( rFrm ); /*N*/ if ( !pSdrObj ) /*N*/ { -/*N*/ OSL_ENSURE( false, "SwFlyCntPortion::SetBase(..) - No drawing object found by <GetDrawContact()->GetDrawObjectByAnchorFrm( rFrm )>" ); +/*N*/ OSL_FAIL( "SwFlyCntPortion::SetBase(..) - No drawing object found by <GetDrawContact()->GetDrawObjectByAnchorFrm( rFrm )>" ); /*N*/ pSdrObj = GetDrawContact()->GetMaster(); /*N*/ } /*N*/ aBoundRect = pSdrObj->GetBoundRect(); diff --git a/binfilter/bf_sw/source/core/text/sw_txtfly.cxx b/binfilter/bf_sw/source/core/text/sw_txtfly.cxx index df372d1ce..eb6268be2 100644 --- a/binfilter/bf_sw/source/core/text/sw_txtfly.cxx +++ b/binfilter/bf_sw/source/core/text/sw_txtfly.cxx @@ -136,7 +136,7 @@ namespace binfilter { /*N*/ { /*N*/ // assert, if no anchor frame found at 'virtual' drawing object /*N*/ // and return anchor frame of 'master' drawing object. -/*N*/ OSL_ENSURE( false, "<lcl_TheAnchor(..)> - virtual drawing object with no anchor frame!" ); +/*N*/ OSL_FAIL( "<lcl_TheAnchor(..)> - virtual drawing object with no anchor frame!" ); /*N*/ pRet = pDrawContact->GetAnchor(); /*N*/ } /*N*/ } diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx index bb63f652d..098682918 100644 --- a/filter/source/msfilter/msocximex.cxx +++ b/filter/source/msfilter/msocximex.cxx @@ -198,7 +198,7 @@ GraphicHelper::GraphicHelper( const uno::Reference< frame::XModel >& rxModel ) } catch( uno::Exception& ) { - OSL_ENSURE( false, "GraphicHelper::GraphicHelper - cannot get output device info" ); + OSL_FAIL( "GraphicHelper::GraphicHelper - cannot get output device info" ); } mfPixelPerHmmX = maDeviceInfo.PixelPerMeterX / 100000.0; mfPixelPerHmmY = maDeviceInfo.PixelPerMeterY / 100000.0; diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index 33b744b3b..6831c91f7 100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -551,7 +551,7 @@ void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDesc switch( mxImpl->meDirection ) { case FILTERDIRECTION_UNKNOWN: - OSL_ENSURE( false, "FilterBase::setMediaDescriptor - invalid filter direction" ); + OSL_FAIL( "FilterBase::setMediaDescriptor - invalid filter direction" ); break; case FILTERDIRECTION_IMPORT: mxImpl->maMediaDesc.addInputStream(); diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index aad41b0d5..956ac60e4 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -288,7 +288,7 @@ bool XmlFilterBase::importFragment( const ::rtl::Reference< FragmentHandler >& r } catch( Exception& ) { - OSL_ENSURE( false, OStringBuffer( "XmlFilterBase::importFragment - XML parser failed in fragment '" ). + OSL_FAIL( OStringBuffer( "XmlFilterBase::importFragment - XML parser failed in fragment '" ). append( OUStringToOString( aFragmentPath, RTL_TEXTENCODING_ASCII_US ) ).append( '\'' ).getStr() ); } } diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx index 71ef89f8b..750ed6caf 100644 --- a/oox/source/drawingml/chart/axisconverter.cxx +++ b/oox/source/drawingml/chart/axisconverter.cxx @@ -259,7 +259,7 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo } break; default: - OSL_ENSURE( false, "AxisConverter::convertFromModel - unknown axis type" ); + OSL_FAIL( "AxisConverter::convertFromModel - unknown axis type" ); } /* Do not set a value to the Origin member anymore (already done via @@ -322,7 +322,7 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo } catch( Exception& ) { - OSL_ENSURE( false, "AxisConverter::convertFromModel - cannot insert axis into coordinate system" ); + OSL_FAIL( "AxisConverter::convertFromModel - cannot insert axis into coordinate system" ); } } diff --git a/oox/source/drawingml/chart/chartconverter.cxx b/oox/source/drawingml/chart/chartconverter.cxx index c84a4f976..f5b601bfc 100644 --- a/oox/source/drawingml/chart/chartconverter.cxx +++ b/oox/source/drawingml/chart/chartconverter.cxx @@ -153,7 +153,7 @@ Reference< XDataSequence > ChartConverter::createDataSequence( const Reference< } catch( Exception& ) { - OSL_ENSURE( false, "ExcelChartConverter::createDataSequence - cannot create data sequence" ); + OSL_FAIL( "ExcelChartConverter::createDataSequence - cannot create data sequence" ); } } diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx index 14bcce4a6..e5f3a835b 100644 --- a/oox/source/drawingml/chart/chartdrawingfragment.cxx +++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx @@ -74,13 +74,13 @@ void ShapeAnchor::setPos( sal_Int32 nElement, sal_Int32 nParentContext, const OU pAnchorPos = &maTo; break; default: - OSL_ENSURE( false, "ShapeAnchor::setPos - unexpected parent element" ); + OSL_FAIL( "ShapeAnchor::setPos - unexpected parent element" ); } if( pAnchorPos ) switch( nElement ) { case CDR_TOKEN( x ): pAnchorPos->mfX = rValue.toDouble(); break; case CDR_TOKEN( y ): pAnchorPos->mfY = rValue.toDouble(); break; - default: OSL_ENSURE( false, "ShapeAnchor::setPos - unexpected element" ); + default: OSL_FAIL( "ShapeAnchor::setPos - unexpected element" ); } } diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index 7a49a4607..deb4801f2 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -317,11 +317,11 @@ sal_Int32 lclCalcPosition( sal_Int32 nChartSize, double fPos, sal_Int32 nPosMode case XML_edge: // absolute start position as factor of chart size return getLimitedValue< sal_Int32, double >( nChartSize * fPos + 0.5, 0, nChartSize ); case XML_factor: // position relative to object default position - OSL_ENSURE( false, "lclCalcPosition - relative positioning not supported" ); + OSL_FAIL( "lclCalcPosition - relative positioning not supported" ); return -1; }; - OSL_ENSURE( false, "lclCalcPosition - unknown positioning mode" ); + OSL_FAIL( "lclCalcPosition - unknown positioning mode" ); return -1; } @@ -337,7 +337,7 @@ sal_Int32 lclCalcSize( sal_Int32 nPos, sal_Int32 nChartSize, double fSize, sal_I return nValue - nPos + 1; }; - OSL_ENSURE( false, "lclCalcSize - unknown size mode" ); + OSL_FAIL( "lclCalcSize - unknown size mode" ); return -1; } diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index bbacd369c..8a0305259 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -1178,8 +1178,7 @@ void ObjectFormatter::convertNumberFormat( PropertySet& rPropSet, const NumberFo } catch( Exception& ) { - OSL_ENSURE( false, - OStringBuffer( "ObjectFormatter::convertNumberFormat - cannot create number format '" ). + OSL_FAIL( OStringBuffer( "ObjectFormatter::convertNumberFormat - cannot create number format '" ). append( OUStringToOString( rNumberFormat.maFormatCode, osl_getThreadTextEncoding() ) ).append( '\'' ).getStr() ); } } diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx index cbd60ed16..82fc546cb 100644 --- a/oox/source/drawingml/chart/plotareaconverter.cxx +++ b/oox/source/drawingml/chart/plotareaconverter.cxx @@ -303,7 +303,7 @@ void WallFloorConverter::convertFromModel( const Reference< XDiagram >& rxDiagra { case OBJECTTYPE_FLOOR: aPropSet.set( rxDiagram->getFloor() ); break; case OBJECTTYPE_WALL: aPropSet.set( rxDiagram->getWall() ); break; - default: OSL_ENSURE( false, "WallFloorConverter::convertFromModel - invalid object type" ); + default: OSL_FAIL( "WallFloorConverter::convertFromModel - invalid object type" ); } if( aPropSet.is() ) getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, mrModel.mxPicOptions.getOrCreate(), eObjType ); @@ -440,7 +440,7 @@ void PlotAreaConverter::convertPositionFromModel() xPositioning->setDiagramPositionIncludingAxes( aDiagramRect ); break; default: - OSL_ENSURE( false, "PlotAreaConverter::convertPositionFromModel - unknown positioning target" ); + OSL_FAIL( "PlotAreaConverter::convertPositionFromModel - unknown positioning target" ); } } catch( Exception& ) diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 41f2f1c42..9a2db5d25 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -293,7 +293,7 @@ void ErrorBarConverter::convertFromModel( const Reference< XDataSeries >& rxData aBarProp.setProperty( PROP_ErrorBarStyle, cssc::ErrorBarStyle::STANDARD_ERROR ); break; default: - OSL_ENSURE( false, "ErrorBarConverter::convertFromModel - unknown error bar type" ); + OSL_FAIL( "ErrorBarConverter::convertFromModel - unknown error bar type" ); xErrorBar.clear(); } @@ -307,13 +307,13 @@ void ErrorBarConverter::convertFromModel( const Reference< XDataSeries >& rxData { case XML_x: aSeriesProp.setProperty( PROP_ErrorBarX, xErrorBar ); break; case XML_y: aSeriesProp.setProperty( PROP_ErrorBarY, xErrorBar ); break; - default: OSL_ENSURE( false, "ErrorBarConverter::convertFromModel - invalid error bar direction" ); + default: OSL_FAIL( "ErrorBarConverter::convertFromModel - invalid error bar direction" ); } } } catch( Exception& ) { - OSL_ENSURE( false, "ErrorBarConverter::convertFromModel - error while creating error bars" ); + OSL_FAIL( "ErrorBarConverter::convertFromModel - error while creating error bars" ); } } @@ -385,7 +385,7 @@ void TrendlineConverter::convertFromModel( const Reference< XDataSeries >& rxDat case XML_movingAvg: /* #i66819# moving average trendlines not supported */ break; case XML_poly: /* #i20819# polynomial trendlines not supported */ break; case XML_power: aServiceName = CREATE_OUSTRING( "com.sun.star.chart2.PotentialRegressionCurve" ); break; - default: OSL_ENSURE( false, "TrendlineConverter::convertFromModel - unknown trendline type" ); + default: OSL_FAIL( "TrendlineConverter::convertFromModel - unknown trendline type" ); } if( aServiceName.getLength() > 0 ) { @@ -416,7 +416,7 @@ void TrendlineConverter::convertFromModel( const Reference< XDataSeries >& rxDat } catch( Exception& ) { - OSL_ENSURE( false, "TrendlineConverter::convertFromModel - error while creating trendline" ); + OSL_FAIL( "TrendlineConverter::convertFromModel - error while creating trendline" ); } } diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index b43b626fb..baa7fa3d9 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -171,7 +171,7 @@ TypeGroupConverter::TypeGroupConverter( const ConverterRoot& rParent, TypeGroupM case C_TOKEN( stockChart ): ENSURE_AXESCOUNT( 2, 2 ); eTypeId = TYPEID_STOCK; mb3dChart = false; break; case C_TOKEN( surface3DChart ): ENSURE_AXESCOUNT( 3, 3 ); eTypeId = TYPEID_SURFACE; mb3dChart = true; break; case C_TOKEN( surfaceChart ): ENSURE_AXESCOUNT( 2, 3 ); eTypeId = TYPEID_SURFACE; mb3dChart = true; break; // 3D bar chart from all surface charts - default: OSL_ENSURE( false, "TypeGroupConverter::TypeGroupConverter - unknown chart type" ); + default: OSL_FAIL( "TypeGroupConverter::TypeGroupConverter - unknown chart type" ); #undef ENSURE_AXESCOUNT } @@ -444,7 +444,7 @@ void TypeGroupConverter::convertFromModel( const Reference< XDiagram >& rxDiagra } catch( Exception& ) { - OSL_ENSURE( false, "TypeGroupConverter::convertFromModel - cannot add chart type" ); + OSL_FAIL( "TypeGroupConverter::convertFromModel - cannot add chart type" ); } } @@ -506,7 +506,7 @@ void TypeGroupConverter::convertBarGeometry( PropertySet& rPropSet, sal_Int32 nO case XML_cylinder: nGeom3d = cssc::DataPointGeometry3D::CYLINDER; break; case XML_pyramid: nGeom3d = cssc::DataPointGeometry3D::PYRAMID; break; case XML_pyramidToMax: nGeom3d = cssc::DataPointGeometry3D::PYRAMID; break; - default: OSL_ENSURE( false, "TypeGroupConverter::convertBarGeometry - unknown 3D bar shape type" ); + default: OSL_FAIL( "TypeGroupConverter::convertBarGeometry - unknown 3D bar shape type" ); } rPropSet.setProperty( PROP_Geometry3D, nGeom3d ); } @@ -561,7 +561,7 @@ void TypeGroupConverter::insertDataSeries( const Reference< XChartType >& rxChar } catch( Exception& ) { - OSL_ENSURE( false, "TypeGroupConverter::insertDataSeries - cannot add data series" ); + OSL_FAIL( "TypeGroupConverter::insertDataSeries - cannot add data series" ); } } } diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx index 618e711e4..051414d6f 100644 --- a/oox/source/drawingml/color.cxx +++ b/oox/source/drawingml/color.cxx @@ -592,7 +592,7 @@ void Color::toRgb() const } break; default: - OSL_ENSURE( false, "Color::toRgb - unexpected color mode" ); + OSL_FAIL( "Color::toRgb - unexpected color mode" ); } } @@ -613,7 +613,7 @@ void Color::toCrgb() const // nothing to do break; default: - OSL_ENSURE( false, "Color::toCrgb - unexpected color mode" ); + OSL_FAIL( "Color::toCrgb - unexpected color mode" ); } } @@ -660,7 +660,7 @@ void Color::toHsl() const // nothing to do break; default: - OSL_ENSURE( false, "Color::toHsl - unexpected color mode" ); + OSL_FAIL( "Color::toHsl - unexpected color mode" ); } } diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx index 69e5ac8e1..92382c0f5 100644 --- a/oox/source/drawingml/lineproperties.cxx +++ b/oox/source/drawingml/lineproperties.cxx @@ -112,7 +112,7 @@ void lclConvertPresetDash( LineDash& orLineDash, sal_Int32 nPresetDash ) case XML_sysDashDotDot: lclSetDashData( orLineDash, 2, 1, 1, 3, 1 ); break; default: - OSL_ENSURE( false, "lclConvertPresetDash - unsupported preset dash" ); + OSL_FAIL( "lclConvertPresetDash - unsupported preset dash" ); lclSetDashData( orLineDash, 0, 0, 1, 4, 3 ); } } @@ -126,7 +126,7 @@ void lclConvertCustomDash( LineDash& orLineDash, const LineProperties::DashStopV { if( rCustomDash.empty() ) { - OSL_ENSURE( false, "lclConvertCustomDash - unexpected empty custom dash" ); + OSL_FAIL( "lclConvertCustomDash - unexpected empty custom dash" ); lclSetDashData( orLineDash, 0, 0, 1, 4, 3 ); return; } diff --git a/oox/source/export/ColorPropertySet.cxx b/oox/source/export/ColorPropertySet.cxx index c4212492e..cd00e5670 100644 --- a/oox/source/export/ColorPropertySet.cxx +++ b/oox/source/export/ColorPropertySet.cxx @@ -161,7 +161,7 @@ void SAL_CALL ColorPropertySet::addPropertyChangeListener( const OUString& /* aP lang::WrappedTargetException, uno::RuntimeException) { - OSL_ENSURE( false, "Not Implemented" ); + OSL_FAIL( "Not Implemented" ); return; } @@ -170,7 +170,7 @@ void SAL_CALL ColorPropertySet::removePropertyChangeListener( const OUString& /* lang::WrappedTargetException, uno::RuntimeException) { - OSL_ENSURE( false, "Not Implemented" ); + OSL_FAIL( "Not Implemented" ); return; } @@ -179,7 +179,7 @@ void SAL_CALL ColorPropertySet::addVetoableChangeListener( const OUString& /* Pr lang::WrappedTargetException, uno::RuntimeException) { - OSL_ENSURE( false, "Not Implemented" ); + OSL_FAIL( "Not Implemented" ); return; } @@ -188,7 +188,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/oox/source/export/SchXMLSeriesHelper.cxx b/oox/source/export/SchXMLSeriesHelper.cxx index f780af389..d9a92644d 100644 --- a/oox/source/export/SchXMLSeriesHelper.cxx +++ b/oox/source/export/SchXMLSeriesHelper.cxx @@ -81,7 +81,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: " )) + @@ -218,7 +218,7 @@ Reference< chart2::XDataSeries > SchXMLSeriesHelper::getFirstCandleStickSeries( } catch( const uno::Exception & ) { - OSL_ENSURE( false, "Exception caught" ); + OSL_FAIL( "Exception caught" ); } return xResult; } diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 213fa4511..a5ed5a7d6 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -219,7 +219,7 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Referen catch( uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught. Type: " )) + OUString::createFromAscii( typeid( ex ).name()) + OUString( RTL_CONSTASCII_USTRINGPARAM( ", Message: " )) + @@ -337,7 +337,7 @@ bool lcl_isSeriesAttachedToFirstAxis( catch( uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught. Type: " )) + OUString::createFromAscii( typeid( ex ).name()) + OUString( RTL_CONSTASCII_USTRINGPARAM( ", Message: " )) + @@ -814,7 +814,7 @@ void ChartExport::InitRangeSegmentationProperties( const Reference< chart2::XCha catch( uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught. Type: " )) + OUString::createFromAscii( typeid( ex ).name()) + OUString( RTL_CONSTASCII_USTRINGPARAM( ", Message: " )) + diff --git a/oox/source/helper/binaryinputstream.cxx b/oox/source/helper/binaryinputstream.cxx index 9c77ced66..4549b26bc 100644 --- a/oox/source/helper/binaryinputstream.cxx +++ b/oox/source/helper/binaryinputstream.cxx @@ -204,7 +204,7 @@ void BinaryXInputStream::close() } catch( Exception& ) { - OSL_ENSURE( false, "BinaryXInputStream::close - closing input stream failed" ); + OSL_FAIL( "BinaryXInputStream::close - closing input stream failed" ); } } diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx index 6711a12a7..1e9702299 100644 --- a/oox/source/helper/binaryoutputstream.cxx +++ b/oox/source/helper/binaryoutputstream.cxx @@ -73,7 +73,7 @@ void BinaryXOutputStream::writeData( const StreamDataSequence& rData ) } catch( Exception& ) { - OSL_ENSURE( false, "BinaryXOutputStream::writeData - stream read error" ); + OSL_FAIL( "BinaryXOutputStream::writeData - stream read error" ); } } @@ -104,7 +104,7 @@ void BinaryXOutputStream::close() } catch( Exception& ) { - OSL_ENSURE( false, "BinaryXOutputStream::close - closing output stream failed" ); + OSL_FAIL( "BinaryXOutputStream::close - closing output stream failed" ); } } diff --git a/oox/source/helper/binarystreambase.cxx b/oox/source/helper/binarystreambase.cxx index 93f6919dd..2570a8764 100644 --- a/oox/source/helper/binarystreambase.cxx +++ b/oox/source/helper/binarystreambase.cxx @@ -102,7 +102,7 @@ sal_Int64 BinaryXSeekableStream::getLength() const } catch( Exception& ) { - OSL_ENSURE( false, "BinaryXSeekableStream::getLength - exception caught" ); + OSL_FAIL( "BinaryXSeekableStream::getLength - exception caught" ); } return -1; } @@ -115,7 +115,7 @@ sal_Int64 BinaryXSeekableStream::tell() const } catch( Exception& ) { - OSL_ENSURE( false, "BinaryXSeekableStream::tell - exception caught" ); + OSL_FAIL( "BinaryXSeekableStream::tell - exception caught" ); } return -1; } diff --git a/oox/source/helper/containerhelper.cxx b/oox/source/helper/containerhelper.cxx index 7d02ae95e..9b1b8129f 100644 --- a/oox/source/helper/containerhelper.cxx +++ b/oox/source/helper/containerhelper.cxx @@ -152,7 +152,7 @@ OUString ContainerHelper::insertByUnusedName( } catch( Exception& ) { - OSL_ENSURE( false, "ContainerHelper::insertByUnusedName - cannot rename old object" ); + OSL_FAIL( "ContainerHelper::insertByUnusedName - cannot rename old object" ); } } diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx index dd9b63a47..1885b136d 100644 --- a/oox/source/helper/graphichelper.cxx +++ b/oox/source/helper/graphichelper.cxx @@ -141,7 +141,7 @@ GraphicHelper::GraphicHelper( const Reference< XMultiServiceFactory >& rxGlobalF } catch( Exception& ) { - OSL_ENSURE( false, "GraphicHelper::GraphicHelper - cannot get output device info" ); + OSL_FAIL( "GraphicHelper::GraphicHelper - cannot get output device info" ); } mfPixelPerHmmX = maDeviceInfo.PixelPerMeterX / 100000.0; mfPixelPerHmmY = maDeviceInfo.PixelPerMeterY / 100000.0; @@ -160,13 +160,13 @@ sal_Int32 GraphicHelper::getSystemColor( sal_Int32 nToken, sal_Int32 nDefaultRgb sal_Int32 GraphicHelper::getSchemeColor( sal_Int32 /*nToken*/ ) const { - OSL_ENSURE( false, "GraphicHelper::getSchemeColor - scheme colors not implemented" ); + OSL_FAIL( "GraphicHelper::getSchemeColor - scheme colors not implemented" ); return API_RGB_TRANSPARENT; } sal_Int32 GraphicHelper::getPaletteColor( sal_Int32 /*nPaletteIdx*/ ) const { - OSL_ENSURE( false, "GraphicHelper::getPaletteColor - palette colors not implemented" ); + OSL_FAIL( "GraphicHelper::getPaletteColor - palette colors not implemented" ); return API_RGB_TRANSPARENT; } diff --git a/oox/source/helper/propertyset.cxx b/oox/source/helper/propertyset.cxx index a3c9ee0b7..00ea76fa4 100644 --- a/oox/source/helper/propertyset.cxx +++ b/oox/source/helper/propertyset.cxx @@ -80,7 +80,7 @@ void PropertySet::getProperties( Sequence< Any >& orValues, const Sequence< OUSt } catch( Exception& ) { - OSL_ENSURE( false, "PropertySet::getProperties - cannot get all property values - fallback to single mode" ); + OSL_FAIL( "PropertySet::getProperties - cannot get all property values - fallback to single mode" ); } if( mxPropSet.is() ) @@ -114,7 +114,7 @@ void PropertySet::setProperties( const Sequence< OUString >& rPropNames, const S } catch( Exception& ) { - OSL_ENSURE( false, "PropertySet::setProperties - cannot set all property values, fallback to single mode" ); + OSL_FAIL( "PropertySet::setProperties - cannot set all property values, fallback to single mode" ); } if( mxPropSet.is() ) @@ -153,7 +153,7 @@ bool PropertySet::getAnyProperty( Any& orValue, const OUString& rPropName ) cons } catch( Exception& ) { - OSL_ENSURE( false, OStringBuffer( "PropertySet::getAnyProperty - cannot get property \"" ). + OSL_FAIL( OStringBuffer( "PropertySet::getAnyProperty - cannot get property \"" ). append( OUStringToOString( rPropName, RTL_TEXTENCODING_ASCII_US ) ).append( '"' ).getStr() ); } return bHasValue; @@ -168,7 +168,7 @@ void PropertySet::setAnyProperty( const OUString& rPropName, const Any& rValue ) } catch( Exception& ) { - OSL_ENSURE( false, OStringBuffer( "PropertySet::setAnyProperty - cannot set property \"" ). + OSL_FAIL( OStringBuffer( "PropertySet::setAnyProperty - cannot set property \"" ). append( OUStringToOString( rPropName, RTL_TEXTENCODING_ASCII_US ) ).append( '"' ).getStr() ); } } diff --git a/oox/source/helper/zipstorage.cxx b/oox/source/helper/zipstorage.cxx index 7f320dbbc..33c9aa4dc 100644 --- a/oox/source/helper/zipstorage.cxx +++ b/oox/source/helper/zipstorage.cxx @@ -97,7 +97,7 @@ ZipStorage::ZipStorage( } catch( Exception& ) { - OSL_ENSURE( false, "ZipStorage::ZipStorage - cannot open output storage" ); + OSL_FAIL( "ZipStorage::ZipStorage - cannot open output storage" ); } } diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index db2443f86..c381050e9 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -480,7 +480,7 @@ void ControlConverter::convertAxPicture( PropertyMap& rPropMap, const StreamData case AX_PICPOS_BELOWCENTER: nImagePos = AwtImagePos::BelowCenter; break; case AX_PICPOS_BELOWRIGHT: nImagePos = AwtImagePos::BelowRight; break; case AX_PICPOS_CENTER: nImagePos = AwtImagePos::Centered; break; - default: OSL_ENSURE( false, "ControlConverter::convertAxPicture - unknown picture position" ); + default: OSL_FAIL( "ControlConverter::convertAxPicture - unknown picture position" ); } rPropMap.setProperty( PROP_ImagePosition, nImagePos ); } @@ -499,7 +499,7 @@ void ControlConverter::convertAxPicture( PropertyMap& rPropMap, const StreamData case AX_PICSIZE_CLIP: nScaleMode = AwtScaleMode::None; break; case AX_PICSIZE_STRETCH: nScaleMode = AwtScaleMode::Anisotropic; break; case AX_PICSIZE_ZOOM: nScaleMode = AwtScaleMode::Isotropic; break; - default: OSL_ENSURE( false, "ControlConverter::convertAxPicture - unknown picture size mode" ); + default: OSL_FAIL( "ControlConverter::convertAxPicture - unknown picture size mode" ); } rPropMap.setProperty( PROP_ScaleMode, nScaleMode ); } @@ -538,7 +538,7 @@ void ControlConverter::convertAxOrientation( PropertyMap& rPropMap, case AX_ORIENTATION_AUTO: bHorizontal = rSize.first > rSize.second; break; case AX_ORIENTATION_VERTICAL: bHorizontal = false; break; case AX_ORIENTATION_HORIZONTAL: bHorizontal = true; break; - default: OSL_ENSURE( false, "ControlConverter::convertAxOrientation - unknown orientation" ); + default: OSL_FAIL( "ControlConverter::convertAxOrientation - unknown orientation" ); } convertOrientation( rPropMap, bHorizontal ); } @@ -575,7 +575,7 @@ OUString ControlModelBase::getServiceName() const case API_CONTROL_PAGE: return CREATE_OUSTRING( "com.sun.star.awt.UnoPageModel" ); case API_CONTROL_MULTIPAGE: return CREATE_OUSTRING( "com.sun.star.awt.UnoMultiPageModel" ); case API_CONTROL_DIALOG: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlDialogModel" ); - default: OSL_ENSURE( false, "ControlModelBase::getServiceName - no AWT model service supported" ); + default: OSL_FAIL( "ControlModelBase::getServiceName - no AWT model service supported" ); } else switch( eCtrlType ) { @@ -590,7 +590,7 @@ OUString ControlModelBase::getServiceName() const case API_CONTROL_SPINBUTTON: return CREATE_OUSTRING( "com.sun.star.form.component.SpinButton" ); case API_CONTROL_SCROLLBAR: return CREATE_OUSTRING( "com.sun.star.form.component.ScrollBar" ); case API_CONTROL_GROUPBOX: return CREATE_OUSTRING( "com.sun.star.form.component.GroupBox" ); - default: OSL_ENSURE( false, "ControlModelBase::getServiceName - no form component service supported" ); + default: OSL_FAIL( "ControlModelBase::getServiceName - no form component service supported" ); } return OUString(); } @@ -668,7 +668,7 @@ sal_uInt32 ComCtlModelBase::getDataPartId() const case 5: return mnDataPartId5; case 6: return mnDataPartId6; } - OSL_ENSURE( false, "ComCtlObjectBase::getDataPartId - unxpected version" ); + OSL_FAIL( "ComCtlObjectBase::getDataPartId - unxpected version" ); return SAL_MAX_UINT32; } @@ -872,7 +872,7 @@ void AxFontDataModel::convertProperties( PropertyMap& rPropMap, const ControlCon case AX_FONTDATA_LEFT: nAlign = cssa::TextAlign::LEFT; break; case AX_FONTDATA_RIGHT: nAlign = cssa::TextAlign::RIGHT; break; case AX_FONTDATA_CENTER: nAlign = cssa::TextAlign::CENTER; break; - default: OSL_ENSURE( false, "AxFontDataModel::convertProperties - unknown text alignment" ); + default: OSL_FAIL( "AxFontDataModel::convertProperties - unknown text alignment" ); } // form controls expect short value rPropMap.setProperty( PROP_Align, static_cast< sal_Int16 >( nAlign ) ); diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx index 185403e9d..61b78117c 100644 --- a/oox/source/ole/olehelper.cxx +++ b/oox/source/ole/olehelper.cxx @@ -158,7 +158,7 @@ StdFontInfo::StdFontInfo( const ::rtl::OUString& rName, sal_uInt32 nHeight, case OLE_COLORTYPE_SYSCOLOR: return rGraphicHelper.getSystemColor( STATIC_ARRAY_SELECT( spnSystemColors, nOleColor & OLE_SYSTEMCOLOR_MASK, XML_TOKEN_INVALID ), API_RGB_WHITE ); } - OSL_ENSURE( false, "OleHelper::decodeOleColor - unknown color type" ); + OSL_FAIL( "OleHelper::decodeOleColor - unknown color type" ); return API_RGB_BLACK; } @@ -281,7 +281,7 @@ StdFontInfo::StdFontInfo( const ::rtl::OUString& rName, sal_uInt32 nHeight, } else { - OSL_ENSURE( false, "OleHelper::importStdHlink - unsupported hyperlink moniker" ); + OSL_FAIL( "OleHelper::importStdHlink - unsupported hyperlink moniker" ); return false; } } diff --git a/oox/source/ole/olestorage.cxx b/oox/source/ole/olestorage.cxx index c4763203a..165128f81 100644 --- a/oox/source/ole/olestorage.cxx +++ b/oox/source/ole/olestorage.cxx @@ -264,7 +264,7 @@ void OleStorage::initStorage( const Reference< XInputStream >& rxInStream ) } catch( Exception& ) { - OSL_ENSURE( false, "OleStorage::initStorage - cannot create temporary copy of input stream" ); + OSL_FAIL( "OleStorage::initStorage - cannot create temporary copy of input stream" ); } // create base storage object @@ -317,7 +317,7 @@ bool OleStorage::implIsStorage() const Reference< XStorage > OleStorage::implGetXStorage() const { - OSL_ENSURE( false, "OleStorage::getXStorage - not implemented" ); + OSL_FAIL( "OleStorage::getXStorage - not implemented" ); return Reference< XStorage >(); } diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx index 1630b787f..da1ee608a 100644 --- a/oox/source/ole/vbacontrol.cxx +++ b/oox/source/ole/vbacontrol.cxx @@ -279,7 +279,7 @@ ControlModelRef VbaSiteModel::createControlModel( const AxClassTable& rClassTabl case VBA_SITE_FRAME: xCtrlModel.reset( new AxFrameModel ); break; case VBA_SITE_MULTIPAGE: xCtrlModel.reset( new AxMultiPageModel ); break; case VBA_SITE_FORM: xCtrlModel.reset( new AxFormPageModel ); break; - default: OSL_ENSURE( false, "VbaSiteModel::createControlModel - unknown type index" ); + default: OSL_FAIL( "VbaSiteModel::createControlModel - unknown type index" ); } } else @@ -481,7 +481,7 @@ bool VbaFormControl::convertProperties( const Reference< XControlModel >& rxCtrl } catch( Exception& ) { - OSL_ENSURE( false, "VbaFormControl::convertProperties - cannot get control container interface" ); + OSL_FAIL( "VbaFormControl::convertProperties - cannot get control container interface" ); } return true; diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx index 7ec222e36..e2e1d63a5 100644 --- a/oox/source/ole/vbamodule.cxx +++ b/oox/source/ole/vbamodule.cxx @@ -147,7 +147,7 @@ void VbaModule::importDirRecords( BinaryInputStream& rDirStrm ) { #define OOX_ENSURE_RECORDSIZE( cond ) OSL_ENSURE( cond, "VbaModule::importDirRecords - invalid record size" ) case VBA_ID_MODULENAME: - OSL_ENSURE( false, "VbaModule::importDirRecords - unexpected MODULENAME record" ); + OSL_FAIL( "VbaModule::importDirRecords - unexpected MODULENAME record" ); maName = aRecStrm.readCharArrayUC( nRecSize, meTextEnc ); break; case VBA_ID_MODULENAMEUNICODE: @@ -191,7 +191,7 @@ void VbaModule::importDirRecords( BinaryInputStream& rDirStrm ) mbPrivate = true; break; default: - OSL_ENSURE( false, "VbaModule::importDirRecords - unknown module record" ); + OSL_FAIL( "VbaModule::importDirRecords - unknown module record" ); #undef OOX_ENSURE_RECORDSIZE } } @@ -353,7 +353,7 @@ void VbaModule::createModule( const OUString& rVBASourceCode, } catch( Exception& ) { - OSL_ENSURE( false, "VbaModule::createModule - cannot insert module into library" ); + OSL_FAIL( "VbaModule::createModule - cannot insert module into library" ); } } diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 4034af889..eb6ebf882 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -286,8 +286,7 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce } catch( uno::Exception& ) { - OSL_ENSURE( false, - (rtl::OString("oox::ppt::PresentationFragmentHandler::EndDocument(), " + OSL_FAIL( (rtl::OString("oox::ppt::PresentationFragmentHandler::EndDocument(), " "exception caught: ") + rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx index 9a6b74a09..ae786efc1 100644 --- a/oox/source/ppt/slidefragmenthandler.cxx +++ b/oox/source/ppt/slidefragmenthandler.cxx @@ -189,8 +189,7 @@ void SAL_CALL SlideFragmentHandler::endDocument( ) throw (::com::sun::star::xml } catch( uno::Exception& ) { - OSL_ENSURE( false, - (rtl::OString("oox::ppt::SlideFragmentHandler::EndElement(), " + OSL_FAIL( (rtl::OString("oox::ppt::SlideFragmentHandler::EndElement(), " "exception caught: ") + rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx index 4c0baea85..e0a7721e0 100644 --- a/oox/source/ppt/slidetransition.cxx +++ b/oox/source/ppt/slidetransition.cxx @@ -99,7 +99,7 @@ namespace oox { namespace ppt { catch( Exception& ) { // should not happen - OSL_ENSURE( false, "exception raised" ); + OSL_FAIL( "exception raised" ); } } @@ -116,7 +116,7 @@ namespace oox { namespace ppt { catch( Exception& ) { // should not happen - OSL_ENSURE( false, "exception raised" ); + OSL_FAIL( "exception raised" ); } } diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index ec4a78a49..d3d94a4aa 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -102,7 +102,7 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r if( (nEndPos + 1 == rValue.getLength()) && (rValue[ nEndPos ] == '%') ) return fValue / 100.0; - OSL_ENSURE( false, "ConversionHelper::decodePercent - unknown measure unit" ); + OSL_FAIL( "ConversionHelper::decodePercent - unknown measure unit" ); return fDefValue; } @@ -116,7 +116,7 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r // TODO: according to spec, value may contain "auto" if( rValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "auto" ) ) ) { - OSL_ENSURE( false, "ConversionHelper::decodeMeasureToEmu - special value 'auto' must be handled by caller" ); + OSL_FAIL( "ConversionHelper::decodeMeasureToEmu - special value 'auto' must be handled by caller" ); return nRefValue; } @@ -160,7 +160,7 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r } else if( bDefaultAsPixel || (aUnit.getLength() > 0) ) // default as EMU and no unit -> do nothing { - OSL_ENSURE( false, "ConversionHelper::decodeMeasureToEmu - unknown measure unit" ); + OSL_FAIL( "ConversionHelper::decodeMeasureToEmu - unknown measure unit" ); fValue = nRefValue; } return static_cast< sal_Int32 >( fValue + 0.5 ); @@ -281,7 +281,7 @@ void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper, } } - OSL_ENSURE( false, OStringBuffer( "lclGetColor - invalid VML color name '" ). + OSL_FAIL( OStringBuffer( "lclGetColor - invalid VML color name '" ). append( OUStringToOString( roVmlColor.get(), RTL_TEXTENCODING_ASCII_US ) ).append( '\'' ).getStr() ); orDmlColor.setSrgbClr( nDefaultRgb ); } diff --git a/oox/source/xls/addressconverter.cxx b/oox/source/xls/addressconverter.cxx index 46405847e..9483bf999 100644 --- a/oox/source/xls/addressconverter.cxx +++ b/oox/source/xls/addressconverter.cxx @@ -774,7 +774,7 @@ void AddressConverter::initializeMaxPos( } catch( Exception& ) { - OSL_ENSURE( false, "AddressConverter::AddressConverter - cannot get sheet limits" ); + OSL_FAIL( "AddressConverter::AddressConverter - cannot get sheet limits" ); } } diff --git a/oox/source/xls/autofiltercontext.cxx b/oox/source/xls/autofiltercontext.cxx index c60dfd211..0f4558b7f 100644 --- a/oox/source/xls/autofiltercontext.cxx +++ b/oox/source/xls/autofiltercontext.cxx @@ -377,7 +377,7 @@ void OoxAutoFilterContext::setAutoFilter() Reference< XDatabaseRanges > xDBRanges = getDatabaseRanges(); if ( !xDBRanges.is() ) { - OSL_ENSURE( false, "OoxAutoFilterContext::setAutoFilter: DBRange empty" ); + OSL_FAIL( "OoxAutoFilterContext::setAutoFilter: DBRange empty" ); return; } @@ -404,7 +404,7 @@ void OoxAutoFilterContext::setAutoFilter() } else { - OSL_ENSURE(false, "OoxAutoFilterContext::setAutoFilter: descriptor is empty"); + OSL_FAIL("OoxAutoFilterContext::setAutoFilter: descriptor is empty"); return; } @@ -413,7 +413,7 @@ void OoxAutoFilterContext::setAutoFilter() Reference< XExtendedSheetFilterDescriptor > xExtDescriptor( xDescriptor, UNO_QUERY ); if ( !xExtDescriptor.is() ) { - OSL_ENSURE(false, "OoxAutoFilterContext::setAutoFilter: extended descriptor is empty"); + OSL_FAIL("OoxAutoFilterContext::setAutoFilter: extended descriptor is empty"); return; } @@ -742,7 +742,7 @@ void OoxAutoFilterContext::importCustomFilter( const AttributeList& rAttribs ) } break; default: - OSL_ENSURE( false, "OoxAutoFilterContext::importCustomFilter: unhandled case" ); + OSL_FAIL( "OoxAutoFilterContext::importCustomFilter: unhandled case" ); } } diff --git a/oox/source/xls/biffcodec.cxx b/oox/source/xls/biffcodec.cxx index 9483cd4db..2998f4622 100644 --- a/oox/source/xls/biffcodec.cxx +++ b/oox/source/xls/biffcodec.cxx @@ -283,13 +283,13 @@ BiffDecoderRef lclReadFilePassBiff8( BiffInputStream& rStrm ) xDecoder = lclReadFilePass_CryptoApi( rStrm ); break; default: - OSL_ENSURE( false, "lclReadFilePassBiff8 - unknown BIFF8 encryption sub mode" ); + OSL_FAIL( "lclReadFilePassBiff8 - unknown BIFF8 encryption sub mode" ); } } break; default: - OSL_ENSURE( false, "lclReadFilePassBiff8 - unknown encryption mode" ); + OSL_FAIL( "lclReadFilePassBiff8 - unknown encryption mode" ); } return xDecoder; } diff --git a/oox/source/xls/biffdetector.cxx b/oox/source/xls/biffdetector.cxx index fcf641172..ee76f5a7f 100644 --- a/oox/source/xls/biffdetector.cxx +++ b/oox/source/xls/biffdetector.cxx @@ -118,8 +118,7 @@ BiffType BiffDetector::detectStreamBiffVersion( BinaryInputStream& rInStream ) case BIFF_BOF_BIFF4: eBiff = BIFF4; break; case BIFF_BOF_BIFF5: eBiff = BIFF5; break; case BIFF_BOF_BIFF8: eBiff = BIFF8; break; - default: OSL_ENSURE( false, - OStringBuffer( "lclDetectStreamBiffVersion - unknown BIFF version: 0x" ). + default: OSL_FAIL( OStringBuffer( "lclDetectStreamBiffVersion - unknown BIFF version: 0x" ). append( static_cast< sal_Int32 >( nVersion ), 16 ).getStr() ); } } diff --git a/oox/source/xls/biffhelper.cxx b/oox/source/xls/biffhelper.cxx index f1bdb8d18..d9c17c8db 100644 --- a/oox/source/xls/biffhelper.cxx +++ b/oox/source/xls/biffhelper.cxx @@ -233,7 +233,7 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, case BIFF_ERR_NAME: nApiError = 525; break; case BIFF_ERR_NUM: nApiError = 503; break; case BIFF_ERR_NA: nApiError = 0x7FFF; break; - default: OSL_ENSURE( false, "BiffHelper::calcDoubleFromError - unknown error code" ); + default: OSL_FAIL( "BiffHelper::calcDoubleFromError - unknown error code" ); } DecodedDouble aDecDbl; ::rtl::math::setNan( &aDecDbl.mfValue ); @@ -276,7 +276,7 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, // case BIFF_IMGDATA_WMF: /* TODO */ break; case BIFF_IMGDATA_DIB: lclImportImgDataDib( orDataSeq, rStrm, nBytes, eBiff ); break; // case BIFF_IMGDATA_NATIVE: /* TODO */ break; - default: OSL_ENSURE( false, "BiffHelper::importImgData - unknown image format" ); + default: OSL_FAIL( "BiffHelper::importImgData - unknown image format" ); } } } diff --git a/oox/source/xls/condformatbuffer.cxx b/oox/source/xls/condformatbuffer.cxx index 284609d58..8b8247c01 100644 --- a/oox/source/xls/condformatbuffer.cxx +++ b/oox/source/xls/condformatbuffer.cxx @@ -403,7 +403,7 @@ void CondFormatRule::importCfRule( RecordInputStream& rStrm ) maModel.mnType = XML_iconSet; break; default: - OSL_ENSURE( false, "CondFormatRule::importCfRule - unknown rule type" ); + OSL_FAIL( "CondFormatRule::importCfRule - unknown rule type" ); } } @@ -528,7 +528,7 @@ void CondFormatRule::finalizeImport( const Reference< XSheetConditionalEntries > aReplaceFormula = CREATE_OUSTRING( "OR(AND(MONTH(#B)=MONTH(TODAY())+1,YEAR(#B)=YEAR(TODAY())),AND(MONTH(#B)=1,MONTH(TODAY())=12,YEAR(#B)=YEAR(TODAY())+1))" ); break; default: - OSL_ENSURE( false, "CondFormatRule::finalizeImport - unknown time period type" ); + OSL_FAIL( "CondFormatRule::finalizeImport - unknown time period type" ); } break; case XML_containsBlanks: @@ -599,7 +599,7 @@ void CondFormatRule::finalizeImport( const Reference< XSheetConditionalEntries > aReplaceFormula = aReplaceFormula.replaceAt( nStrPos, 2, aComp ); break; default: - OSL_ENSURE( false, "CondFormatRule::finalizeImport - unknown placeholder" ); + OSL_FAIL( "CondFormatRule::finalizeImport - unknown placeholder" ); } } diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx index 32e82703b..16cddeb09 100644 --- a/oox/source/xls/drawingfragment.cxx +++ b/oox/source/xls/drawingfragment.cxx @@ -120,7 +120,7 @@ void ShapeAnchor::importAnchor( sal_Int32 nElement, const AttributeList& rAttrib mnEditAs = rAttribs.getToken( XML_editAs, XML_twoCell ); break; default: - OSL_ENSURE( false, "ShapeAnchor::importAnchor - unexpected element" ); + OSL_FAIL( "ShapeAnchor::importAnchor - unexpected element" ); } } @@ -158,7 +158,7 @@ void ShapeAnchor::setCellPos( sal_Int32 nElement, sal_Int32 nParentContext, cons pAnchorCell = &maTo; break; default: - OSL_ENSURE( false, "ShapeAnchor::setCellPos - unexpected parent element" ); + OSL_FAIL( "ShapeAnchor::setCellPos - unexpected parent element" ); } if( pAnchorCell ) switch( nElement ) { @@ -166,7 +166,7 @@ void ShapeAnchor::setCellPos( sal_Int32 nElement, sal_Int32 nParentContext, cons case XDR_TOKEN( row ): pAnchorCell->mnRow = rValue.toInt32(); break; case XDR_TOKEN( colOff ): pAnchorCell->mnColOffset = rValue.toInt64(); break; case XDR_TOKEN( rowOff ): pAnchorCell->mnRowOffset = rValue.toInt64(); break; - default: OSL_ENSURE( false, "ShapeAnchor::setCellPos - unexpected element" ); + default: OSL_FAIL( "ShapeAnchor::setCellPos - unexpected element" ); } } @@ -217,7 +217,7 @@ bool ShapeAnchor::isValidAnchor() const ((maFrom.mnRow < maTo.mnRow) || ((maFrom.mnRow == maTo.mnRow) && (maFrom.mnRowOffset < maTo.mnRowOffset))); break; case ANCHOR_INVALID: - OSL_ENSURE( false, "ShapeAnchor::isValidAnchor - invalid anchor" ); + OSL_FAIL( "ShapeAnchor::isValidAnchor - invalid anchor" ); break; } return bValid; @@ -254,7 +254,7 @@ Rectangle ShapeAnchor::calcApiLocation( const Size& rApiSheetSize, const AnchorS } break; case ANCHOR_INVALID: - OSL_ENSURE( false, "ShapeAnchor::calcApiLocation - invalid anchor" ); + OSL_FAIL( "ShapeAnchor::calcApiLocation - invalid anchor" ); break; } @@ -346,7 +346,7 @@ Rectangle ShapeAnchor::calcEmuLocation( const AnchorSizeModel& rEmuSheetSize ) c } break; case ANCHOR_INVALID: - OSL_ENSURE( false, "ShapeAnchor::calcEmuLocation - invalid anchor" ); + OSL_FAIL( "ShapeAnchor::calcEmuLocation - invalid anchor" ); break; } diff --git a/oox/source/xls/excelchartconverter.cxx b/oox/source/xls/excelchartconverter.cxx index 5b413c187..15f8af05c 100644 --- a/oox/source/xls/excelchartconverter.cxx +++ b/oox/source/xls/excelchartconverter.cxx @@ -113,7 +113,7 @@ Reference< XDataSequence > ExcelChartConverter::createDataSequence( } catch( Exception& ) { - OSL_ENSURE( false, "ExcelChartConverter::createDataSequence - cannot create data sequence" ); + OSL_FAIL( "ExcelChartConverter::createDataSequence - cannot create data sequence" ); } } return xDataSeq; diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx index 1ad79bb9b..f2abfe280 100644 --- a/oox/source/xls/externallinkbuffer.cxx +++ b/oox/source/xls/externallinkbuffer.cxx @@ -385,7 +385,7 @@ bool ExternalName::getDdeLinkData( OUString& orDdeServer, OUString& orDdeTopic, } catch( Exception& ) { - OSL_ENSURE( false, "ExternalName::getDdeLinkData - cannot create DDE link" ); + OSL_FAIL( "ExternalName::getDdeLinkData - cannot create DDE link" ); } // get link data from created DDE link if( mxDdeLink.is() ) @@ -594,7 +594,7 @@ void ExternalLink::importExternalBook( const Relations& rRelations, RecordInputS } break; default: - OSL_ENSURE( false, "ExternalLink::importExternalBook - unknown link type" ); + OSL_FAIL( "ExternalLink::importExternalBook - unknown link type" ); } } diff --git a/oox/source/xls/externallinkfragment.cxx b/oox/source/xls/externallinkfragment.cxx index 4296be492..a7ab20f4b 100644 --- a/oox/source/xls/externallinkfragment.cxx +++ b/oox/source/xls/externallinkfragment.cxx @@ -521,7 +521,7 @@ void BiffExternalLinkFragment::importCrn() mrStrm.skip( 7 ); break; default: - OSL_ENSURE( false, "BiffExternalLinkFragment::importCrn - unknown data type" ); + OSL_FAIL( "BiffExternalLinkFragment::importCrn - unknown data type" ); bLoop = false; } } diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx index a3feb1059..327d6557d 100644 --- a/oox/source/xls/formulabase.cxx +++ b/oox/source/xls/formulabase.cxx @@ -878,7 +878,7 @@ FunctionProviderImpl::FunctionProviderImpl( FilterType eFilter, BiffType eBiff, nMaxParam = BIFF_MAX_PARAMCOUNT; break; case FILTER_UNKNOWN: - OSL_ENSURE( false, "FunctionProviderImpl::FunctionProviderImpl - invalid filter type" ); + OSL_FAIL( "FunctionProviderImpl::FunctionProviderImpl - invalid filter type" ); break; } OSL_ENSURE( eBiff != BIFF_UNKNOWN, "FunctionProviderImpl::FunctionProviderImpl - invalid BIFF type" ); @@ -1131,7 +1131,7 @@ OpCodeProviderImpl::OpCodeProviderImpl( const FunctionInfoVector& rFuncInfos, } catch( Exception& ) { - OSL_ENSURE( false, "OpCodeProviderImpl::OpCodeProviderImpl - cannot receive formula opcode mapper" ); + OSL_FAIL( "OpCodeProviderImpl::OpCodeProviderImpl - cannot receive formula opcode mapper" ); } } @@ -1184,8 +1184,7 @@ bool OpCodeProviderImpl::initOpCode( sal_Int32& ornOpCode, const OpCodeEntrySequ ornOpCode = rEntrySeq[ nSpecialId ].Token.OpCode; return true; } - OSL_ENSURE( false, - OStringBuffer( "OpCodeProviderImpl::initOpCode - opcode for special offset " ). + OSL_FAIL( OStringBuffer( "OpCodeProviderImpl::initOpCode - opcode for special offset " ). append( nSpecialId ).append( " not found" ).getStr() ); return false; } @@ -1205,8 +1204,7 @@ bool OpCodeProviderImpl::initOpCode( sal_Int32& ornOpCode, const ApiTokenMap& rT } return true; } - OSL_ENSURE( false, - OStringBuffer( "OpCodeProviderImpl::initOpCode - opcode for \"" ). + OSL_FAIL( OStringBuffer( "OpCodeProviderImpl::initOpCode - opcode for \"" ). append( OUStringToOString( rOdfName, RTL_TEXTENCODING_ASCII_US ) ). append( "\" not found" ).getStr() ); return false; diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx index 99cbcd2da..890fa4303 100644 --- a/oox/source/xls/formulaparser.cxx +++ b/oox/source/xls/formulaparser.cxx @@ -587,17 +587,17 @@ FormulaParserImpl::FormulaParserImpl( const FormulaParser& rParent ) : void FormulaParserImpl::importOoxFormula( FormulaContext&, const OUString& ) { - OSL_ENSURE( false, "FormulaParserImpl::importOoxFormula - not implemented" ); + OSL_FAIL( "FormulaParserImpl::importOoxFormula - not implemented" ); } void FormulaParserImpl::importOobFormula( FormulaContext&, RecordInputStream& ) { - OSL_ENSURE( false, "FormulaParserImpl::importOobFormula - not implemented" ); + OSL_FAIL( "FormulaParserImpl::importOobFormula - not implemented" ); } void FormulaParserImpl::importBiffFormula( FormulaContext&, BiffInputStream&, const sal_uInt16* ) { - OSL_ENSURE( false, "FormulaParserImpl::importBiffFormula - not implemented" ); + OSL_FAIL( "FormulaParserImpl::importBiffFormula - not implemented" ); } void FormulaParserImpl::setFormula( FormulaContext& rContext, const ApiTokenSequence& rTokens ) @@ -1637,7 +1637,7 @@ bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm ) rStrm.skip( 3 ); break; default: - OSL_ENSURE( false, "OoxFormulaParserImpl::importArrayToken - unknown data type" ); + OSL_FAIL( "OoxFormulaParserImpl::importArrayToken - unknown data type" ); appendRawToken( OPCODE_PUSH ) <<= BiffHelper::calcDoubleFromError( BIFF_ERR_NA ); } } @@ -2359,7 +2359,7 @@ bool BiffFormulaParserImpl::importArrayToken( BiffInputStream& rStrm ) rStrm.skip( 7 ); break; default: - OSL_ENSURE( false, "BiffFormulaParserImpl::importArrayToken - unknown data type" ); + OSL_FAIL( "BiffFormulaParserImpl::importArrayToken - unknown data type" ); appendRawToken( OPCODE_PUSH ) <<= BiffHelper::calcDoubleFromError( BIFF_ERR_NA ); } } diff --git a/oox/source/xls/numberformatsbuffer.cxx b/oox/source/xls/numberformatsbuffer.cxx index 3343fe14f..fa00c6822 100644 --- a/oox/source/xls/numberformatsbuffer.cxx +++ b/oox/source/xls/numberformatsbuffer.cxx @@ -1840,8 +1840,7 @@ sal_Int32 lclCreatePredefinedFormat( const Reference< XNumberFormats >& rxNumFmt } catch( Exception& ) { - OSL_ENSURE( false, - OStringBuffer( "lclCreatePredefinedFormat - cannot create predefined number format " ). + OSL_FAIL( OStringBuffer( "lclCreatePredefinedFormat - cannot create predefined number format " ). append( OString::valueOf( static_cast< sal_Int32 >( nPredefId ) ) ).getStr() ); } return nIndex; @@ -1865,8 +1864,7 @@ sal_Int32 lclCreateFormat( const Reference< XNumberFormats >& rxNumFmts, } else { - OSL_ENSURE( false, - OStringBuffer( "lclCreateFormat - cannot create number format '" ). + OSL_FAIL( OStringBuffer( "lclCreateFormat - cannot create number format '" ). append( OUStringToOString( rFmtCode, osl_getThreadTextEncoding() ) ). append( '\'' ).getStr() ); } @@ -1978,7 +1976,7 @@ NumberFormatsBuffer::NumberFormatsBuffer( const WorkbookHelper& rHelper ) : } catch( Exception& ) { - OSL_ENSURE( false, "NumberFormatsBuffer::NumberFormatsBuffer - cannot get system locale" ); + OSL_FAIL( "NumberFormatsBuffer::NumberFormatsBuffer - cannot get system locale" ); } // create built-in formats for current locale diff --git a/oox/source/xls/pagesettings.cxx b/oox/source/xls/pagesettings.cxx index e98e53e46..b81e6302d 100644 --- a/oox/source/xls/pagesettings.cxx +++ b/oox/source/xls/pagesettings.cxx @@ -927,8 +927,7 @@ Reference< XTextContent > HeaderFooterParser::createField( const OUString& rServ } catch( Exception& ) { - OSL_ENSURE( false, - OStringBuffer( "HeaderFooterParser::createField - error while creating text field \"" ). + OSL_FAIL( OStringBuffer( "HeaderFooterParser::createField - error while creating text field \"" ). append( OUStringToOString( rServiceName, RTL_TEXTENCODING_ASCII_US ) ). append( '"' ).getStr() ); } diff --git a/oox/source/xls/pivotcachebuffer.cxx b/oox/source/xls/pivotcachebuffer.cxx index 4fd82ce59..6739375f8 100644 --- a/oox/source/xls/pivotcachebuffer.cxx +++ b/oox/source/xls/pivotcachebuffer.cxx @@ -317,7 +317,7 @@ OUString PivotCacheItem::getName() const case XML_b: return OUString::valueOf( static_cast< sal_Bool >( maValue.get< bool >() ) ); // !TODO case XML_e: return OUString(); // !TODO } - OSL_ENSURE( false, "PivotCacheItem::getName - invalid data type" ); + OSL_FAIL( "PivotCacheItem::getName - invalid data type" ); return OUString(); } @@ -339,7 +339,7 @@ void PivotCacheItemList::importItem( sal_Int32 nElement, const AttributeList& rA case XLS_TOKEN( d ): rItem.readDate( rAttribs ); break; case XLS_TOKEN( b ): rItem.readBool( rAttribs ); break; case XLS_TOKEN( e ): rItem.readError( rAttribs, getUnitConverter() ); break; - default: OSL_ENSURE( false, "PivotCacheItemList::importItem - unknown element type" ); + default: OSL_FAIL( "PivotCacheItemList::importItem - unknown element type" ); } } @@ -366,7 +366,7 @@ void PivotCacheItemList::importItem( sal_Int32 nRecId, RecordInputStream& rStrm case OOBIN_ID_PCITEMA_BOOL: rItem.readBool( rStrm ); break; case OOBIN_ID_PCITEM_ERROR: case OOBIN_ID_PCITEMA_ERROR: rItem.readError( rStrm ); break; - default: OSL_ENSURE( false, "PivotCacheItemList::importItem - unknown record type" ); + default: OSL_FAIL( "PivotCacheItemList::importItem - unknown record type" ); } } @@ -425,7 +425,7 @@ void PivotCacheItemList::importArray( RecordInputStream& rStrm ) case OOBIN_PCITEM_ARRAY_ERROR: createItem().readError( rStrm ); break; case OOBIN_PCITEM_ARRAY_DATE: createItem().readDate( rStrm ); break; default: - OSL_ENSURE( false, "PivotCacheItemList::importArray - unknown data type" ); + OSL_FAIL( "PivotCacheItemList::importArray - unknown data type" ); nIdx = nCount; } } @@ -809,7 +809,7 @@ OUString PivotCacheField::createDateGroupField( const Reference< XDataPilotField case XML_hours: aGroupInfo.GroupBy = HOURS; break; case XML_minutes: aGroupInfo.GroupBy = MINUTES; break; case XML_seconds: aGroupInfo.GroupBy = SECONDS; break; - default: OSL_ENSURE( false, "PivotCacheField::convertRangeGrouping - unknown date/time interval" ); + default: OSL_FAIL( "PivotCacheField::convertRangeGrouping - unknown date/time interval" ); } try @@ -996,7 +996,7 @@ void PivotCacheField::writeItemToSourceDataCell( WorksheetHelper& rSheetHelper, case XML_d: rSheetHelper.setDateTimeCell( xCell, rItem.getValue().get< DateTime >() ); break; case XML_b: rSheetHelper.setBooleanCell( xCell, rItem.getValue().get< bool >() ); break; case XML_e: rSheetHelper.setErrorCell( xCell, static_cast< sal_uInt8 >( rItem.getValue().get< sal_Int32 >() ) ); break; - default: OSL_ENSURE( false, "PivotCacheField::writeItemToSourceDataCell - unexpected item data type" ); + default: OSL_FAIL( "PivotCacheField::writeItemToSourceDataCell - unexpected item data type" ); } } } @@ -1529,7 +1529,7 @@ PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId ) } case FILTER_UNKNOWN: - OSL_ENSURE( false, "PivotCacheBuffer::importPivotCacheFragment - unknown filter type" ); + OSL_FAIL( "PivotCacheBuffer::importPivotCacheFragment - unknown filter type" ); } return 0; } diff --git a/oox/source/xls/pivotcachefragment.cxx b/oox/source/xls/pivotcachefragment.cxx index 4023ec3da..c3c240f9d 100644 --- a/oox/source/xls/pivotcachefragment.cxx +++ b/oox/source/xls/pivotcachefragment.cxx @@ -249,7 +249,7 @@ ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateContext( sal_Int32 nElem case XLS_TOKEN( b ): aItem.readBool( rAttribs ); break; case XLS_TOKEN( e ): aItem.readError( rAttribs, getUnitConverter() ); break; case XLS_TOKEN( x ): aItem.readIndex( rAttribs ); break; - default: OSL_ENSURE( false, "OoxPivotCacheRecordsFragment::onCreateContext - unexpected element" ); + default: OSL_FAIL( "OoxPivotCacheRecordsFragment::onCreateContext - unexpected element" ); } mrPivotCache.writeSourceDataCell( *this, mnCol, mnRow, aItem ); ++mnCol; @@ -319,7 +319,7 @@ void OoxPivotCacheRecordsFragment::importPCRecordItem( sal_Int32 nRecId, RecordI case OOBIN_ID_PCITEM_BOOL: aItem.readBool( rStrm ); break; case OOBIN_ID_PCITEM_ERROR: aItem.readError( rStrm ); break; case OOBIN_ID_PCITEM_INDEX: aItem.readIndex( rStrm ); break; - default: OSL_ENSURE( false, "OoxPivotCacheRecordsFragment::importPCRecordItem - unexpected record" ); + default: OSL_FAIL( "OoxPivotCacheRecordsFragment::importPCRecordItem - unexpected record" ); } mrPivotCache.writeSourceDataCell( *this, mnCol, mnRow, aItem ); ++mnCol; diff --git a/oox/source/xls/pivottablebuffer.cxx b/oox/source/xls/pivottablebuffer.cxx index 1d5e8698a..64154c7f9 100644 --- a/oox/source/xls/pivottablebuffer.cxx +++ b/oox/source/xls/pivottablebuffer.cxx @@ -694,7 +694,7 @@ void PivotTableField::convertDataField( const PTDataFieldModel& rDataField ) case XML_stdDevp: eAggFunc = GeneralFunction_STDEVP; break; case XML_var: eAggFunc = GeneralFunction_VAR; break; case XML_varp: eAggFunc = GeneralFunction_VARP; break; - default: OSL_ENSURE( false, "PivotTableField::convertDataField - unknown aggregation function" ); + default: OSL_FAIL( "PivotTableField::convertDataField - unknown aggregation function" ); } aPropSet.setProperty( PROP_Function, eAggFunc ); @@ -1423,7 +1423,7 @@ void PivotTable::finalizeImport() } catch( Exception& ) { - OSL_ENSURE( false, "PivotTable::finalizeImport - exception while creating the DataPilot table" ); + OSL_FAIL( "PivotTable::finalizeImport - exception while creating the DataPilot table" ); } } } diff --git a/oox/source/xls/sheetdatacontext.cxx b/oox/source/xls/sheetdatacontext.cxx index 67cc80c13..def977413 100644 --- a/oox/source/xls/sheetdatacontext.cxx +++ b/oox/source/xls/sheetdatacontext.cxx @@ -253,7 +253,7 @@ void OoxSheetDataContext::onEndElement( const OUString& rChars ) break; default: - OSL_ENSURE( false, "OoxSheetDataContext::onEndElement - unknown formula type" ); + OSL_FAIL( "OoxSheetDataContext::onEndElement - unknown formula type" ); } } catch( Exception& ) @@ -766,7 +766,7 @@ void BiffSheetDataContext::importBoolErr() setErrorCell( maCurrCell.mxCell, nValue ); break; default: - OSL_ENSURE( false, "BiffSheetDataContext::importBoolErr - unknown cell type" ); + OSL_FAIL( "BiffSheetDataContext::importBoolErr - unknown cell type" ); } } setCellFormat( maCurrCell ); @@ -978,7 +978,7 @@ void BiffSheetDataContext::importDataTable() } break; default: - OSL_ENSURE( false, "BiffSheetDataContext::importDataTable - unknown record id" ); + OSL_FAIL( "BiffSheetDataContext::importDataTable - unknown record id" ); } aModel.maRef1 = FormulaProcessorBase::generateAddress2dString( aRef1, false ); aModel.maRef2 = FormulaProcessorBase::generateAddress2dString( aRef2, false ); diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx index 23bdc20fa..7d47fe293 100644 --- a/oox/source/xls/stylesbuffer.cxx +++ b/oox/source/xls/stylesbuffer.cxx @@ -372,7 +372,7 @@ void Color::importColor( const AttributeList& rAttribs ) setIndexed( rAttribs.getInteger( XML_indexed, -1 ), rAttribs.getDouble( XML_tint, 0.0 ) ); else { - OSL_ENSURE( false, "Color::importColor - unknown color type" ); + OSL_FAIL( "Color::importColor - unknown color type" ); setAuto(); } } @@ -408,7 +408,7 @@ void Color::importColor( RecordInputStream& rStrm ) rStrm.skip( 4 ); break; default: - OSL_ENSURE( false, "Color::importColor - unknown color type" ); + OSL_FAIL( "Color::importColor - unknown color type" ); setAuto(); rStrm.skip( 4 ); } @@ -570,7 +570,7 @@ sal_Int32 ColorPalette::getColor( sal_Int32 nPaletteIdx ) const case OOX_COLOR_NOTEBACK: nColor = getBaseFilter().getGraphicHelper().getSystemColor( XML_infoBk ); break; case OOX_COLOR_NOTETEXT: nColor = getBaseFilter().getGraphicHelper().getSystemColor( XML_infoText ); break; case OOX_COLOR_FONTAUTO: nColor = API_RGB_TRANSPARENT; break; - default: OSL_ENSURE( false, "ColorPalette::getColor - unknown color index" ); + default: OSL_FAIL( "ColorPalette::getColor - unknown color index" ); } return nColor; } @@ -887,7 +887,7 @@ void Font::importDxfFlag( sal_Int32 nElement, RecordInputStream& rStrm ) maUsedFlags.mbShadowUsed = true; break; default: - OSL_ENSURE( false, "Font::importDxfFlag - unexpected element identifier" ); + OSL_FAIL( "Font::importDxfFlag - unexpected element identifier" ); } } diff --git a/oox/source/xls/tablebuffer.cxx b/oox/source/xls/tablebuffer.cxx index 1c33b9721..0ea55e694 100644 --- a/oox/source/xls/tablebuffer.cxx +++ b/oox/source/xls/tablebuffer.cxx @@ -110,7 +110,7 @@ void Table::finalizeImport() } catch( Exception& ) { - OSL_ENSURE( false, "Table::finalizeImport - cannot create database range" ); + OSL_FAIL( "Table::finalizeImport - cannot create database range" ); } } diff --git a/oox/source/xls/viewsettings.cxx b/oox/source/xls/viewsettings.cxx index 3e534d75f..29de5aef9 100644 --- a/oox/source/xls/viewsettings.cxx +++ b/oox/source/xls/viewsettings.cxx @@ -784,7 +784,7 @@ void ViewSettings::finalizeImport() } catch( Exception& ) { - OSL_ENSURE( false, "ViewSettings::finalizeImport - cannot create document view settings" ); + OSL_FAIL( "ViewSettings::finalizeImport - cannot create document view settings" ); } /* Set visible area to be used if this document is an embedded OLE object. diff --git a/oox/source/xls/worksheetbuffer.cxx b/oox/source/xls/worksheetbuffer.cxx index 4829fcdb4..5be6b51cd 100644 --- a/oox/source/xls/worksheetbuffer.cxx +++ b/oox/source/xls/worksheetbuffer.cxx @@ -240,7 +240,7 @@ WorksheetBuffer::IndexNamePair WorksheetBuffer::createSheet( const OUString& rPr } catch( Exception& ) { - OSL_ENSURE( false, "WorksheetBuffer::createSheet - cannot insert or rename worksheet" ); + OSL_FAIL( "WorksheetBuffer::createSheet - cannot insert or rename worksheet" ); } return IndexNamePair( -1, OUString() ); } diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx index 02264af8c..06249d00e 100644 --- a/oox/source/xls/worksheethelper.cxx +++ b/oox/source/xls/worksheethelper.cxx @@ -1398,7 +1398,7 @@ void WorksheetData::insertHyperlink( const CellAddress& rAddress, const OUString } catch( const Exception& ) { - OSL_ENSURE( false, "WorksheetData::insertHyperlink - cannot insert text field" ); + OSL_FAIL( "WorksheetData::insertHyperlink - cannot insert text field" ); } } } @@ -1449,7 +1449,7 @@ void WorksheetData::finalizeValidationRanges() const case XML_textLength: eType = csss::ValidationType_TEXT_LEN; break; case XML_time: eType = csss::ValidationType_TIME; break; case XML_whole: eType = csss::ValidationType_WHOLE; break; - default: OSL_ENSURE( false, "WorksheetData::finalizeValidationRanges - unknown validation type" ); + default: OSL_FAIL( "WorksheetData::finalizeValidationRanges - unknown validation type" ); } aValProps.setProperty( PROP_Type, eType ); @@ -1460,7 +1460,7 @@ void WorksheetData::finalizeValidationRanges() const case XML_information: eAlertStyle = csss::ValidationAlertStyle_INFO; break; case XML_stop: eAlertStyle = csss::ValidationAlertStyle_STOP; break; case XML_warning: eAlertStyle = csss::ValidationAlertStyle_WARNING; break; - default: OSL_ENSURE( false, "WorksheetData::finalizeValidationRanges - unknown error style" ); + default: OSL_FAIL( "WorksheetData::finalizeValidationRanges - unknown error style" ); } aValProps.setProperty( PROP_ErrorAlertStyle, eAlertStyle ); diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index d26fda859..298051b6b 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -1554,7 +1554,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, while (xIter->hasMoreElements()) { rdf::Statement stmt; if (!(xIter->nextElement() >>= stmt)) { - OSL_ENSURE(false, "getStatementRDFa: result of wrong type?"); + OSL_FAIL("getStatementRDFa: result of wrong type?"); } else { ret.push_back(stmt); } @@ -2033,7 +2033,7 @@ librdf_node* librdf_TypeConverter::mkNode( librdf_world* i_pWorld, (lang.getStr()), 0); } else { - OSL_ENSURE(false, "mkNode: invalid literal"); + OSL_FAIL("mkNode: invalid literal"); return 0; } } @@ -2114,7 +2114,7 @@ librdf_TypeConverter::convertToXURI(librdf_node* i_pNode) const } return convertToXURI(pURI); } else { - OSL_ENSURE(false, "convertToXURI: unknown librdf_node"); + OSL_FAIL("convertToXURI: unknown librdf_node"); return 0; } } diff --git a/writerfilter/inc/resourcemodel/TableManager.hxx b/writerfilter/inc/resourcemodel/TableManager.hxx index cae1fa82f..7579ff67e 100644 --- a/writerfilter/inc/resourcemodel/TableManager.hxx +++ b/writerfilter/inc/resourcemodel/TableManager.hxx @@ -1008,7 +1008,7 @@ void TableManager<T, PropertiesPointer>::resolveCurrentTable() #if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aBuf("resolving of current table failed with: "); aBuf.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); - OSL_ENSURE(false, aBuf.getStr()); + OSL_FAIL(aBuf.getStr()); #endif } } diff --git a/writerfilter/source/dmapper/BorderHandler.cxx b/writerfilter/source/dmapper/BorderHandler.cxx index 8da9ffb4e..46938af70 100644 --- a/writerfilter/source/dmapper/BorderHandler.cxx +++ b/writerfilter/source/dmapper/BorderHandler.cxx @@ -105,7 +105,7 @@ void BorderHandler::attribute(Id rName, Value & rVal) case NS_ooxml::LN_CT_Border_themeTint: break; case NS_ooxml::LN_CT_Border_themeColor: break; default: - OSL_ENSURE( false, "unknown attribute"); + OSL_FAIL( "unknown attribute"); } } diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx b/writerfilter/source/dmapper/CellColorHandler.cxx index 416a02c31..10bbf8251 100644 --- a/writerfilter/source/dmapper/CellColorHandler.cxx +++ b/writerfilter/source/dmapper/CellColorHandler.cxx @@ -88,7 +88,7 @@ void CellColorHandler::attribute(Id rName, Value & rVal) // ignored break; default: - OSL_ENSURE( false, "unknown attribute"); + OSL_FAIL( "unknown attribute"); } } diff --git a/writerfilter/source/dmapper/CellMarginHandler.cxx b/writerfilter/source/dmapper/CellMarginHandler.cxx index b98cf0129..ba5795db1 100644 --- a/writerfilter/source/dmapper/CellMarginHandler.cxx +++ b/writerfilter/source/dmapper/CellMarginHandler.cxx @@ -69,7 +69,7 @@ void CellMarginHandler::attribute(Id rName, Value & rVal) OSL_ENSURE( NS_ooxml::LN_Value_ST_TblWidth_dxa == sal::static_int_cast<Id>(nIntValue), "cell margins work for absolute values, only"); break; default: - OSL_ENSURE( false, "unknown attribute"); + OSL_FAIL( "unknown attribute"); } } @@ -98,7 +98,7 @@ void CellMarginHandler::sprm(Sprm & rSprm) m_bRightMarginValid = true; break; default: - OSL_ENSURE( false, "unknown attribute"); + OSL_FAIL( "unknown attribute"); } } m_nValue = 0; diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index df0270069..72d581525 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1412,7 +1412,7 @@ void DomainMapper::attribute(Id nName, Value & val) sMessage += ::rtl::OString::valueOf( sal_Int32( nIntValue ), 10 ); sMessage += ::rtl::OString(" / 0x"); sMessage += ::rtl::OString::valueOf( sal_Int32( nIntValue ), 16 ); - OSL_ENSURE( false, sMessage.getStr()); // + OSL_FAIL( sMessage.getStr()); // #endif } } @@ -1598,7 +1598,7 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp case 23: //sprmPChgTabs case NS_sprm::LN_PChgTabs: // sprmPChgTabs - OSL_ENSURE( false, "unhandled"); + OSL_FAIL( "unhandled"); //tabs of list level? break; case 24: // "sprmPFInTable" @@ -1694,7 +1694,7 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp switch( nSprmId ) { case NS_sprm::LN_PBrcBetween: // sprmPBrcBetween - OSL_ENSURE( false, "TODO: inner border is not handled"); + OSL_FAIL( "TODO: inner border is not handled"); break; case NS_sprm::LN_PBrcLeft: // sprmPBrcLeft eBorderId = PROP_LEFT_BORDER; @@ -1722,7 +1722,7 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp case NS_sprm::LN_PBorderLeft: case NS_sprm::LN_PBorderBottom: case NS_sprm::LN_PBorderRight: - OSL_ENSURE( false, "TODO: border color definition"); + OSL_FAIL( "TODO: border color definition"); break; case NS_sprm::LN_PBrcBar: break; // sprmPBrcBar @@ -1948,7 +1948,7 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp } else { - OSL_ENSURE( false, "what type was it"); + OSL_FAIL( "what type was it"); } } @@ -2578,7 +2578,7 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp } break; case 0x703a: //undocumented, grid related? - OSL_ENSURE( false, "TODO: not handled yet"); //nIntValue like 0x008a2373 ? + OSL_FAIL( "TODO: not handled yet"); //nIntValue like 0x008a2373 ? break; case NS_sprm::LN_SClm: { @@ -2649,7 +2649,7 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp case NS_sprm::LN_TTableHeader: case NS_sprm::LN_TTableBorders: // sprmTTableBorders { - OSL_ENSURE( false, "table propeties should be handled by the table manager"); + OSL_FAIL( "table propeties should be handled by the table manager"); } break; case NS_sprm::LN_TDefTable10: @@ -3077,7 +3077,7 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp case ooxml::OOXML_mod : case ooxml::OOXML_ins : case ooxml::OOXML_del : break; - default: OSL_ENSURE( false, "redline token other than mod, ins or del" ); + default: OSL_FAIL( "redline token other than mod, ins or del" ); } m_pImpl->EndParaChange( ); } @@ -3501,7 +3501,7 @@ void DomainMapper::table(Id name, writerfilter::Reference<Table>::Pointer_t ref) m_pImpl->ApplySettingsTable(); break; default: - OSL_ENSURE( false, "which table is to be filled here?"); + OSL_FAIL( "which table is to be filled here?"); } m_pImpl->SetAnyTableImport(false); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 7061fe5a8..2fc03f162 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -169,7 +169,7 @@ sal_Int32 FIB::GetData( Id nName ) { if( nName >= NS_rtf::LN_WIDENT && nName <= NS_rtf::LN_LCBSTTBFUSSR) return aFIBData[nName - NS_rtf::LN_WIDENT]; - OSL_ENSURE( false, "invalid index in FIB"); + OSL_FAIL( "invalid index in FIB"); return -1; } @@ -950,7 +950,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap ) catch(const lang::IllegalArgumentException& rIllegal) { (void)rIllegal; - OSL_ENSURE( false, "IllegalArgumentException in DomainMapper_Impl::finishParagraph" ); + OSL_FAIL( "IllegalArgumentException in DomainMapper_Impl::finishParagraph" ); } catch(const uno::Exception& rEx) { @@ -1003,12 +1003,12 @@ void DomainMapper_Impl::appendTextPortion( const ::rtl::OUString& rString, Prope catch(const lang::IllegalArgumentException& rEx) { (void)rEx; - OSL_ENSURE( false, "IllegalArgumentException in DomainMapper_Impl::appendTextPortion" ); + OSL_FAIL( "IllegalArgumentException in DomainMapper_Impl::appendTextPortion" ); } catch(const uno::Exception& rEx) { (void)rEx; - OSL_ENSURE( false, "Exception in DomainMapper_Impl::appendTextPortion" ); + OSL_FAIL( "Exception in DomainMapper_Impl::appendTextPortion" ); } } } @@ -1078,7 +1078,7 @@ void DomainMapper_Impl::appendOLE( const ::rtl::OUString& rStreamName, OLEHandle catch( const uno::Exception& rEx ) { (void)rEx; - OSL_ENSURE( false, "Exception in creation of OLE object" ); + OSL_FAIL( "Exception in creation of OLE object" ); } } @@ -1237,7 +1237,7 @@ void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote ) } catch( uno::Exception& ) { - OSL_ENSURE( false, "exception in PushFootOrEndnote" ); + OSL_FAIL( "exception in PushFootOrEndnote" ); } } @@ -1274,7 +1274,7 @@ void DomainMapper_Impl::CreateRedline( uno::Reference< text::XTextRange > xRange catch( const uno::Exception & rEx ) { ( void ) rEx; - OSL_ENSURE( false, "Exception in makeRedline" ); + OSL_FAIL( "Exception in makeRedline" ); } } } @@ -1332,7 +1332,7 @@ void DomainMapper_Impl::PushAnnotation() } catch( uno::Exception& ) { - OSL_ENSURE( false, "exception in PushFootOrEndnote" ); + OSL_FAIL( "exception in PushFootOrEndnote" ); } } @@ -2761,7 +2761,7 @@ void DomainMapper_Impl::CloseFieldCommand() catch( uno::Exception& rEx) { (void)rEx; - OSL_ENSURE( false, "Exception in CloseFieldCommand()" ); + OSL_FAIL( "Exception in CloseFieldCommand()" ); } pContext->SetCommandCompleted(); } @@ -2927,11 +2927,11 @@ void DomainMapper_Impl::PopFieldContext() } catch(const lang::IllegalArgumentException& ) { - OSL_ENSURE( false, "IllegalArgumentException in PopFieldContext()" ); + OSL_FAIL( "IllegalArgumentException in PopFieldContext()" ); } catch(const uno::Exception& ) { - OSL_ENSURE( false, "exception in PopFieldContext()" ); + OSL_FAIL( "exception in PopFieldContext()" ); } } // diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index fa3d2e46d..7d18d8c6b 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -947,7 +947,7 @@ void GraphicImport::attribute(Id nName, Value & val) sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 10 ); sMessage += ::rtl::OString(" / 0x"); sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 16 ); - OSL_ENSURE( false, sMessage.getStr()) + OSL_FAIL( sMessage.getStr()) #endif ; } @@ -1110,7 +1110,7 @@ void GraphicImport::ProcessShapeOptions(Value& val) case NS_dff::LN_shpfPrint /*959*/: break; // rtf:shpfPrint default: - OSL_ENSURE( false, "shape option unsupported?"); + OSL_FAIL( "shape option unsupported?"); } } @@ -1233,7 +1233,7 @@ void GraphicImport::sprm(Sprm & rSprm) sMessage += ::rtl::OString::valueOf( sal_Int32( nSprmId ), 10 ); sMessage += ::rtl::OString(" / 0x"); sMessage += ::rtl::OString::valueOf( sal_Int32( nSprmId ), 16 ); - OSL_ENSURE( false, sMessage.getStr()) + OSL_FAIL( sMessage.getStr()) #endif ; } diff --git a/writerfilter/source/dmapper/MeasureHandler.cxx b/writerfilter/source/dmapper/MeasureHandler.cxx index b615251d0..de70521af 100644 --- a/writerfilter/source/dmapper/MeasureHandler.cxx +++ b/writerfilter/source/dmapper/MeasureHandler.cxx @@ -84,7 +84,7 @@ void MeasureHandler::attribute(Id rName, Value & rVal) } break; default: - OSL_ENSURE( false, "unknown attribute"); + OSL_FAIL( "unknown attribute"); } } diff --git a/writerfilter/source/dmapper/ModelEventListener.cxx b/writerfilter/source/dmapper/ModelEventListener.cxx index bb0de9920..71c6e1484 100644 --- a/writerfilter/source/dmapper/ModelEventListener.cxx +++ b/writerfilter/source/dmapper/ModelEventListener.cxx @@ -71,7 +71,7 @@ void ModelEventListener::notifyEvent( const document::EventObject& rEvent ) thro catch( const uno::Exception& rEx ) { (void)rEx; - OSL_ENSURE( false, "exception while updating indexes" ); + OSL_FAIL( "exception while updating indexes" ); } } } diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index bcc114286..4c4ca576f 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -135,7 +135,7 @@ void ListLevel::SetValue( Id nId, sal_Int32 nValue ) m_nTabstop = nValue; break; default: - OSL_ENSURE( false, "this line should never be reached"); + OSL_FAIL( "this line should never be reached"); } } @@ -397,7 +397,7 @@ void AbstractListDef::SetValue( sal_uInt32 nSprmId, sal_Int32 nValue ) m_nUnsigned = nValue; break; default: - OSL_ENSURE( false, "this line should never be reached"); + OSL_FAIL( "this line should never be reached"); } } @@ -609,7 +609,7 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper, } catch( const uno::Exception& rEx) { - OSL_ENSURE( false, "ListTable::CreateNumberingRules"); + OSL_FAIL( "ListTable::CreateNumberingRules"); } } @@ -744,7 +744,7 @@ void ListsManager::attribute( Id nName, Value& rVal ) sMessage += ::rtl::OString::valueOf( sal_Int32( nIntValue ), 10 ); sMessage += ::rtl::OString(" / 0x"); sMessage += ::rtl::OString::valueOf( sal_Int32( nIntValue ), 16 ); - OSL_ENSURE( false, sMessage.getStr()); // + OSL_FAIL( sMessage.getStr()); // #endif } } diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx index 84204a749..8f922fe63 100644 --- a/writerfilter/source/dmapper/OLEHandler.cxx +++ b/writerfilter/source/dmapper/OLEHandler.cxx @@ -130,7 +130,7 @@ void OLEHandler::attribute(Id rName, Value & rVal) } break; default: - OSL_ENSURE( false, "unknown attribute"); + OSL_FAIL( "unknown attribute"); } } @@ -180,7 +180,7 @@ void OLEHandler::sprm(Sprm & rSprm) break; default: { - OSL_ENSURE( false, "unknown attribute"); + OSL_FAIL( "unknown attribute"); } } } @@ -230,7 +230,7 @@ void OLEHandler::sprm(Sprm & rSprm) catch( const uno::Exception& rEx) { (void)rEx; - OSL_ENSURE(false, "exception in OLEHandler::createOLEObject"); + OSL_FAIL("exception in OLEHandler::createOLEObject"); } return sRet; } diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index ea3de1404..c0120cac4 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -566,7 +566,7 @@ uno::Reference< text::XTextColumns > SectionPropertyMap::ApplyColumnProperties( } catch( const uno::Exception& ) { - OSL_ENSURE( false, "Exception in SectionPropertyMap::ApplyColumnProperties"); + OSL_FAIL( "Exception in SectionPropertyMap::ApplyColumnProperties"); } return xColumns; } @@ -789,7 +789,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) } catch( const uno::Exception& ) { - OSL_ENSURE( false, "Exception in SectionPropertyMap::CloseSectionGroup"); + OSL_FAIL( "Exception in SectionPropertyMap::CloseSectionGroup"); } } } @@ -956,7 +956,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) } catch( const uno::Exception& rEx) { - OSL_ENSURE( false, "Exception in SectionPropertyMap::CloseSectionGroup"); + OSL_FAIL( "Exception in SectionPropertyMap::CloseSectionGroup"); (void)rEx; } } @@ -975,7 +975,7 @@ void SectionPropertyMap::_ApplyProperties( uno::Reference< beans::XPropertySet > } catch( const uno::Exception& ) { - OSL_ENSURE( false, "Exception in <PageStyle>::setPropertyValue"); + OSL_FAIL( "Exception in <PageStyle>::setPropertyValue"); } ++aMapIter; } @@ -1141,7 +1141,7 @@ bool TablePropertyMap::getValue( TablePropertyMapTarget eWhich, sal_Int32& nFill } else { - OSL_ENSURE( false, "invalid TablePropertyMapTarget"); + OSL_FAIL( "invalid TablePropertyMapTarget"); return false; } } @@ -1155,7 +1155,7 @@ void TablePropertyMap::setValue( TablePropertyMapTarget eWhich, sal_Int32 nSet ) m_aValidValues[eWhich].nValue = nSet; } else - OSL_ENSURE( false, "invalid TablePropertyMapTarget"); + OSL_FAIL( "invalid TablePropertyMapTarget"); } diff --git a/writerfilter/source/dmapper/SectionColumnHandler.cxx b/writerfilter/source/dmapper/SectionColumnHandler.cxx index bab754843..f32187f00 100644 --- a/writerfilter/source/dmapper/SectionColumnHandler.cxx +++ b/writerfilter/source/dmapper/SectionColumnHandler.cxx @@ -74,7 +74,7 @@ void SectionColumnHandler::attribute(Id rName, Value & rVal) aTempColumn.nSpace = ConversionHelper::convertTwipToMM100( nIntValue ); break; default: - OSL_ENSURE( false, "SectionColumnHandler: unknown attribute"); + OSL_FAIL( "SectionColumnHandler: unknown attribute"); } } @@ -94,7 +94,7 @@ void SectionColumnHandler::sprm(Sprm & rSprm) } break; default: - OSL_ENSURE( false, "SectionColumnHandler: unknown sprm"); + OSL_FAIL( "SectionColumnHandler: unknown sprm"); } } } //namespace dmapper diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx index b8b6d3350..7674d38a7 100644 --- a/writerfilter/source/dmapper/SettingsTable.cxx +++ b/writerfilter/source/dmapper/SettingsTable.cxx @@ -211,7 +211,7 @@ void SettingsTable::sprm(Sprm& rSprm) break; default: { - OSL_ENSURE( false, "unknown sprmid in SettingsTable::sprm()"); + OSL_FAIL( "unknown sprmid in SettingsTable::sprm()"); } } diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index b426973bf..837608d1b 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -822,7 +822,7 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable ) } catch( const uno::RuntimeException& ) { - OSL_ENSURE( false, "Styles parent could not be set"); + OSL_FAIL( "Styles parent could not be set"); } } else if( bParaStyle ) @@ -991,12 +991,12 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable ) aMessage += sTemp; } #endif - OSL_ENSURE( false, aMessage.getStr()); + OSL_FAIL( aMessage.getStr()); } catch( const uno::Exception& rEx) { (void) rEx; - OSL_ENSURE( false, "Some style properties could not be set"); + OSL_FAIL( "Some style properties could not be set"); } } if(bInsert) @@ -1017,7 +1017,7 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable ) catch( uno::Exception& rEx) { (void)rEx; - OSL_ENSURE( false, "Styles could not be imported completely"); + OSL_FAIL( "Styles could not be imported completely"); } #ifdef DEBUG_DOMAINMAPPER @@ -1309,7 +1309,7 @@ void StyleSheetTable::applyDefaults(bool bParaProperties) } catch( const uno::Exception& ) { - OSL_ENSURE( false, "setPropertyValue exception"); + OSL_FAIL( "setPropertyValue exception"); } } } @@ -1324,7 +1324,7 @@ void StyleSheetTable::applyDefaults(bool bParaProperties) } catch( const uno::Exception& ) { - OSL_ENSURE( false, "setPropertyValue exception"); + OSL_FAIL( "setPropertyValue exception"); } } } @@ -1383,7 +1383,7 @@ void StyleSheetTable::applyDefaults(bool bParaProperties) catch( const uno::Exception& rEx ) { (void)rEx; - OSL_ENSURE( false, "Exception in StyleSheetTable::getOrCreateCharStyle - Style::setPropertyValue"); + OSL_FAIL( "Exception in StyleSheetTable::getOrCreateCharStyle - Style::setPropertyValue"); } ++aCharPropIter; } @@ -1393,7 +1393,7 @@ void StyleSheetTable::applyDefaults(bool bParaProperties) catch( const uno::Exception& rEx ) { (void)rEx; - OSL_ENSURE( false, "Exception in StyleSheetTable::getOrCreateCharStyle"); + OSL_FAIL( "Exception in StyleSheetTable::getOrCreateCharStyle"); } return sListLabel; diff --git a/writerfilter/source/dmapper/TDefTableHandler.cxx b/writerfilter/source/dmapper/TDefTableHandler.cxx index 27209cfc3..8cd08b537 100644 --- a/writerfilter/source/dmapper/TDefTableHandler.cxx +++ b/writerfilter/source/dmapper/TDefTableHandler.cxx @@ -131,7 +131,7 @@ void TDefTableHandler::attribute(Id rName, Value & rVal) // ignored break; default: - OSL_ENSURE(false, "unknown attribute"); + OSL_FAIL("unknown attribute"); } } |