From 73b70448be98b2617461d05b3ade04c35af9a535 Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Sun, 7 May 2017 07:05:22 +1000 Subject: tdf#43157: convert chart2 tools source from OSL_ASSERT to assert Change-Id: Ib55bb437ff7228d12fa2b6c37fb71242f3a136b4 --- chart2/source/tools/AxisHelper.cxx | 4 ++-- chart2/source/tools/CachedDataSequence.cxx | 6 +++--- chart2/source/tools/CharacterProperties.cxx | 2 +- chart2/source/tools/CommonConverters.cxx | 2 +- chart2/source/tools/ConfigColorScheme.cxx | 2 +- chart2/source/tools/DiagramHelper.cxx | 22 +++++++++++----------- chart2/source/tools/InternalData.cxx | 8 ++++---- chart2/source/tools/InternalDataProvider.cxx | 8 ++++---- .../tools/MeanValueRegressionCurveCalculator.cxx | 2 +- chart2/source/tools/PropertyHelper.cxx | 4 ++-- chart2/source/tools/RelativePositionHelper.cxx | 2 +- chart2/source/tools/ResourceManager.cxx | 2 +- chart2/source/tools/StatisticsHelper.cxx | 2 +- 13 files changed, 33 insertions(+), 33 deletions(-) (limited to 'chart2') diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index 473d1eed8015..d7921c9fb8b1 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -351,7 +351,7 @@ Reference< XAxis > AxisHelper::createAxis( Reference< XAxis > xAxis( xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.chart2.Axis", xContext ), uno::UNO_QUERY ); - OSL_ASSERT( xAxis.is()); + assert( xAxis.is()); if( xAxis.is()) { xCooSys->setAxisByDimension( nDimensionIndex, xAxis, nAxisIndex ); @@ -439,7 +439,7 @@ void AxisHelper::showAxis( sal_Int32 nDimensionIndex, bool bMainAxis xAxis.set( AxisHelper::createAxis( nDimensionIndex, bMainAxis, xDiagram, xContext, pRefSizeProvider ) ); } - OSL_ASSERT( xAxis.is()); + assert( xAxis.is()); if( !bNewAxisCreated ) //default is true already if created AxisHelper::makeAxisVisible( xAxis ); } diff --git a/chart2/source/tools/CachedDataSequence.cxx b/chart2/source/tools/CachedDataSequence.cxx index 53c5705d6d44..f1ad78f7fbfc 100644 --- a/chart2/source/tools/CachedDataSequence.cxx +++ b/chart2/source/tools/CachedDataSequence.cxx @@ -150,7 +150,7 @@ Sequence< double > CachedDataSequence::Impl_getNumericalData() const } else { - OSL_ASSERT( m_eCurrentDataType == MIXED ); + assert( m_eCurrentDataType == MIXED ); const Any * pMixedArray = m_aMixedSequence.getConstArray(); std::transform( pMixedArray, pMixedArray + nSize, pResultArray, @@ -180,7 +180,7 @@ Sequence< OUString > CachedDataSequence::Impl_getTextualData() const } else { - OSL_ASSERT( m_eCurrentDataType == MIXED ); + assert( m_eCurrentDataType == MIXED ); const Any * pMixedArray = m_aMixedSequence.getConstArray(); std::transform( pMixedArray, pMixedArray + nSize, pResultArray, @@ -211,7 +211,7 @@ Sequence< Any > CachedDataSequence::Impl_getMixedData() const } else { - OSL_ASSERT( m_eCurrentDataType == TEXTUAL ); + assert( m_eCurrentDataType == TEXTUAL ); const OUString * pMixedArray = m_aTextualSequence.getConstArray(); std::transform( pMixedArray, pMixedArray + nSize, pResultArray, diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx index 663f3b9c96a2..223ef040dc4f 100644 --- a/chart2/source/tools/CharacterProperties.cxx +++ b/chart2/source/tools/CharacterProperties.cxx @@ -501,7 +501,7 @@ awt::FontDescriptor CharacterProperties::createFontDescriptorFromPropertySet( aValues[ i++ ] >>= aResult.Underline; aValues[ i++ ] >>= aResult.Weight; aValues[ i++ ] >>= aResult.WordLineMode; - OSL_ASSERT( i == aValues.getLength()); + assert( i == aValues.getLength()); return aResult; } diff --git a/chart2/source/tools/CommonConverters.cxx b/chart2/source/tools/CommonConverters.cxx index 436c1050ac6c..3c749d5d57f8 100644 --- a/chart2/source/tools/CommonConverters.cxx +++ b/chart2/source/tools/CommonConverters.cxx @@ -421,7 +421,7 @@ uno::Sequence< double > DataSequenceToDoubleSequence( const uno::Reference< data::XDataSequence >& xDataSequence ) { uno::Sequence< double > aResult; - OSL_ASSERT( xDataSequence.is()); + assert( xDataSequence.is()); if(!xDataSequence.is()) return aResult; diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx index e4792d415ecf..b61b84d29f45 100644 --- a/chart2/source/tools/ConfigColorScheme.cxx +++ b/chart2/source/tools/ConfigColorScheme.cxx @@ -125,7 +125,7 @@ void ConfigColorScheme::retrieveConfigColors() new impl::ChartConfigItem( *this )); m_apChartConfigItem->addPropertyNotification( aSeriesPropName ); } - OSL_ASSERT( m_apChartConfigItem.get()); + assert( m_apChartConfigItem.get()); if( ! m_apChartConfigItem.get()) return; diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index 3bc8e462a839..a5958fa8ddee 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -291,7 +291,7 @@ void DiagramHelper::setStackMode( //iterate through all series in this chart type uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY ); - OSL_ASSERT( xDataSeriesContainer.is()); + assert( xDataSeriesContainer.is()); if( !xDataSeriesContainer.is() ) continue; @@ -380,7 +380,7 @@ StackMode DiagramHelper::getStackModeFromChartType( chart2::StackingDirection eCurrentDirection = eCommonDirection; // property is not MAYBEVOID bool bSuccess = ( xProp->getPropertyValue( "StackingDirection" ) >>= eCurrentDirection ); - OSL_ASSERT( bSuccess ); + assert( bSuccess ); (void)(bSuccess); // avoid warning in non-debug builds if( ! bDirectionInitialized ) { @@ -532,7 +532,7 @@ void DiagramHelper::replaceCoordinateSystem( const Reference< XCoordinateSystem > & xCooSysToReplace, const Reference< XCoordinateSystem > & xReplacement ) { - OSL_ASSERT( xDiagram.is()); + assert( xDiagram.is()); if( ! xDiagram.is()) return; @@ -645,7 +645,7 @@ uno::Reference< XChartType > DiagramHelper::getChartTypeOfSeries( //iterate through all chart types in the current coordinate system uno::Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY ); - OSL_ASSERT( xChartTypeContainer.is()); + assert( xChartTypeContainer.is()); if( !xChartTypeContainer.is() ) continue; uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() ); @@ -655,7 +655,7 @@ uno::Reference< XChartType > DiagramHelper::getChartTypeOfSeries( //iterate through all series in this chart type uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY ); - OSL_ASSERT( xDataSeriesContainer.is()); + assert( xDataSeriesContainer.is()); if( !xDataSeriesContainer.is() ) continue; @@ -781,14 +781,14 @@ std::vector< Reference< XAxis > > lcl_getAxisHoldingCategoriesFromDiagram( for( sal_Int32 i=0; i xCooSys( aCooSysSeq[i] ); - OSL_ASSERT( xCooSys.is()); + assert( xCooSys.is()); for( sal_Int32 nN = xCooSys->getDimension(); nN--; ) { const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(nN); for(sal_Int32 nI=0; nI<=nMaximumScaleIndex; ++nI) { Reference< XAxis > xAxis = xCooSys->getAxisByDimension( nN,nI ); - OSL_ASSERT( xAxis.is()); + assert( xAxis.is()); if( xAxis.is()) { ScaleData aScaleData = xAxis->getScaleData(); @@ -828,14 +828,14 @@ bool DiagramHelper::isCategoryDiagram( for( sal_Int32 i=0; i xCooSys( aCooSysSeq[i] ); - OSL_ASSERT( xCooSys.is()); + assert( xCooSys.is()); for( sal_Int32 nN = xCooSys->getDimension(); nN--; ) { const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(nN); for(sal_Int32 nI=0; nI<=nMaximumScaleIndex; ++nI) { Reference< XAxis > xAxis = xCooSys->getAxisByDimension( nN,nI ); - OSL_ASSERT( xAxis.is()); + assert( xAxis.is()); if( xAxis.is()) { ScaleData aScaleData = xAxis->getScaleData(); @@ -1314,7 +1314,7 @@ bool lcl_moveSeriesOrCheckIfMoveIsAllowed( //iterate through all chart types in the current coordinate system uno::Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY ); - OSL_ASSERT( xChartTypeContainer.is()); + assert( xChartTypeContainer.is()); if( !xChartTypeContainer.is() ) continue; uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() ); @@ -1326,7 +1326,7 @@ bool lcl_moveSeriesOrCheckIfMoveIsAllowed( //iterate through all series in this chart type uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xCurrentChartType, uno::UNO_QUERY ); - OSL_ASSERT( xDataSeriesContainer.is()); + assert( xDataSeriesContainer.is()); if( !xDataSeriesContainer.is() ) continue; diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx index e24695621824..2e6e0f8ec8bf 100644 --- a/chart2/source/tools/InternalData.cxx +++ b/chart2/source/tools/InternalData.cxx @@ -307,7 +307,7 @@ bool InternalData::enlargeData( sal_Int32 nColumnCount, sal_Int32 nRowCount ) void InternalData::insertColumn( sal_Int32 nAfterIndex ) { // note: -1 is allowed, as we insert after the given index - OSL_ASSERT( nAfterIndex < m_nColumnCount && nAfterIndex >= -1 ); + assert( nAfterIndex < m_nColumnCount && nAfterIndex >= -1 ); if( nAfterIndex >= m_nColumnCount || nAfterIndex < -1 ) return; sal_Int32 nNewColumnCount = m_nColumnCount + 1; @@ -364,7 +364,7 @@ sal_Int32 InternalData::getColumnCount() const void InternalData::insertRow( sal_Int32 nAfterIndex ) { // note: -1 is allowed, as we insert after the given index - OSL_ASSERT( nAfterIndex < m_nRowCount && nAfterIndex >= -1 ); + assert( nAfterIndex < m_nRowCount && nAfterIndex >= -1 ); if( nAfterIndex >= m_nRowCount || nAfterIndex < -1 ) return; sal_Int32 nNewRowCount = m_nRowCount + 1; @@ -401,7 +401,7 @@ void InternalData::insertRow( sal_Int32 nAfterIndex ) void InternalData::deleteColumn( sal_Int32 nAtIndex ) { - OSL_ASSERT( nAtIndex < m_nColumnCount && nAtIndex >= 0 ); + assert( nAtIndex < m_nColumnCount && nAtIndex >= 0 ); if( nAtIndex >= m_nColumnCount || m_nColumnCount < 1 || nAtIndex < 0 ) return; sal_Int32 nNewColumnCount = m_nColumnCount - 1; @@ -435,7 +435,7 @@ void InternalData::deleteColumn( sal_Int32 nAtIndex ) void InternalData::deleteRow( sal_Int32 nAtIndex ) { - OSL_ASSERT( nAtIndex < m_nRowCount && nAtIndex >= 0 ); + assert( nAtIndex < m_nRowCount && nAtIndex >= 0 ); if( nAtIndex >= m_nRowCount || m_nRowCount < 1 || nAtIndex < 0 ) return; sal_Int32 nNewRowCount = m_nRowCount - 1; diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx index fa77624adc44..da95f3486543 100644 --- a/chart2/source/tools/InternalDataProvider.cxx +++ b/chart2/source/tools/InternalDataProvider.cxx @@ -712,7 +712,7 @@ Reference< chart2::data::XDataSource > SAL_CALL InternalDataProvider::createData return new DataSource( comphelper::containerToSequence(aComplexCategories) ); } - OSL_ASSERT( aRangeRepresentation == lcl_aCompleteRange ); + assert( aRangeRepresentation == lcl_aCompleteRange ); std::vector< Reference< chart2::data::XLabeledDataSequence > > aResultLSeqVec; @@ -799,7 +799,7 @@ Reference< chart2::data::XDataSequence > SAL_CALL InternalDataProvider::createDa { if( aRangeRepresentation.match( lcl_aCategoriesRangeName )) { - OSL_ASSERT( aRangeRepresentation == lcl_aCategoriesRangeName );//it is not expected nor implemented that only parts of the categories are really requested + assert( aRangeRepresentation == lcl_aCategoriesRangeName );//it is not expected nor implemented that only parts of the categories are really requested // categories return createDataSequenceAndAddToMap( lcl_aCategoriesRangeName, lcl_aCategoriesRoleName ); @@ -846,7 +846,7 @@ sal_Bool SAL_CALL InternalDataProvider::hasDataByRangeRepresentation( const OUSt if( aRange.match( lcl_aCategoriesRangeName )) { - OSL_ASSERT( aRange == lcl_aCategoriesRangeName );//it is not expected nor implemented that only parts of the categories are really requested + assert( aRange == lcl_aCategoriesRangeName );//it is not expected nor implemented that only parts of the categories are really requested bResult = true; } else if( aRange.match( lcl_aLabelRangePrefix )) @@ -1155,7 +1155,7 @@ OUString SAL_CALL InternalDataProvider::convertRangeToXML( const OUString& aRang // @todo: add this information in the range representation strings if( aRangeRepresentation.match( lcl_aCategoriesRangeName )) { - OSL_ASSERT( aRangeRepresentation == lcl_aCategoriesRangeName );//it is not expected nor implemented that only parts of the categories are really requested + assert( aRangeRepresentation == lcl_aCategoriesRangeName );//it is not expected nor implemented that only parts of the categories are really requested aRange.aUpperLeft.bIsEmpty = false; if( m_bDataInColumns ) { diff --git a/chart2/source/tools/MeanValueRegressionCurveCalculator.cxx b/chart2/source/tools/MeanValueRegressionCurveCalculator.cxx index 6d662c1d252d..dcd9851b7058 100644 --- a/chart2/source/tools/MeanValueRegressionCurveCalculator.cxx +++ b/chart2/source/tools/MeanValueRegressionCurveCalculator.cxx @@ -80,7 +80,7 @@ void SAL_CALL MeanValueRegressionCurveCalculator::recalculateRegression( fErrorSum += (v*v); } } - OSL_ASSERT( fErrorSum >= 0.0 ); + assert( fErrorSum >= 0.0 ); m_fCorrelationCoeffitient = sqrt( fErrorSum / (nMax - 1 )); } } diff --git a/chart2/source/tools/PropertyHelper.cxx b/chart2/source/tools/PropertyHelper.cxx index 8741037b6014..5b613629032b 100644 --- a/chart2/source/tools/PropertyHelper.cxx +++ b/chart2/source/tools/PropertyHelper.cxx @@ -41,7 +41,7 @@ struct lcl_EqualsElement : public std::unary_function< OUString, bool > explicit lcl_EqualsElement( const Any & rValue, const Reference< container::XNameAccess > & xAccess ) : m_aValue( rValue ), m_xAccess( xAccess ) { - OSL_ASSERT( m_xAccess.is()); + assert( m_xAccess.is()); } bool operator() ( const OUString & rName ) @@ -155,7 +155,7 @@ OUString lcl_addNamedPropertyUniqueNameToTable( aUniqueName = rPrefix + OUString::number( nIndex ); } - OSL_ASSERT( !aUniqueName.isEmpty()); + assert( !aUniqueName.isEmpty()); xNameContainer->insertByName( aUniqueName, rValue ); return aUniqueName; } diff --git a/chart2/source/tools/RelativePositionHelper.cxx b/chart2/source/tools/RelativePositionHelper.cxx index a205d75d6448..0c7d6171bdf2 100644 --- a/chart2/source/tools/RelativePositionHelper.cxx +++ b/chart2/source/tools/RelativePositionHelper.cxx @@ -304,7 +304,7 @@ bool RelativePositionHelper::centerGrow( } // anchor must not be changed - OSL_ASSERT( rInOutPosition.Anchor == aPos.Anchor ); + assert( rInOutPosition.Anchor == aPos.Anchor ); if( rInOutPosition.Primary == aPos.Primary && rInOutPosition.Secondary == aPos.Secondary && diff --git a/chart2/source/tools/ResourceManager.cxx b/chart2/source/tools/ResourceManager.cxx index 3f3fb615697a..07b27fc61a8c 100644 --- a/chart2/source/tools/ResourceManager.cxx +++ b/chart2/source/tools/ResourceManager.cxx @@ -30,7 +30,7 @@ ResMgr & ResourceManager::getResourceManager() static ResMgr * pResourceManager = nullptr; if( ! pResourceManager ) pResourceManager = ResMgr::CreateResMgr("chartcontroller"); - OSL_ASSERT( pResourceManager ); + assert( pResourceManager ); return *pResourceManager; } diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx index f7f1ff7ef1d8..94aa4faedd0e 100644 --- a/chart2/source/tools/StatisticsHelper.cxx +++ b/chart2/source/tools/StatisticsHelper.cxx @@ -313,7 +313,7 @@ Reference< beans::XPropertySet > StatisticsHelper::addErrorBars( xErrorBar.set( new ErrorBar ); } - OSL_ASSERT( xErrorBar.is()); + assert( xErrorBar.is()); if( xErrorBar.is()) { xErrorBar->setPropertyValue( "ErrorBarStyle", uno::Any( nStyle )); -- cgit