Kaydet (Commit) 671b7378 authored tarafından Radu Ioan's avatar Radu Ioan Kaydeden (comit) Fridrich Strba

fdo#43157 - Clean up OSL_ASSERT, DBG_ASSERT

 - replaced osl_trace with sal_info
 - replaced dbg_* with sal_*

Change-Id: I4db4a2db0f4f2e9913826f428ba129099b1ac8a8
Reviewed-on: https://gerrit.libreoffice.org/3526Reviewed-by: 's avatarFridrich Strba <fridrich@documentfoundation.org>
Tested-by: 's avatarFridrich Strba <fridrich@documentfoundation.org>
üst ff446465
...@@ -165,7 +165,7 @@ SvXMLImportContext* SchXMLImportHelper::CreateChartContext( ...@@ -165,7 +165,7 @@ SvXMLImportContext* SchXMLImportHelper::CreateChartContext(
} }
else else
{ {
OSL_FAIL( "No valid XChartDocument given as XModel" ); SAL_WARN("xmloff.chart", "No valid XChartDocument given as XModel" );
pContext = new SvXMLImportContext( rImport, nPrefix, rLocalName ); pContext = new SvXMLImportContext( rImport, nPrefix, rLocalName );
} }
...@@ -436,12 +436,7 @@ void SchXMLImportHelper::DeleteDataSeries( ...@@ -436,12 +436,7 @@ void SchXMLImportHelper::DeleteDataSeries(
} }
catch( const uno::Exception & ex ) catch( const uno::Exception & ex )
{ {
(void)ex; // avoid warning for pro build SAL_WARN("xmloff.chart", "Exception caught. Type: " << OUString::createFromAscii( typeid( ex ).name()) << ", Message: " << ex.Message);
OSL_FAIL( OUStringToOString(
OUString( "Exception caught. Type: " ) +
OUString::createFromAscii( typeid( ex ).name()) +
OUString( ", Message: " ) +
ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
} }
} }
...@@ -520,12 +515,7 @@ Reference< chart2::XDataSeries > SchXMLImportHelper::GetNewDataSeries( ...@@ -520,12 +515,7 @@ Reference< chart2::XDataSeries > SchXMLImportHelper::GetNewDataSeries(
} }
catch( const uno::Exception & ex ) catch( const uno::Exception & ex )
{ {
(void)ex; // avoid warning for pro build SAL_WARN("xmloff.chart", "Exception caught. Type: " << OUString::createFromAscii( typeid( ex ).name()) << ", Message: " << ex.Message);
OSL_FAIL( OUStringToOString(
OUString( "Exception caught. Type: " ) +
OUString::createFromAscii( typeid( ex ).name()) +
OUString( ", Message: " ) +
ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
} }
return xResult; return xResult;
} }
...@@ -678,12 +668,8 @@ void SAL_CALL SchXMLImport::setTargetDocument( const uno::Reference< lang::XComp ...@@ -678,12 +668,8 @@ void SAL_CALL SchXMLImport::setTargetDocument( const uno::Reference< lang::XComp
} }
catch( const uno::Exception & rEx ) catch( const uno::Exception & rEx )
{ {
#ifdef DBG_UTIL
OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US)); OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US));
OSL_TRACE("SchXMLChartContext::StartElement(): Exception caught: %s", aBStr.getStr()); SAL_INFO("xmloff.chart", "SchXMLChartContext::StartElement(): Exception caught: " << aBStr);
#else
(void)rEx; // avoid warning for pro build
#endif
} }
} }
......
...@@ -105,7 +105,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu ...@@ -105,7 +105,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu
} }
catch(const beans::UnknownPropertyException&) catch(const beans::UnknownPropertyException&)
{ {
OSL_TRACE( "Property HasLegend not found" ); SAL_INFO("xmloff.chart", "Property HasLegend not found" );
} }
} }
...@@ -113,7 +113,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu ...@@ -113,7 +113,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu
uno::Reference< beans::XPropertySet > xLegendProps( xLegendShape, uno::UNO_QUERY ); uno::Reference< beans::XPropertySet > xLegendProps( xLegendShape, uno::UNO_QUERY );
if( !xLegendShape.is() || !xLegendProps.is() ) if( !xLegendShape.is() || !xLegendProps.is() )
{ {
OSL_TRACE( "legend could not be created" ); SAL_INFO("xmloff.chart", "legend could not be created" );
return; return;
} }
...@@ -151,7 +151,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu ...@@ -151,7 +151,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu
} }
catch(const beans::UnknownPropertyException&) catch(const beans::UnknownPropertyException&)
{ {
OSL_TRACE( "Property Alignment (legend) not found" ); SAL_INFO("xmloff.chart", "Property Alignment (legend) not found" );
} }
} }
break; break;
......
...@@ -121,12 +121,8 @@ void SchXML3DSceneAttributesHelper::getCameraDefaultFromDiagram( const uno::Refe ...@@ -121,12 +121,8 @@ void SchXML3DSceneAttributesHelper::getCameraDefaultFromDiagram( const uno::Refe
} }
catch( const uno::Exception & rEx ) catch( const uno::Exception & rEx )
{ {
#ifdef DBG_UTIL
OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US)); OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US));
OSL_TRACE( "Exception caught for property NumberOfLines: %s", aBStr.getStr()); SAL_INFO("xmloff.chart", "Exception caught for property NumberOfLines: " << aBStr);
#else
(void)rEx; // avoid warning for pro build
#endif
} }
} }
...@@ -184,7 +180,7 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext( ...@@ -184,7 +180,7 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext(
maSceneImportHelper.getCameraDefaultFromDiagram( mxDiagram ); maSceneImportHelper.getCameraDefaultFromDiagram( mxDiagram );
} }
DBG_ASSERT( mxDiagram.is(), "Couldn't get XDiagram" ); SAL_WARN_IF( !mxDiagram.is(),"xmloff.chart", "Couldn't get XDiagram" );
// turn off all axes initially // turn off all axes initially
uno::Any aFalseBool; uno::Any aFalseBool;
...@@ -231,7 +227,7 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext( ...@@ -231,7 +227,7 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext(
} }
catch( const beans::UnknownPropertyException & ) catch( const beans::UnknownPropertyException & )
{ {
OSL_FAIL( "Property required by service not supported" ); SAL_WARN("xmloff.chart", "Property required by service not supported" );
} }
} }
} }
...@@ -315,7 +311,7 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri ...@@ -315,7 +311,7 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri
} }
catch( const beans::UnknownPropertyException & ) catch( const beans::UnknownPropertyException & )
{ {
SAL_WARN( "xmloff.chart", "Properties missing" ); SAL_WARN("xmloff.chart", "Properties missing" );
} }
} }
} }
...@@ -415,12 +411,8 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri ...@@ -415,12 +411,8 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri
} }
catch( const uno::Exception & rEx ) catch( const uno::Exception & rEx )
{ {
#ifdef DBG_UTIL
OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US)); OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US));
OSL_TRACE("PlotAreaContext:EndElement(): Exception caught: %s", aBStr.getStr()); SAL_INFO("xmloff.chart", "PlotAreaContext:EndElement(): Exception caught: " << aBStr);
#else
(void)rEx; // avoid warning for pro build
#endif
} }
} // if } // if
...@@ -589,12 +581,8 @@ void SchXMLPlotAreaContext::EndElement() ...@@ -589,12 +581,8 @@ void SchXMLPlotAreaContext::EndElement()
} }
catch( const uno::Exception & rEx ) catch( const uno::Exception & rEx )
{ {
#ifdef DBG_UTIL
OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US)); OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US));
OSL_TRACE( "Exception caught for property NumberOfLines: %s", aBStr.getStr()); SAL_INFO("xmloff.chart", "Exception caught for property NumberOfLines: " << aBStr);
#else
(void)rEx; // avoid warning for pro build
#endif
} }
} }
...@@ -609,12 +597,8 @@ void SchXMLPlotAreaContext::EndElement() ...@@ -609,12 +597,8 @@ void SchXMLPlotAreaContext::EndElement()
} }
catch( const uno::Exception & rEx ) catch( const uno::Exception & rEx )
{ {
#ifdef DBG_UTIL
OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US)); OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US));
OSL_TRACE("Exception caught for property Volume: %s", aBStr.getStr()); SAL_INFO("xmloff.chart", "Exception caught for property Volume: " << aBStr);
#else
(void)rEx; // avoid warning for pro build
#endif
} }
} }
} }
...@@ -1365,7 +1349,7 @@ void SchXMLEquationContext::StartElement( const uno::Reference< xml::sax::XAttri ...@@ -1365,7 +1349,7 @@ void SchXMLEquationContext::StartElement( const uno::Reference< xml::sax::XAttri
xEqProp->setPropertyValue( OUString( "RelativePosition" ), xEqProp->setPropertyValue( OUString( "RelativePosition" ),
uno::makeAny( aRelPos )); uno::makeAny( aRelPos ));
} }
OSL_ASSERT( mrRegressionStyle.meType == DataRowPointStyle::REGRESSION ); SAL_WARN_IF( mrRegressionStyle.meType != DataRowPointStyle::REGRESSION, "xmloff.chart", "mrRegressionStyle.meType != DataRowPointStyle::REGRESSION" );
mrRegressionStyle.m_xEquationProperties.set( xEqProp ); mrRegressionStyle.m_xEquationProperties.set( xEqProp );
} }
} }
......
...@@ -282,7 +282,7 @@ SchXMLSeries2Context::SchXMLSeries2Context( ...@@ -282,7 +282,7 @@ SchXMLSeries2Context::SchXMLSeries2Context(
SchXMLSeries2Context::~SchXMLSeries2Context() SchXMLSeries2Context::~SchXMLSeries2Context()
{ {
OSL_ASSERT( maPostponedSequences.empty()); SAL_WARN_IF( !maPostponedSequences.empty(), "xmloff.chart", "maPostponedSequences is NULL");
} }
void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList ) void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
...@@ -355,7 +355,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib ...@@ -355,7 +355,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
try try
{ {
OSL_ASSERT( mxNewDoc.is()); SAL_WARN_IF( !mxNewDoc.is(), "xmloff.chart", "mxNewDoc is NULL");
if( m_rGlobalSeriesImportInfo.rbAllRangeAddressesAvailable && ! bHasRange ) if( m_rGlobalSeriesImportInfo.rbAllRangeAddressesAvailable && ! bHasRange )
m_rGlobalSeriesImportInfo.rbAllRangeAddressesAvailable = sal_False; m_rGlobalSeriesImportInfo.rbAllRangeAddressesAvailable = sal_False;
...@@ -445,12 +445,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib ...@@ -445,12 +445,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
} }
catch( const uno::Exception & ex ) catch( const uno::Exception & ex )
{ {
(void)ex; // avoid warning for pro build SAL_WARN("xmloff.chart", "Exception caught. Type: " << OUString::createFromAscii( typeid( ex ).name()) << ", Message: " << ex.Message);
OSL_FAIL( OUStringToOString(
OUString( "Exception caught. Type: " ) +
OUString::createFromAscii( typeid( ex ).name()) +
OUString( ", Message: " ) +
ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
} }
//init mbSymbolSizeIsMissingInFile: //init mbSymbolSizeIsMissingInFile:
...@@ -840,9 +835,7 @@ void SchXMLSeries2Context::setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDe ...@@ -840,9 +835,7 @@ void SchXMLSeries2Context::setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDe
} }
catch( const uno::Exception & rEx ) catch( const uno::Exception & rEx )
{ {
(void)rEx; // avoid warning for pro build SAL_INFO("xmloff.chart", "Exception caught during setting styles to series: " << rEx.Message );
OSL_TRACE( "Exception caught during setting styles to series: %s",
OUStringToOString( rEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
} }
} }
} }
...@@ -924,7 +917,7 @@ void SchXMLSeries2Context::setStylesToStatisticsObjects( SeriesDefaultsAndStyles ...@@ -924,7 +917,7 @@ void SchXMLSeries2Context::setStylesToStatisticsObjects( SeriesDefaultsAndStyles
// not exist here // not exist here
if( iStyle->meType == DataRowPointStyle::REGRESSION && iStyle->m_xEquationProperties.is()) if( iStyle->meType == DataRowPointStyle::REGRESSION && iStyle->m_xEquationProperties.is())
{ {
OSL_ASSERT( iStyle->m_xSeries.is()); SAL_WARN_IF( !iStyle->m_xSeries.is(), "xmloff.chart", "iStyle->m_xSeries is NULL");
Reference< chart2::XRegressionCurve > xRegCurve( SchXMLTools::getRegressionCurve( iStyle->m_xSeries )); Reference< chart2::XRegressionCurve > xRegCurve( SchXMLTools::getRegressionCurve( iStyle->m_xSeries ));
if( xRegCurve.is()) if( xRegCurve.is())
xRegCurve->setEquationProperties( iStyle->m_xEquationProperties ); xRegCurve->setEquationProperties( iStyle->m_xEquationProperties );
...@@ -932,9 +925,7 @@ void SchXMLSeries2Context::setStylesToStatisticsObjects( SeriesDefaultsAndStyles ...@@ -932,9 +925,7 @@ void SchXMLSeries2Context::setStylesToStatisticsObjects( SeriesDefaultsAndStyles
} }
catch( const uno::Exception & rEx ) catch( const uno::Exception & rEx )
{ {
(void)rEx; // avoid warning for pro build SAL_INFO("xmloff.chart", "Exception caught during setting styles to series: " << rEx.Message );
OSL_TRACE( "Exception caught during setting styles to series: %s",
OUStringToOString( rEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
} }
} }
} }
...@@ -1030,9 +1021,7 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri ...@@ -1030,9 +1021,7 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri
} }
catch( const uno::Exception & rEx ) catch( const uno::Exception & rEx )
{ {
(void)rEx; // avoid warning for pro build SAL_INFO("xmloff.chart", "Exception caught during setting styles to data points: " << rEx.Message );
OSL_TRACE( "Exception caught during setting styles to data points: %s",
OUStringToOString( rEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
} }
} }
} // styles iterator } // styles iterator
......
...@@ -65,11 +65,7 @@ using ::com::sun::star::uno::Sequence; ...@@ -65,11 +65,7 @@ using ::com::sun::star::uno::Sequence;
} }
catch( const uno::Exception & ex ) catch( const uno::Exception & ex )
{ {
(void)ex; // avoid warning for pro build SAL_WARN("xmloff.chart", "Exception caught. Type: " << OUString::createFromAscii( typeid( ex ).name() ) << ", Message: " << ex.Message );
OSL_FAIL( OUStringToOString( "Exception caught. Type: " +
OUString::createFromAscii( typeid( ex ).name() ) +
", Message: " + ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
} }
return aResult; return aResult;
...@@ -121,7 +117,7 @@ uno::Reference< chart2::XChartType > lcl_getChartTypeOfSeries( ...@@ -121,7 +117,7 @@ uno::Reference< chart2::XChartType > lcl_getChartTypeOfSeries(
//iterate through all chart types in the current coordinate system //iterate through all chart types in the current coordinate system
uno::Reference< chart2::XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY ); uno::Reference< chart2::XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY );
OSL_ASSERT( xChartTypeContainer.is()); SAL_WARN_IF( !xChartTypeContainer.is(), "xmloff.chart", "xChartTypeContainer is NULL");
if( !xChartTypeContainer.is() ) if( !xChartTypeContainer.is() )
continue; continue;
uno::Sequence< uno::Reference< chart2::XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() ); uno::Sequence< uno::Reference< chart2::XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
...@@ -131,7 +127,7 @@ uno::Reference< chart2::XChartType > lcl_getChartTypeOfSeries( ...@@ -131,7 +127,7 @@ uno::Reference< chart2::XChartType > lcl_getChartTypeOfSeries(
//iterate through all series in this chart type //iterate through all series in this chart type
uno::Reference< chart2::XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY ); uno::Reference< chart2::XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
OSL_ASSERT( xDataSeriesContainer.is()); SAL_WARN_IF( !xDataSeriesContainer.is(), "xmloff.chart", "xDataSeriesContainer is NULL");
if( !xDataSeriesContainer.is() ) if( !xDataSeriesContainer.is() )
continue; continue;
...@@ -201,9 +197,7 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPISeriesProp ...@@ -201,9 +197,7 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPISeriesProp
} }
catch( const uno::Exception & rEx ) catch( const uno::Exception & rEx )
{ {
(void)rEx; // avoid warning for pro build SAL_INFO("xmloff.chart", "Exception caught SchXMLSeriesHelper::createOldAPISeriesPropertySet: " << rEx.Message );
OSL_TRACE( "Exception caught SchXMLSeriesHelper::createOldAPISeriesPropertySet: %s",
OUStringToOString( rEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
} }
} }
...@@ -239,10 +233,7 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPIDataPointP ...@@ -239,10 +233,7 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPIDataPointP
} }
catch( const uno::Exception & rEx ) catch( const uno::Exception & rEx )
{ {
(void)rEx; // avoid warning for pro build SAL_INFO("xmloff.chart", "Exception caught SchXMLSeriesHelper::createOldAPIDataPointPropertySet: " << rEx.Message );
OSL_TRACE( "Exception caught SchXMLSeriesHelper::createOldAPIDataPointPropertySet: %s",
OUStringToOString( rEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
} }
} }
......
...@@ -125,7 +125,7 @@ void lcl_fillRangeMapping( ...@@ -125,7 +125,7 @@ void lcl_fillRangeMapping(
{ {
if( nCol == 0 && rTable.bHasHeaderColumn ) if( nCol == 0 && rTable.bHasHeaderColumn )
{ {
OSL_ASSERT( static_cast< sal_Int32 >( nRow ) == nRowOffset ); SAL_WARN_IF( static_cast< sal_Int32 >( nRow ) != nRowOffset, "xmloff.chart", "nRow != nRowOffset" );
rOutRangeMap.insert( lcl_tOriginalRangeToInternalRangeMap::value_type( rOutRangeMap.insert( lcl_tOriginalRangeToInternalRangeMap::value_type(
aRangeId, lcl_aCategoriesRange )); aRangeId, lcl_aCategoriesRange ));
} }
...@@ -144,7 +144,7 @@ void lcl_fillRangeMapping( ...@@ -144,7 +144,7 @@ void lcl_fillRangeMapping(
{ {
if( nRow == 0 && rTable.bHasHeaderRow ) if( nRow == 0 && rTable.bHasHeaderRow )
{ {
OSL_ASSERT( static_cast< sal_Int32 >( nCol ) == nColOffset ); SAL_WARN_IF( static_cast< sal_Int32 >( nCol ) != nColOffset, "xmloff.chart", "nCol != nColOffset" );
rOutRangeMap.insert( lcl_tOriginalRangeToInternalRangeMap::value_type( rOutRangeMap.insert( lcl_tOriginalRangeToInternalRangeMap::value_type(
aRangeId, lcl_aCategoriesRange )); aRangeId, lcl_aCategoriesRange ));
} }
...@@ -308,9 +308,9 @@ void SchXMLTableContext::EndElement() ...@@ -308,9 +308,9 @@ void SchXMLTableContext::EndElement()
{ {
if( mbHasColumnPermutation ) if( mbHasColumnPermutation )
{ {
OSL_ASSERT( !mbHasRowPermutation ); SAL_WARN_IF( mbHasRowPermutation, "xmloff.chart", "mbHasColumnPermutation is true" );
::std::vector< sal_Int32 > aPermutation( lcl_SequenceToVector( maColumnPermutation )); ::std::vector< sal_Int32 > aPermutation( lcl_SequenceToVector( maColumnPermutation ));
OSL_ASSERT( !aPermutation.empty()); SAL_WARN_IF( aPermutation.empty(), "xmloff.chart", "aPermutation is NULL");
if( aPermutation.empty()) if( aPermutation.empty())
return; return;
...@@ -321,7 +321,7 @@ void SchXMLTableContext::EndElement() ...@@ -321,7 +321,7 @@ void SchXMLTableContext::EndElement()
bool bModified = false; bool bModified = false;
::std::vector< SchXMLCell > aModifiedRow; ::std::vector< SchXMLCell > aModifiedRow;
const size_t nPermSize = aPermutation.size(); const size_t nPermSize = aPermutation.size();
OSL_ASSERT( static_cast< sal_Int32 >( nPermSize ) - 1 == *(::std::max_element( aPermutation.begin(), aPermutation.end()))); SAL_WARN_IF( static_cast< sal_Int32 >( nPermSize ) - 1 != *(::std::max_element( aPermutation.begin(), aPermutation.end())), "xmloff.chart", "nPermSize - 1 != *(::std::max_element( aPermutation.begin(), aPermutation.end())");
const size_t nRowSize = aRowIt->size(); const size_t nRowSize = aRowIt->size();
const size_t nDestSize = ::std::min( nPermSize, nRowSize ); const size_t nDestSize = ::std::min( nPermSize, nRowSize );
for( size_t nDestinationIndex = 0; nDestinationIndex < nDestSize; ++nDestinationIndex ) for( size_t nDestinationIndex = 0; nDestinationIndex < nDestSize; ++nDestinationIndex )
...@@ -333,12 +333,12 @@ void SchXMLTableContext::EndElement() ...@@ -333,12 +333,12 @@ void SchXMLTableContext::EndElement()
// copy original on first real permutation // copy original on first real permutation
if( !bModified ) if( !bModified )
{ {
OSL_ASSERT( aModifiedRow.empty()); SAL_WARN_IF( !aModifiedRow.empty(), "xmloff.chart", "aModifiedRow is NOT NULL");
aModifiedRow.reserve( aRowIt->size()); aModifiedRow.reserve( aRowIt->size());
::std::copy( aRowIt->begin(), aRowIt->end(), ::std::back_inserter( aModifiedRow )); ::std::copy( aRowIt->begin(), aRowIt->end(), ::std::back_inserter( aModifiedRow ));
OSL_ASSERT( !aModifiedRow.empty()); SAL_WARN_IF( aModifiedRow.empty(), "xmloff.chart", "aModifiedRow is NULL");
} }
OSL_ASSERT( nDestinationIndex < aModifiedRow.size()); SAL_WARN_IF( nDestinationIndex >= aModifiedRow.size(), "xmloff.chart", "nDestinationIndex >= aModifiedRow.size()");
aModifiedRow[ nDestinationIndex ] = (*aRowIt)[ nSourceIndex ]; aModifiedRow[ nDestinationIndex ] = (*aRowIt)[ nSourceIndex ];
bModified = true; bModified = true;
} }
...@@ -351,13 +351,13 @@ void SchXMLTableContext::EndElement() ...@@ -351,13 +351,13 @@ void SchXMLTableContext::EndElement()
else if( mbHasRowPermutation ) else if( mbHasRowPermutation )
{ {
::std::vector< sal_Int32 > aPermutation( lcl_SequenceToVector( maRowPermutation )); ::std::vector< sal_Int32 > aPermutation( lcl_SequenceToVector( maRowPermutation ));
OSL_ASSERT( !aPermutation.empty()); SAL_WARN_IF( aPermutation.empty(), "xmloff.chart", "aPermutation is NULL");
if( aPermutation.empty()) if( aPermutation.empty())
return; return;
bool bModified = false; bool bModified = false;
const size_t nPermSize = aPermutation.size(); const size_t nPermSize = aPermutation.size();
OSL_ASSERT( static_cast< sal_Int32 >( nPermSize ) - 1 == *(::std::max_element( aPermutation.begin(), aPermutation.end()))); SAL_WARN_IF( static_cast< sal_Int32 >( nPermSize ) - 1 != *(::std::max_element( aPermutation.begin(), aPermutation.end())), "xmloff.chart", "nPermSize - 1 != *(::std::max_element( aPermutation.begin(), aPermutation.end())");
const size_t nTableRowCount = mrTable.aData.size(); const size_t nTableRowCount = mrTable.aData.size();
const size_t nDestSize = ::std::min( nPermSize, nTableRowCount ); const size_t nDestSize = ::std::min( nPermSize, nTableRowCount );
::std::vector< ::std::vector< SchXMLCell > > aDestination; ::std::vector< ::std::vector< SchXMLCell > > aDestination;
...@@ -370,12 +370,12 @@ void SchXMLTableContext::EndElement() ...@@ -370,12 +370,12 @@ void SchXMLTableContext::EndElement()
// copy original on first real permutation // copy original on first real permutation
if( !bModified ) if( !bModified )
{ {
OSL_ASSERT( aDestination.empty()); SAL_WARN_IF( !aDestination.empty(), "xmloff.chart", "aDestination is NOT NULL");
aDestination.reserve( mrTable.aData.size()); aDestination.reserve( mrTable.aData.size());
::std::copy( mrTable.aData.begin(), mrTable.aData.end(), ::std::back_inserter( aDestination )); ::std::copy( mrTable.aData.begin(), mrTable.aData.end(), ::std::back_inserter( aDestination ));
OSL_ASSERT( !aDestination.empty()); SAL_WARN_IF( aDestination.empty(), "xmloff.chart", "aDestination is NULL");
} }
OSL_ASSERT( nDestinationIndex < aDestination.size()); SAL_WARN_IF( nDestinationIndex >= aDestination.size(), "xmloff.chart", "nDestinationIndex >= aDestination.size()");
aDestination[ nDestinationIndex ] = mrTable.aData[ nSourceIndex ]; aDestination[ nDestinationIndex ] = mrTable.aData[ nSourceIndex ];
bModified = true; bModified = true;
} }
...@@ -816,7 +816,7 @@ void SchXMLTableHelper::applyTableToInternalDataProvider( ...@@ -816,7 +816,7 @@ void SchXMLTableHelper::applyTableToInternalDataProvider(
const ::std::vector< SchXMLCell >& rFirstRow = rTable.aData.front(); const ::std::vector< SchXMLCell >& rFirstRow = rTable.aData.front();
const sal_Int32 nColumnLabelsSize = aComplexColumnDescriptions.getLength(); const sal_Int32 nColumnLabelsSize = aComplexColumnDescriptions.getLength();
const sal_Int32 nMax = ::std::min< sal_Int32 >( nColumnLabelsSize, static_cast< sal_Int32 >( rFirstRow.size()) - nColOffset ); const sal_Int32 nMax = ::std::min< sal_Int32 >( nColumnLabelsSize, static_cast< sal_Int32 >( rFirstRow.size()) - nColOffset );
OSL_ASSERT( nMax == nColumnLabelsSize ); SAL_WARN_IF( nMax != nColumnLabelsSize, "xmloff.chart", "nMax != nColumnLabelsSize");
for( sal_Int32 i=0; i<nMax; ++i ) for( sal_Int32 i=0; i<nMax; ++i )
lcl_ApplyCellToComplexLabel( rFirstRow[i+nColOffset], aComplexColumnDescriptions[i] ); lcl_ApplyCellToComplexLabel( rFirstRow[i+nColOffset], aComplexColumnDescriptions[i] );
} }
...@@ -954,7 +954,7 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary( ...@@ -954,7 +954,7 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary(
} }
else // labels else // labels
{ {
OSL_ASSERT( aLSeqIt->first.second == SCH_XML_PART_LABEL ); SAL_WARN_IF( aLSeqIt->first.second != SCH_XML_PART_LABEL, "xmloff.chart", "aLSeqIt->first.second != SCH_XML_PART_LABEL" );
// labels // labels
Reference< chart2::data::XDataSequence > xSeq( aLSeqIt->second->getLabel()); Reference< chart2::data::XDataSequence > xSeq( aLSeqIt->second->getLabel());
OUString aRange; OUString aRange;
......
...@@ -309,7 +309,7 @@ XMLTokenEnum getTokenByChartType( ...@@ -309,7 +309,7 @@ XMLTokenEnum getTokenByChartType(
if( rChartTypeService.match( aPrefix )) if( rChartTypeService.match( aPrefix ))
{ {
sal_Int32 nSkip = aPrefix.getLength(); sal_Int32 nSkip = aPrefix.getLength();
OSL_ASSERT( rChartTypeService.getLength() >= nSkip ); SAL_WARN_IF( rChartTypeService.getLength() < nSkip, "xmloff.chart", "ChartTypeService.getLength() < nSkip" );
sal_Int32 nTypeLength = rChartTypeService.getLength() - nSkip - aPostfix.getLength(); sal_Int32 nTypeLength = rChartTypeService.getLength() - nSkip - aPostfix.getLength();
// if postfix matches and leaves a non-empty type // if postfix matches and leaves a non-empty type
if( nTypeLength > 0 && rChartTypeService.match( aPostfix, nSkip + nTypeLength )) if( nTypeLength > 0 && rChartTypeService.match( aPostfix, nSkip + nTypeLength ))
...@@ -363,14 +363,14 @@ Reference< chart2::data::XDataSequence > CreateDataSequence( ...@@ -363,14 +363,14 @@ Reference< chart2::data::XDataSequence > CreateDataSequence(
if( !xChartDoc.is() ) if( !xChartDoc.is() )
{ {
OSL_FAIL( "need a chart document" ); SAL_WARN("xmloff.chart", "need a chart document" );
return xRet; return xRet;
} }
Reference< chart2::data::XDataProvider > xDataProvider( xChartDoc->getDataProvider() ); Reference< chart2::data::XDataProvider > xDataProvider( xChartDoc->getDataProvider() );
if( !xDataProvider.is() ) if( !xDataProvider.is() )
{ {
OSL_FAIL( "need a data provider" ); SAL_WARN("xmloff.chart", "need a data provider" );
return xRet; return xRet;
} }
...@@ -400,7 +400,7 @@ Reference< chart2::data::XDataSequence > CreateDataSequence( ...@@ -400,7 +400,7 @@ Reference< chart2::data::XDataSequence > CreateDataSequence(
} }
catch( const lang::IllegalArgumentException & ) catch( const lang::IllegalArgumentException & )
{ {
OSL_FAIL( "could not create data sequence" ); SAL_WARN("xmloff.chart", "could not create data sequence" );
} }
} }
...@@ -416,7 +416,7 @@ Reference< chart2::data::XDataSequence > CreateDataSequence( ...@@ -416,7 +416,7 @@ Reference< chart2::data::XDataSequence > CreateDataSequence(
} }
catch( const lang::IllegalArgumentException & ) catch( const lang::IllegalArgumentException & )
{ {
OSL_FAIL( "could not create data sequence" ); SAL_WARN("xmloff.chart", "could not create data sequence" );
} }
} }
return xRet; return xRet;
...@@ -446,7 +446,7 @@ void CreateCategories( ...@@ -446,7 +446,7 @@ void CreateCategories(
if( nCooSysIndex < aCooSysSeq.getLength()) if( nCooSysIndex < aCooSysSeq.getLength())
{ {
uno::Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[nCooSysIndex] ); uno::Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[nCooSysIndex] );
OSL_ASSERT( xCooSys.is()); SAL_WARN_IF( !xCooSys.is(), "xmloff.chart", "xCooSys is NULL");
if( nDimensionIndex < xCooSys->getDimension() ) if( nDimensionIndex < xCooSys->getDimension() )
{ {
const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex); const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex);
...@@ -479,10 +479,7 @@ void CreateCategories( ...@@ -479,10 +479,7 @@ void CreateCategories(
} }
catch( const lang::IllegalArgumentException & ex ) catch( const lang::IllegalArgumentException & ex )
{ {
(void)ex; // avoid warning for pro build SAL_WARN("xmloff.chart", "IllegalArgumentException caught, Message: " << ex.Message );
OSL_FAIL( OUStringToOString(
OUString( "IllegalArgumentException caught, Message: " ) +
ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
} }
aData.Categories.set( xLabeledSeq ); aData.Categories.set( xLabeledSeq );
if( pLSequencesPerIndex ) if( pLSequencesPerIndex )
...@@ -502,7 +499,7 @@ void CreateCategories( ...@@ -502,7 +499,7 @@ void CreateCategories(
} }
catch( uno::Exception & ) catch( uno::Exception & )
{ {
OSL_FAIL( "Exception caught while creating Categories" ); SAL_WARN("xmloff.chart", "Exception caught while creating Categories" );
} }
} }
...@@ -655,10 +652,7 @@ void setXMLRangePropertyAtDataSequence( ...@@ -655,10 +652,7 @@ void setXMLRangePropertyAtDataSequence(
} }
catch( const uno::Exception & ex ) catch( const uno::Exception & ex )
{ {
(void)ex; // avoid warning for pro build SAL_WARN("xmloff.chart", "Exception caught, Message: " << ex.Message );
OSL_FAIL( OUStringToOString(
OUString( "Exception caught, Message: " ) +
ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
} }
} }
...@@ -685,10 +679,7 @@ bool getXMLRangePropertyFromDataSequence( ...@@ -685,10 +679,7 @@ bool getXMLRangePropertyFromDataSequence(
} }
catch( const uno::Exception & ex ) catch( const uno::Exception & ex )
{ {
(void)ex; // avoid warning for pro build SAL_WARN("xmloff.chart", "Exception caught, Message: " << ex.Message );
OSL_FAIL( OUStringToOString(
OUString( "Exception caught, Message: " ) +
ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
} }
} }
return bResult; return bResult;
...@@ -721,7 +712,7 @@ void copyProperties( ...@@ -721,7 +712,7 @@ void copyProperties(
} }
catch( const uno::Exception & ) catch( const uno::Exception & )
{ {
OSL_FAIL( "Copying property sets failed!" ); SAL_WARN("xmloff.chart", "Copying property sets failed!" );
} }
} }
......
...@@ -80,12 +80,11 @@ SchXMLDocContext::SchXMLDocContext( SchXMLImportHelper& rImpHelper, ...@@ -80,12 +80,11 @@ SchXMLDocContext::SchXMLDocContext( SchXMLImportHelper& rImpHelper,
SvXMLImportContext( rImport, nPrefix, rLName ), SvXMLImportContext( rImport, nPrefix, rLName ),
mrImportHelper( rImpHelper ) mrImportHelper( rImpHelper )
{ {
DBG_ASSERT( XML_NAMESPACE_OFFICE == nPrefix && SAL_WARN_IF( (XML_NAMESPACE_OFFICE != nPrefix) ||
( IsXMLToken( rLName, XML_DOCUMENT ) || ( !IsXMLToken( rLName, XML_DOCUMENT ) &&
IsXMLToken( rLName, XML_DOCUMENT_META) || !IsXMLToken( rLName, XML_DOCUMENT_META) &&
IsXMLToken( rLName, XML_DOCUMENT_STYLES) || !IsXMLToken( rLName, XML_DOCUMENT_STYLES) &&
IsXMLToken( rLName, XML_DOCUMENT_CONTENT) ), !IsXMLToken( rLName, XML_DOCUMENT_CONTENT) ), "xmloff.chart", "SchXMLDocContext instanciated with no <office:document> element" );
"SchXMLDocContext instanciated with no <office:document> element" );
} }
SchXMLDocContext::~SchXMLDocContext() SchXMLDocContext::~SchXMLDocContext()
...@@ -177,9 +176,8 @@ SchXMLBodyContext::SchXMLBodyContext( SchXMLImportHelper& rImpHelper, ...@@ -177,9 +176,8 @@ SchXMLBodyContext::SchXMLBodyContext( SchXMLImportHelper& rImpHelper,
SvXMLImportContext( rImport, nPrefix, rLName ), SvXMLImportContext( rImport, nPrefix, rLName ),
mrImportHelper( rImpHelper ) mrImportHelper( rImpHelper )
{ {
DBG_ASSERT( XML_NAMESPACE_OFFICE == nPrefix && SAL_WARN_IF( (XML_NAMESPACE_OFFICE != nPrefix) ||
IsXMLToken( rLName, XML_CHART ), !IsXMLToken( rLName, XML_CHART ), "xmloff.chart", "SchXMLBodyContext instanciated with no <office:chart> element" );
"SchXMLBodyContext instanciated with no <office:chart> element" );
} }
SchXMLBodyContext::~SchXMLBodyContext() SchXMLBodyContext::~SchXMLBodyContext()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment