diff options
author | Radu Ioan <ioan.radu.g@gmail.com> | 2013-04-16 23:28:16 +0300 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2013-04-17 20:29:37 +0000 |
commit | d461088eb4dd3b3bf7c2caaab082890ebcf80fea (patch) | |
tree | 2db6ae5fa07e0b813202801858530ba12f241898 /xmloff | |
parent | 0191eb95fb39138500426a87569d365ecaaf8e42 (diff) |
fdo#43157 - Clean up OSL_ASSERT, DBG_ASSERT
- replaced osl_trace with sal_info
- replaced dbg_* with sal_*
Change-Id: Ie5d3ae7d2c5dbaaed30d0b39740748845c9f1641
Reviewed-on: https://gerrit.libreoffice.org/3423
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/chart/SchXMLAxisContext.cxx | 16 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLChartContext.cxx | 31 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 151 |
3 files changed, 71 insertions, 127 deletions
diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx index b14618fefa42..1a83c205df37 100644 --- a/xmloff/source/chart/SchXMLAxisContext.cxx +++ b/xmloff/source/chart/SchXMLAxisContext.cxx @@ -180,7 +180,7 @@ Reference< drawing::XShape > SchXMLAxisContext::getTitleShape() aPropName = "HasZAxisTitle"; break; case SCH_XML_AXIS_UNDEF: - OSL_TRACE( "Invalid axis" ); + SAL_INFO("xmloff.chart", "Invalid axis" ); break; } xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) ); @@ -217,7 +217,7 @@ void SchXMLAxisContext::CreateGrid( OUString sAutoStyleName, bool bIsMajor ) aPropName = "HasZAxisHelpGrid"; break; case SCH_XML_AXIS_UNDEF: - OSL_TRACE( "Invalid axis" ); + SAL_INFO("xmloff.chart", "Invalid axis" ); break; } xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) ); @@ -364,7 +364,7 @@ Reference< chart2::XAxis > lcl_getAxis( const Reference< frame::XModel >& xChart } catch( uno::Exception & ) { - OSL_TRACE( "Couldn't get axis" ); + SAL_INFO("xmloff.chart", "Couldn't get axis" ); } return xAxis; @@ -423,7 +423,7 @@ void SchXMLAxisContext::CreateAxis() aPropName = "HasSecondaryXAxis"; break; case SCH_XML_AXIS_UNDEF: - OSL_TRACE( "Invalid axis" ); + SAL_INFO("xmloff.chart", "Invalid axis" ); break; } try @@ -432,7 +432,7 @@ void SchXMLAxisContext::CreateAxis() } catch( beans::UnknownPropertyException & ) { - OSL_TRACE( "Couldn't turn on axis" ); + SAL_INFO("xmloff.chart", "Couldn't turn on axis" ); } if( m_aCurrentAxis.eDimension==SCH_XML_AXIS_Z ) { @@ -443,7 +443,7 @@ void SchXMLAxisContext::CreateAxis() } catch( beans::UnknownPropertyException & ) { - OSL_TRACE( "Couldn't turn on z axis" ); + SAL_INFO("xmloff.chart", "Couldn't turn on z axis" ); } if( !bSettingZAxisSuccedded ) return; @@ -460,7 +460,7 @@ void SchXMLAxisContext::CreateAxis() } catch( beans::UnknownPropertyException & ) { - OSL_TRACE( "Couldn't turn on x axis" ); + SAL_INFO("xmloff.chart", "Couldn't turn on x axis" ); } } @@ -602,7 +602,7 @@ void SchXMLAxisContext::SetAxisTitle() } catch( beans::UnknownPropertyException & ) { - OSL_TRACE( "Property String for Title not available" ); + SAL_INFO("xmloff.chart", "Property String for Title not available" ); } } } diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 034a2f6d794a..5aeb93bd78c2 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -57,6 +57,7 @@ #include <com/sun/star/chart2/XChartTypeContainer.hpp> #include <com/sun/star/chart2/XTitled.hpp> + using namespace com::sun::star; using namespace ::xmloff::token; using com::sun::star::uno::Reference; @@ -104,7 +105,7 @@ void lcl_MoveDataToCandleStickSeries( } catch(const uno::Exception&) { - OSL_FAIL( "Exception caught while moving data to candlestick series" ); + SAL_WARN("xmloff.chart", "Exception caught while moving data to candlestick series" ); } } @@ -163,7 +164,7 @@ void lcl_removeEmptyChartTypeGroups( const uno::Reference< chart2::XChartDocumen catch(const uno::Exception& ex) { OString aBStr(OUStringToOString(ex.Message, RTL_TEXTENCODING_ASCII_US)); - OSL_TRACE( "Exception caught while removing empty chart types: %s", aBStr.getStr()); + SAL_INFO("xmloff.chart", "Exception caught while removing empty chart types: " << aBStr); } } @@ -246,7 +247,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetChartAttrTokenMap(); uno::Reference< embed::XVisualObject > xVisualObject( mrImportHelper.GetChartDocument(), uno::UNO_QUERY); - DBG_ASSERT(xVisualObject.is(),"need xVisualObject for page size"); + SAL_WARN_IF(!xVisualObject.is(), "xmloff.chart", "need xVisualObject for page size"); if( xVisualObject.is() ) maChartSize = xVisualObject->getVisualAreaSize( embed::Aspects::MSOLE_CONTENT ); //#i103460# take the size given from the parent frame as default @@ -332,7 +333,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut if( aOldChartTypeName.isEmpty() ) { - OSL_FAIL( "need a charttype to create a diagram" ); + SAL_WARN("xmloff.chart", "need a charttype to create a diagram" ); //set a fallback value: OUString aChartClass_Bar( GetXMLToken(XML_BAR ) ); aOldChartTypeName = SchXMLTools::GetChartTypeByClassName( aChartClass_Bar, true /* bUseOldNames */ ); @@ -360,7 +361,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut } catch(const uno::Exception&) { - OSL_FAIL( "Exception during import SchXMLChartContext::StartElement" ); + SAL_WARN("xmloff.chart", "Exception during import SchXMLChartContext::StartElement" ); } } } @@ -405,14 +406,14 @@ struct NewDonutSeries void setSeriesStyleNameToPoint( const OUString& rStyleName, sal_Int32 nPointIndex ) { - DBG_ASSERT(nPointIndex < static_cast<sal_Int32>(m_aSeriesStyles.size()),"donut point <-> series count mismatch"); + SAL_WARN_IF(nPointIndex >= static_cast<sal_Int32>(m_aSeriesStyles.size()), "xmloff.chart", "donut point <-> series count mismatch"); if( nPointIndex < static_cast<sal_Int32>(m_aSeriesStyles.size()) ) m_aSeriesStyles[nPointIndex]=rStyleName; } void setPointStyleNameToPoint( const OUString& rStyleName, sal_Int32 nPointIndex ) { - DBG_ASSERT(nPointIndex < static_cast<sal_Int32>(m_aPointStyles.size()),"donut point <-> series count mismatch"); + SAL_WARN_IF(nPointIndex >= static_cast<sal_Int32>(m_aPointStyles.size()), "xmloff.chart", "donut point <-> series count mismatch"); if( nPointIndex < static_cast<sal_Int32>(m_aPointStyles.size()) ) m_aPointStyles[nPointIndex]=rStyleName; } @@ -698,7 +699,7 @@ void SchXMLChartContext::EndElement() } catch(const beans::UnknownPropertyException&) { - OSL_FAIL( "Property String for Title not available" ); + SAL_WARN("xmloff.chart", "Property String for Title not available" ); } } } @@ -715,7 +716,7 @@ void SchXMLChartContext::EndElement() } catch(const beans::UnknownPropertyException&) { - OSL_FAIL( "Property String for Title not available" ); + SAL_WARN("xmloff.chart", "Property String for Title not available" ); } } } @@ -816,7 +817,7 @@ void SchXMLChartContext::EndElement() catch(const uno::Exception&) { //try to fallback to internal data - OSL_FAIL( "Exception during import SchXMLChartContext::lcl_ApplyDataFromRectangularRangeToDiagram try to fallback to internal data" ); + SAL_WARN("xmloff.chart", "Exception during import SchXMLChartContext::lcl_ApplyDataFromRectangularRangeToDiagram try to fallback to internal data" ); if(!bHasOwnData) { bHasOwnData = true; @@ -831,7 +832,7 @@ void SchXMLChartContext::EndElement() } catch(const uno::Exception&) { - OSL_FAIL( "Exception during import SchXMLChartContext::lcl_ApplyDataFromRectangularRangeToDiagram fallback to internal data failed also" ); + SAL_WARN("xmloff.chart", "Exception during import SchXMLChartContext::lcl_ApplyDataFromRectangularRangeToDiagram fallback to internal data failed also" ); } } } @@ -840,7 +841,7 @@ void SchXMLChartContext::EndElement() } else { - OSL_FAIL( " Must not get here" ); + SAL_WARN("xmloff.chart", "Must not get here" ); } // now all series and data point properties are available and can be set @@ -982,7 +983,7 @@ void SchXMLChartContext::MergeSeriesForStockChart() } catch(const uno::Exception&) { - OSL_FAIL( "Exception while merging series for stock chart" ); + SAL_WARN("xmloff.chart", "Exception while merging series for stock chart" ); } } @@ -1083,7 +1084,7 @@ SvXMLImportContext* SchXMLChartContext::CreateChildContext( if( xSupp.is()) mxDrawPage = uno::Reference< drawing::XShapes >( xSupp->getDrawPage(), uno::UNO_QUERY ); - DBG_ASSERT( mxDrawPage.is(), "Invalid Chart Page" ); + SAL_WARN_IF( !mxDrawPage.is(), "xmloff.chart", "Invalid Chart Page" ); } if( mxDrawPage.is()) pContext = GetImport().GetShapeImport()->CreateGroupChildContext( @@ -1110,7 +1111,7 @@ void SchXMLChartContext::InitChart( sal_Bool /* bSetSwitchData */ ) { uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument(); - DBG_ASSERT( xDoc.is(), "No valid document!" ); + SAL_WARN_IF( !xDoc.is(), "xmloff.chart", "No valid document!" ); uno::Reference< frame::XModel > xModel (xDoc, uno::UNO_QUERY ); // Remove Title and Diagram ("De-InitNew") diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index ee01a6ad3e18..8c0bd6eec25c 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -335,14 +335,14 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Referen for( sal_Int32 i=0; i<aCooSysSeq.getLength(); ++i ) { Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[i] ); - OSL_ASSERT( xCooSys.is()); + SAL_WARN_IF( !xCooSys.is(), "xmloff.chart", "xCooSys is NULL" ); for( sal_Int32 nN = xCooSys->getDimension(); nN--; ) { const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nN); for(sal_Int32 nI=0; nI<=nMaxAxisIndex; ++nI) { Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension( nN, nI ); - OSL_ASSERT( xAxis.is()); + SAL_WARN_IF( !xAxis.is(), "xmloff.chart", "xAxis is NULL"); if( xAxis.is()) { chart2::ScaleData aScaleData = xAxis->getScaleData(); @@ -358,12 +358,7 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Referen } catch( const uno::Exception & ex ) { - (void)ex; // avoid warning for pro build - OSL_FAIL( OUStringToOString( - OUString( "Exception caught. Type: " ) + - OUString::createFromAscii( typeid( ex ).name()) + - OUString( ", Message: " ) + - ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr()); + SAL_WARN("xmloff.chart", "Exception caught. Type: " << OUString::createFromAscii( typeid( ex ).name()) << ", Message: " << ex.Message); } return xResult; @@ -474,12 +469,7 @@ bool lcl_isSeriesAttachedToFirstAxis( } catch( const uno::Exception & ex ) { - (void)ex; // avoid warning for pro build - OSL_FAIL( OUStringToOString( - OUString( "Exception caught. Type: " ) + - OUString::createFromAscii( typeid( ex ).name()) + - OUString( ", Message: " ) + - ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr()); + SAL_WARN("xmloff.chart", "Exception caught. Type: " << OUString::createFromAscii( typeid( ex ).name()) << ", Message: " << ex.Message); } return bResult; @@ -922,9 +912,7 @@ lcl_TableData lcl_getDataForLocalTable( } catch( const uno::Exception & rEx ) { - (void)rEx; // avoid warning for pro build - OSL_TRACE( OUStringToOString( OUString( - "something went wrong during table data collection: " ) + rEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr()); + SAL_INFO("xmloff.chart", "something went wrong during table data collection: " << rEx.Message); } return aResult; @@ -973,12 +961,8 @@ void lcl_exportNumberFormat( const OUString& rPropertyName, const Reference< bea } catch( const uno::Exception & rEx ) { -#ifdef DBG_UTIL OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US)); - OSL_TRACE( "chart:exporting error bar ranges: %s", aBStr.getStr()); -#else - (void)rEx; // avoid warning -#endif + SAL_INFO("xmloff.chart", "chart:exporting error bar ranges: " << aBStr ); } } @@ -1123,7 +1107,7 @@ void SchXMLExportHelper_Impl::exportChart( Reference< chart::XChartDocument > rC sal_Bool bIncludeTable ) { parseDocument( rChartDoc, sal_True, bIncludeTable ); - DBG_ASSERT( maAutoStyleNameQueue.empty(), "There are still remaining autostyle names in the queue" ); + SAL_WARN_IF( !maAutoStyleNameQueue.empty(), "xmloff.chart", "There are still remaining autostyle names in the queue" ); } static OUString lcl_GetStringFromNumberSequence( const ::com::sun::star::uno::Sequence< sal_Int32 >& rSequenceMapping, bool bRemoveOneFromEachIndex /*should be true if having categories*/ ) @@ -1157,7 +1141,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& Reference< chart2::XChartDocument > xNewDoc( rChartDoc, uno::UNO_QUERY ); if( !rChartDoc.is() || !xNewDoc.is() ) { - OSL_FAIL( "No XChartDocument was given for export." ); + SAL_WARN("xmloff.chart", "No XChartDocument was given for export." ); return; } @@ -1219,7 +1203,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& } catch( const beans::UnknownPropertyException & ) { - DBG_WARNING( "Required property not found in ChartDocument" ); + SAL_WARN("xmloff.chart", "Required property not found in ChartDocument" ); } } @@ -1273,7 +1257,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& { enum XMLTokenEnum eXMLChartType = SchXMLTools::getTokenByChartType( sChartType, true /* bUseOldNames */ ); - DBG_ASSERT( eXMLChartType != XML_TOKEN_INVALID, "invalid chart class" ); + SAL_WARN_IF( eXMLChartType == XML_TOKEN_INVALID, "xmloff.chart", "invalid chart class" ); if( eXMLChartType == XML_TOKEN_INVALID ) eXMLChartType = XML_BAR; @@ -1431,7 +1415,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& } catch( const beans::UnknownPropertyException & ) { - DBG_WARNING( "Property Align not found in ChartLegend" ); + SAL_WARN("xmloff.chart", "Property Align not found in ChartLegend" ); } // export absolute legend position @@ -1465,7 +1449,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& } catch( const beans::UnknownPropertyException & ) { - DBG_WARNING( "Property Expansion not found in ChartLegend" ); + SAL_WARN("xmloff.chart", "Property Expansion not found in ChartLegend" ); } } } @@ -1507,7 +1491,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& for( sal_Int32 nShapeId = 0; nShapeId < nShapeCount; nShapeId++ ) { mxAdditionalShapes->getByIndex( nShapeId ) >>= xShape; - DBG_ASSERT( xShape.is(), "Shape without an XShape?" ); + SAL_WARN_IF( !xShape.is(), "xmloff.chart", "Shape without an XShape?" ); if( ! xShape.is()) continue; @@ -1527,12 +1511,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& } catch( const uno::Exception & rEx ) { - (void)rEx; // avoid warning for pro build - OSL_TRACE( - OUStringToOString( - OUString( "AdditionalShapes not found: " ) + - rEx.Message, - RTL_TEXTENCODING_ASCII_US ).getStr()); + SAL_INFO("xmloff.chart", "AdditionalShapes not found: " << rEx.Message ); } if( mxAdditionalShapes.is()) @@ -1542,11 +1521,11 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& // ZOrder which might be (actually is) larger than the number of // shapes in mxAdditionalShapes Reference< drawing::XDrawPageSupplier > xSupplier( rChartDoc, uno::UNO_QUERY ); - DBG_ASSERT( xSupplier.is(), "Cannot retrieve draw page to initialize shape export" ); + SAL_WARN_IF( !xSupplier.is(), "xmloff.chart", "Cannot retrieve draw page to initialize shape export" ); if( xSupplier.is() ) { Reference< drawing::XShapes > xDrawPage( xSupplier->getDrawPage(), uno::UNO_QUERY ); - DBG_ASSERT( xDrawPage.is(), "Invalid draw page for initializing shape export" ); + SAL_WARN_IF( !xDrawPage.is(), "xmloff.chart", "Invalid draw page for initializing shape export" ); if( xDrawPage.is()) mrExport.GetShapeExport()->seekShapes( xDrawPage ); } @@ -1561,7 +1540,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& for( sal_Int32 nShapeId = 0; nShapeId < nShapeCount; nShapeId++ ) { mxAdditionalShapes->getByIndex( nShapeId ) >>= xShape; - DBG_ASSERT( xShape.is(), "Shape without an XShape?" ); + SAL_WARN_IF( !xShape.is(), "xmloff.chart", "Shape without an XShape?" ); if( ! xShape.is()) continue; @@ -1748,7 +1727,7 @@ void SchXMLExportHelper_Impl::exportTable() ++aColumnDescriptions_RangeIter; } } - OSL_ASSERT( bHasOwnData || aColumnDescriptions_RangeIter == aColumnDescriptions_RangeEnd ); + SAL_WARN_IF( !bHasOwnData && (aColumnDescriptions_RangeIter != aColumnDescriptions_RangeEnd), "xmloff.chart", "bHasOwnData == false && aColumnDescriptions_RangeIter != aColumnDescriptions_RangeEnd" ); } // closing row and header-rows elements // export value rows @@ -1829,8 +1808,8 @@ void SchXMLExportHelper_Impl::exportTable() } // if range iterator was used it should have reached its end - OSL_ASSERT( bHasOwnData || (aDataRangeIter == aDataRangeEndIter) ); - OSL_ASSERT( bHasOwnData || (aRowDescriptions_RangeIter == aRowDescriptions_RangeEnd) ); + SAL_WARN_IF( !bHasOwnData && (aDataRangeIter != aDataRangeEndIter), "xmloff.chart", "bHasOwnData == false && aDataRangeIter != aDataRangeEndIter" ); + SAL_WARN_IF( !bHasOwnData && (aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd), "xmloff.chart", "bHasOwnData == false && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd" ); } namespace @@ -1891,7 +1870,7 @@ void SchXMLExportHelper_Impl::exportPlotArea( sal_Bool bExportContent, sal_Bool bIncludeTable ) { - DBG_ASSERT( xDiagram.is(), "Invalid XDiagram as parameter" ); + SAL_WARN_IF( !xDiagram.is(), "xmloff.chart", "Invalid XDiagram as parameter" ); if( ! xDiagram.is()) return; @@ -1958,7 +1937,7 @@ void SchXMLExportHelper_Impl::exportPlotArea( } catch( const beans::UnknownPropertyException & ) { - SAL_WARN( "xmloff.chart", "Properties missing" ); + SAL_WARN("xmloff.chart", "Properties missing" ); } } } @@ -1984,12 +1963,8 @@ void SchXMLExportHelper_Impl::exportPlotArea( } catch( const uno::Exception & rEx ) { -#ifdef DBG_UTIL OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US)); - OSL_TRACE("chart:TableNumberList property caught: %s", aBStr.getStr()); -#else - (void)rEx; // avoid warning -#endif + SAL_INFO("xmloff.chart", "chart:TableNumberList property caught: " << aBStr ); } } @@ -2020,12 +1995,8 @@ void SchXMLExportHelper_Impl::exportPlotArea( } catch( const uno::Exception & rEx ) { -#ifdef DBG_UTIL OString aBStr(OUStringToOString(rEx.Message, RTL_TEXTENCODING_ASCII_US)); - OSL_TRACE( "chart:exportPlotAreaException caught: %s", aBStr.getStr()); -#else - (void)rEx; // avoid warning -#endif + SAL_INFO("xmloff.chart", "chart:exportPlotAreaException caught: " << aBStr); } } @@ -2203,7 +2174,7 @@ void SchXMLExportHelper_Impl::exportCoordinateRegion( const uno::Reference< char return; Reference< chart::XDiagramPositioning > xDiaPos( xDiagram, uno::UNO_QUERY ); - DBG_ASSERT( xDiaPos.is(), "Invalid xDiaPos as parameter" ); + SAL_WARN_IF( !xDiaPos.is(), "xmloff.chart", "Invalid xDiaPos as parameter" ); if( !xDiaPos.is() ) return; @@ -2435,7 +2406,7 @@ void SchXMLExportHelper_Impl::exportAxes( const Reference< chart2::XDiagram > & xNewDiagram, sal_Bool bExportContent ) { - DBG_ASSERT( xDiagram.is(), "Invalid XDiagram as parameter" ); + SAL_WARN_IF( !xDiagram.is(), "xmloff.chart", "Invalid XDiagram as parameter" ); if( ! xDiagram.is()) return; @@ -2498,7 +2469,7 @@ void SchXMLExportHelper_Impl::exportAxes( if ( ! aDiagramProperties.GetProperties ()) { - DBG_WARNING ("Required properties not found in Chart diagram"); + SAL_INFO("xmloff.chart", "Required properties not found in Chart diagram"); } Reference< chart2::XCoordinateSystem > xCooSys( lcl_getCooSys(xNewDiagram) ); @@ -2737,12 +2708,7 @@ void SchXMLExportHelper_Impl::exportSeries( } catch( const uno::Exception & rEx ) { - (void)rEx; // avoid warning for pro build - OSL_TRACE( - OUStringToOString( - OUString( "Series not found or no XPropertySet: " ) + - rEx.Message, - RTL_TEXTENCODING_ASCII_US ).getStr()); + SAL_INFO("xmloff.chart", "Series not found or no XPropertySet: " << rEx.Message ); continue; } if( xPropSet.is()) @@ -2764,12 +2730,7 @@ void SchXMLExportHelper_Impl::exportSeries( } catch( const beans::UnknownPropertyException & rEx ) { - (void)rEx; // avoid warning for pro build - OSL_TRACE( - OUStringToOString( - OUString( "Required property not found in DataRowProperties: " ) + - rEx.Message, - RTL_TEXTENCODING_ASCII_US ).getStr()); + SAL_INFO("xmloff.chart", "Required property not found in DataRowProperties: " << rEx.Message ); } const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); @@ -2901,9 +2862,7 @@ void SchXMLExportHelper_Impl::exportSeries( } catch( const uno::Exception & rEx ) { - (void)rEx; // avoid warning for pro build - OSL_TRACE( "Exception caught during Export of series - optional DataMeanValueProperties not available: %s", - OUStringToOString( rEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + SAL_INFO("xmloff.chart", "Exception caught during Export of series - optional DataMeanValueProperties not available: " << rEx.Message ); } if( xStatProp.is() ) @@ -2971,9 +2930,7 @@ void SchXMLExportHelper_Impl::exportRegressionCurve( } catch( const uno::Exception & rEx ) { - (void)rEx; // avoid warning for pro build - OSL_TRACE( "Exception caught during Export of series - optional DataRegressionProperties not available: %s", - OUStringToOString( rEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + SAL_INFO("xmloff.chart", "Exception caught during Export of series - optional DataRegressionProperties not available: " << rEx.Message ); } if( xStatProp.is() ) @@ -3097,11 +3054,7 @@ void SchXMLExportHelper_Impl::exportErrorBar( const Reference<beans::XPropertySe } catch( const beans::UnknownPropertyException & rEx ) { - (void)rEx; // avoid warning for pro build - OSL_TRACE( - OUStringToOString(OUString("Required property not found in DataRowProperties: " ) + - rEx.Message, - RTL_TEXTENCODING_ASCII_US ).getStr()); + SAL_INFO("xmloff.chart", "Required property not found in DataRowProperties: " << rEx.Message ); } if( nErrorBarStyle != chart::ErrorBarStyle::NONE && (bNegative || bPositive)) @@ -3314,7 +3267,7 @@ void SchXMLExportHelper_Impl::exportDataPoints( sal_Int32 nSize = aDataPointSeq.getLength(); - DBG_ASSERT( nSize <= nSeriesLength, "Too many point attributes" ); + SAL_WARN_IF( nSize > nSeriesLength, "xmloff.chart", "Too many point attributes" ); const sal_Int32 * pPoints = aDataPointSeq.getConstArray(); sal_Int32 nElement; @@ -3350,9 +3303,7 @@ void SchXMLExportHelper_Impl::exportDataPoints( } catch( const uno::Exception & rEx ) { - (void)rEx; // avoid warning for pro build - OSL_TRACE( "Exception caught during Export of data point: %s", - OUStringToOString( rEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + SAL_INFO("xmloff.chart", "Exception caught during Export of data point: " << rEx.Message ); } } else @@ -3361,7 +3312,7 @@ void SchXMLExportHelper_Impl::exportDataPoints( xPropSet.set( new ::xmloff::chart::ColorPropertySet( xColorScheme->getColorByIndex( nElement ))); } - DBG_ASSERT( xPropSet.is(), "Pie Segments should have properties" ); + SAL_WARN_IF( !xPropSet.is(), "xmloff.chart", "Pie Segments should have properties" ); if( xPropSet.is()) { const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); @@ -3377,7 +3328,7 @@ void SchXMLExportHelper_Impl::exportDataPoints( if( bExportContent ) { // write data-point with style - DBG_ASSERT( ! maAutoStyleNameQueue.empty(), "Autostyle queue empty!" ); + SAL_WARN_IF( maAutoStyleNameQueue.empty(), "xmloff.chart", "Autostyle queue empty!" ); SchXMLDataPointStruct aPoint; aPoint.maStyleName = maAutoStyleNameQueue.front(); @@ -3391,8 +3342,7 @@ void SchXMLExportHelper_Impl::exportDataPoints( } } } - DBG_ASSERT( !bExportContent || (static_cast<sal_Int32>(aDataPointList.size()) == nSeriesLength), - "not enough data points on content export" ); + SAL_WARN_IF( bExportContent && (static_cast<sal_Int32>(aDataPointList.size()) != nSeriesLength), "xmloff.chart", "not enough data points on content export" ); } else { @@ -3422,9 +3372,7 @@ void SchXMLExportHelper_Impl::exportDataPoints( } catch( const uno::Exception & rEx ) { - (void)rEx; // avoid warning for pro build - OSL_TRACE( "Exception caught during Export of data point: %s", - OUStringToOString( rEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + SAL_INFO("xmloff.chart", "Exception caught during Export of data point: " << rEx.Message ); } if( xPropSet.is()) { @@ -3441,7 +3389,7 @@ void SchXMLExportHelper_Impl::exportDataPoints( if( bExportContent ) { // write data-point with style - DBG_ASSERT( ! maAutoStyleNameQueue.empty(), "Autostyle queue empty!" ); + SAL_WARN_IF( maAutoStyleNameQueue.empty(), "xmloff.chart", "Autostyle queue empty!" ); SchXMLDataPointStruct aPoint; aPoint.maStyleName = maAutoStyleNameQueue.front(); maAutoStyleNameQueue.pop(); @@ -3563,7 +3511,7 @@ awt::Size SchXMLExportHelper_Impl::getPageSize( const Reference< chart2::XChartD { awt::Size aSize( 8000, 7000 ); uno::Reference< embed::XVisualObject > xVisualObject( xChartDoc, uno::UNO_QUERY ); - DBG_ASSERT( xVisualObject.is(),"need XVisualObject for page size" ); + SAL_WARN_IF( !xVisualObject.is(), "xmloff.chart", "need XVisualObject for page size" ); if( xVisualObject.is() ) aSize = xVisualObject->getVisualAreaSize( embed::Aspects::MSOLE_CONTENT ); @@ -3580,7 +3528,7 @@ void SchXMLExportHelper_Impl::AddAutoStyleAttribute( const std::vector< XMLPrope { if( !aStates.empty() ) { - DBG_ASSERT( ! maAutoStyleNameQueue.empty(), "Autostyle queue empty!" ); + SAL_WARN_IF( maAutoStyleNameQueue.empty(), "xmloff.chart", "Autostyle queue empty!" ); mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_STYLE_NAME, maAutoStyleNameQueue.front() ); maAutoStyleNameQueue.pop(); @@ -3634,7 +3582,7 @@ void SchXMLExport::_ExportStyles( sal_Bool bUsed ) void SchXMLExport::_ExportMasterStyles() { // not available in chart - DBG_WARNING( "Master Style Export requested. Not available for Chart" ); + SAL_INFO("xmloff.chart", "Master Style Export requested. Not available for Chart" ); } void SchXMLExport::_ExportAutoStyles() @@ -3650,7 +3598,7 @@ void SchXMLExport::_ExportAutoStyles() } else { - OSL_FAIL( "Couldn't export chart due to wrong XModel (must be XChartDocument)" ); + SAL_WARN("xmloff.chart", "Couldn't export chart due to wrong XModel (must be XChartDocument)" ); } } } @@ -3706,7 +3654,7 @@ void SchXMLExport::_ExportContent() } catch( const beans::UnknownPropertyException & ) { - OSL_FAIL( "Property ChartRangeAddress not supported by ChartDocument" ); + SAL_WARN("xmloff.chart", "Property ChartRangeAddress not supported by ChartDocument" ); } } } @@ -3716,7 +3664,7 @@ void SchXMLExport::_ExportContent() } else { - OSL_FAIL( "Couldn't export chart due to wrong XModel" ); + SAL_WARN("xmloff.chart", "Couldn't export chart due to wrong XModel" ); } } @@ -3731,7 +3679,7 @@ void SchXMLExportHelper_Impl::InitRangeSegmentationProperties( const Reference< try { Reference< chart2::data::XDataProvider > xDataProvider( xChartDoc->getDataProvider() ); - OSL_ENSURE( xDataProvider.is(), "No DataProvider" ); + SAL_WARN_IF( !xDataProvider.is(), "xmloff.chart", "No DataProvider" ); if( xDataProvider.is()) { Reference< chart2::data::XDataSource > xDataSource( lcl_pressUsedDataIntoRectangularFormat( xChartDoc, mbHasCategoryLabels )); @@ -3776,12 +3724,7 @@ void SchXMLExportHelper_Impl::InitRangeSegmentationProperties( const Reference< } catch( const uno::Exception & ex ) { - (void)ex; // avoid warning for pro build - OSL_FAIL( OUStringToOString( - OUString( "Exception caught. Type: " ) + - OUString::createFromAscii( typeid( ex ).name()) + - OUString( ", Message: " ) + - ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr()); + SAL_WARN("xmloff.chart", "Exception caught. Type: " << OUString::createFromAscii( typeid( ex ).name()) << ", Message: " << ex.Message); } } |