Kaydet (Commit) d461088e authored tarafından Radu Ioan's avatar Radu Ioan Kaydeden (comit) Thomas Arnhold

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/3423Reviewed-by: 's avatarThomas Arnhold <thomas@arnhold.org>
Tested-by: 's avatarThomas Arnhold <thomas@arnhold.org>
üst 0191eb95
...@@ -180,7 +180,7 @@ Reference< drawing::XShape > SchXMLAxisContext::getTitleShape() ...@@ -180,7 +180,7 @@ Reference< drawing::XShape > SchXMLAxisContext::getTitleShape()
aPropName = "HasZAxisTitle"; aPropName = "HasZAxisTitle";
break; break;
case SCH_XML_AXIS_UNDEF: case SCH_XML_AXIS_UNDEF:
OSL_TRACE( "Invalid axis" ); SAL_INFO("xmloff.chart", "Invalid axis" );
break; break;
} }
xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) ); xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) );
...@@ -217,7 +217,7 @@ void SchXMLAxisContext::CreateGrid( OUString sAutoStyleName, bool bIsMajor ) ...@@ -217,7 +217,7 @@ void SchXMLAxisContext::CreateGrid( OUString sAutoStyleName, bool bIsMajor )
aPropName = "HasZAxisHelpGrid"; aPropName = "HasZAxisHelpGrid";
break; break;
case SCH_XML_AXIS_UNDEF: case SCH_XML_AXIS_UNDEF:
OSL_TRACE( "Invalid axis" ); SAL_INFO("xmloff.chart", "Invalid axis" );
break; break;
} }
xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) ); xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) );
...@@ -364,7 +364,7 @@ Reference< chart2::XAxis > lcl_getAxis( const Reference< frame::XModel >& xChart ...@@ -364,7 +364,7 @@ Reference< chart2::XAxis > lcl_getAxis( const Reference< frame::XModel >& xChart
} }
catch( uno::Exception & ) catch( uno::Exception & )
{ {
OSL_TRACE( "Couldn't get axis" ); SAL_INFO("xmloff.chart", "Couldn't get axis" );
} }
return xAxis; return xAxis;
...@@ -423,7 +423,7 @@ void SchXMLAxisContext::CreateAxis() ...@@ -423,7 +423,7 @@ void SchXMLAxisContext::CreateAxis()
aPropName = "HasSecondaryXAxis"; aPropName = "HasSecondaryXAxis";
break; break;
case SCH_XML_AXIS_UNDEF: case SCH_XML_AXIS_UNDEF:
OSL_TRACE( "Invalid axis" ); SAL_INFO("xmloff.chart", "Invalid axis" );
break; break;
} }
try try
...@@ -432,7 +432,7 @@ void SchXMLAxisContext::CreateAxis() ...@@ -432,7 +432,7 @@ void SchXMLAxisContext::CreateAxis()
} }
catch( beans::UnknownPropertyException & ) 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 ) if( m_aCurrentAxis.eDimension==SCH_XML_AXIS_Z )
{ {
...@@ -443,7 +443,7 @@ void SchXMLAxisContext::CreateAxis() ...@@ -443,7 +443,7 @@ void SchXMLAxisContext::CreateAxis()
} }
catch( beans::UnknownPropertyException & ) catch( beans::UnknownPropertyException & )
{ {
OSL_TRACE( "Couldn't turn on z axis" ); SAL_INFO("xmloff.chart", "Couldn't turn on z axis" );
} }
if( !bSettingZAxisSuccedded ) if( !bSettingZAxisSuccedded )
return; return;
...@@ -460,7 +460,7 @@ void SchXMLAxisContext::CreateAxis() ...@@ -460,7 +460,7 @@ void SchXMLAxisContext::CreateAxis()
} }
catch( beans::UnknownPropertyException & ) 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() ...@@ -602,7 +602,7 @@ void SchXMLAxisContext::SetAxisTitle()
} }
catch( beans::UnknownPropertyException & ) catch( beans::UnknownPropertyException & )
{ {
OSL_TRACE( "Property String for Title not available" ); SAL_INFO("xmloff.chart", "Property String for Title not available" );
} }
} }
} }
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#include <com/sun/star/chart2/XChartTypeContainer.hpp> #include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XTitled.hpp> #include <com/sun/star/chart2/XTitled.hpp>
using namespace com::sun::star; using namespace com::sun::star;
using namespace ::xmloff::token; using namespace ::xmloff::token;
using com::sun::star::uno::Reference; using com::sun::star::uno::Reference;
...@@ -104,7 +105,7 @@ void lcl_MoveDataToCandleStickSeries( ...@@ -104,7 +105,7 @@ void lcl_MoveDataToCandleStickSeries(
} }
catch(const uno::Exception&) 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 ...@@ -163,7 +164,7 @@ void lcl_removeEmptyChartTypeGroups( const uno::Reference< chart2::XChartDocumen
catch(const uno::Exception& ex) catch(const uno::Exception& ex)
{ {
OString aBStr(OUStringToOString(ex.Message, RTL_TEXTENCODING_ASCII_US)); 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 ...@@ -246,7 +247,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetChartAttrTokenMap(); const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetChartAttrTokenMap();
uno::Reference< embed::XVisualObject > xVisualObject( mrImportHelper.GetChartDocument(), uno::UNO_QUERY); 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() ) if( xVisualObject.is() )
maChartSize = xVisualObject->getVisualAreaSize( embed::Aspects::MSOLE_CONTENT ); //#i103460# take the size given from the parent frame as default 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 ...@@ -332,7 +333,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
if( aOldChartTypeName.isEmpty() ) 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: //set a fallback value:
OUString aChartClass_Bar( GetXMLToken(XML_BAR ) ); OUString aChartClass_Bar( GetXMLToken(XML_BAR ) );
aOldChartTypeName = SchXMLTools::GetChartTypeByClassName( aChartClass_Bar, true /* bUseOldNames */ ); aOldChartTypeName = SchXMLTools::GetChartTypeByClassName( aChartClass_Bar, true /* bUseOldNames */ );
...@@ -360,7 +361,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut ...@@ -360,7 +361,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
} }
catch(const uno::Exception&) 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 ...@@ -405,14 +406,14 @@ struct NewDonutSeries
void setSeriesStyleNameToPoint( const OUString& rStyleName, sal_Int32 nPointIndex ) 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()) ) if( nPointIndex < static_cast<sal_Int32>(m_aSeriesStyles.size()) )
m_aSeriesStyles[nPointIndex]=rStyleName; m_aSeriesStyles[nPointIndex]=rStyleName;
} }
void setPointStyleNameToPoint( const OUString& rStyleName, sal_Int32 nPointIndex ) 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()) ) if( nPointIndex < static_cast<sal_Int32>(m_aPointStyles.size()) )
m_aPointStyles[nPointIndex]=rStyleName; m_aPointStyles[nPointIndex]=rStyleName;
} }
...@@ -698,7 +699,7 @@ void SchXMLChartContext::EndElement() ...@@ -698,7 +699,7 @@ void SchXMLChartContext::EndElement()
} }
catch(const beans::UnknownPropertyException&) 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() ...@@ -715,7 +716,7 @@ void SchXMLChartContext::EndElement()
} }
catch(const beans::UnknownPropertyException&) 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() ...@@ -816,7 +817,7 @@ void SchXMLChartContext::EndElement()
catch(const uno::Exception&) catch(const uno::Exception&)
{ {
//try to fallback to internal data //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) if(!bHasOwnData)
{ {
bHasOwnData = true; bHasOwnData = true;
...@@ -831,7 +832,7 @@ void SchXMLChartContext::EndElement() ...@@ -831,7 +832,7 @@ void SchXMLChartContext::EndElement()
} }
catch(const uno::Exception&) 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() ...@@ -840,7 +841,7 @@ void SchXMLChartContext::EndElement()
} }
else 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 // now all series and data point properties are available and can be set
...@@ -982,7 +983,7 @@ void SchXMLChartContext::MergeSeriesForStockChart() ...@@ -982,7 +983,7 @@ void SchXMLChartContext::MergeSeriesForStockChart()
} }
catch(const uno::Exception&) 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( ...@@ -1083,7 +1084,7 @@ SvXMLImportContext* SchXMLChartContext::CreateChildContext(
if( xSupp.is()) if( xSupp.is())
mxDrawPage = uno::Reference< drawing::XShapes >( xSupp->getDrawPage(), uno::UNO_QUERY ); 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()) if( mxDrawPage.is())
pContext = GetImport().GetShapeImport()->CreateGroupChildContext( pContext = GetImport().GetShapeImport()->CreateGroupChildContext(
...@@ -1110,7 +1111,7 @@ void SchXMLChartContext::InitChart( ...@@ -1110,7 +1111,7 @@ void SchXMLChartContext::InitChart(
sal_Bool /* bSetSwitchData */ ) sal_Bool /* bSetSwitchData */ )
{ {
uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument(); 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 ); uno::Reference< frame::XModel > xModel (xDoc, uno::UNO_QUERY );
// Remove Title and Diagram ("De-InitNew") // Remove Title and Diagram ("De-InitNew")
......
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