diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2011-02-02 12:32:52 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2011-02-02 12:33:58 +0100 |
commit | cab37910766c544281c68795a1b7498ee6a24a84 (patch) | |
tree | b9745fcad4ef2e24252724fe12a968d7dda90c3f /chart2 | |
parent | c58b67eaf3598c249364982615501eb296bda8be (diff) |
Some cppcheck cleaning
Diffstat (limited to 'chart2')
8 files changed, 21 insertions, 20 deletions
diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx index 6f3531818ef4..1cd110439e7f 100644 --- a/chart2/source/controller/dialogs/res_ErrorBar.cxx +++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx @@ -569,10 +569,9 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs) aState = rInAttrs.GetItemState( SCHATTR_STAT_CONSTMINUS, TRUE, &pPoolItem ); m_bMinusUnique = ( aState != SFX_ITEM_DONTCARE ); - double fMinusValue = 0.0; if( aState == SFX_ITEM_SET ) { - fMinusValue = ((const SvxDoubleItem*) pPoolItem)->GetValue(); + double fMinusValue = ((const SvxDoubleItem*) pPoolItem)->GetValue(); sal_Int32 nMinusValue = static_cast< sal_Int32 >( fMinusValue * pow(10.0,m_aMfNegative.GetDecimalDigits()) ); m_aMfNegative.SetValue( nMinusValue ); diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx index 267ccf81a60e..e71f29c54d9f 100644 --- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx +++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx @@ -87,10 +87,9 @@ void PolarOptionsTabPage::Reset(const SfxItemSet& rInAttrs) { const SfxPoolItem *pPoolItem = NULL; - long nTmp; if (rInAttrs.GetItemState(SCHATTR_STARTING_ANGLE, TRUE, &pPoolItem) == SFX_ITEM_SET) { - nTmp = (long)((const SfxInt32Item*)pPoolItem)->GetValue(); + long nTmp = (long)((const SfxInt32Item*)pPoolItem)->GetValue(); m_aAngleDial.SetRotation( nTmp*100 ); } diff --git a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx index 70490a025fad..dd41bb4af525 100644 --- a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx @@ -300,7 +300,7 @@ void GraphicPropertyItemConverter::FillSpecialItem( } } } - catch( beans::UnknownPropertyException ex ) + catch( beans::UnknownPropertyException &ex ) { ASSERT_EXCEPTION( ex ); } @@ -314,11 +314,10 @@ void GraphicPropertyItemConverter::FillSpecialItem( ? C2U( "GradientStepCount" ) : C2U( "FillGradientStepCount" ); - sal_Int16 nStepCount = 0; uno::Any aValue( GetPropertySet()->getPropertyValue( aPropName ) ); if( hasLongOrShortValue(aValue) ) { - nStepCount = getShortForLongAlso(aValue); + sal_Int16 nStepCount = getShortForLongAlso(aValue); rOutItemSet.Put( XGradientStepCountItem( nStepCount )); } } @@ -545,7 +544,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( } } } - catch( beans::UnknownPropertyException ex ) + catch( beans::UnknownPropertyException &ex ) { ASSERT_EXCEPTION( ex ); } diff --git a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx index 4f4cd36a7d66..322061b61b06 100644 --- a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx @@ -140,7 +140,7 @@ void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const delete pItem; } } - catch( beans::UnknownPropertyException ex ) + catch( beans::UnknownPropertyException &ex ) { delete pItem; OSL_ENSURE( false, @@ -150,7 +150,7 @@ void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const " - unknown Property: " )) + aProperty.first, RTL_TEXTENCODING_ASCII_US ).getStr()); } - catch( uno::Exception ex ) + catch( uno::Exception &ex ) { ASSERT_EXCEPTION( ex ); } @@ -162,7 +162,7 @@ void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const { FillSpecialItem( nWhich, rOutItemSet ); } - catch( uno::Exception ex ) + catch( uno::Exception &ex ) { ASSERT_EXCEPTION( ex ); } @@ -212,7 +212,7 @@ bool ItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) bItemsChanged = true; } } - catch( beans::UnknownPropertyException ex ) + catch( beans::UnknownPropertyException &ex ) { OSL_ENSURE( false, ::rtl::OUStringToOString( @@ -221,7 +221,7 @@ bool ItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) " - unknown Property: " )) + aProperty.first, RTL_TEXTENCODING_ASCII_US).getStr()); } - catch( uno::Exception ex ) + catch( uno::Exception &ex ) { OSL_ENSURE( false, ::rtl::OUStringToOString( ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr()); diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx index eefa60a3f85b..ce2bf41a7479 100644 --- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx @@ -177,7 +177,7 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( } } } - catch( uno::Exception ex ) + catch( uno::Exception &ex ) { ASSERT_EXCEPTION( ex ); } diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx index 107c8db62550..8ddc44ddb592 100644 --- a/chart2/source/controller/main/ChartController.hxx +++ b/chart2/source/controller/main/ChartController.hxx @@ -519,7 +519,7 @@ private: void removeListener( ChartController* pController ); void tryTermination(); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > - getModel() { return m_xModel;} + getModel() const { return m_xModel;} private: ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel; diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index d322c8277350..cc92baa54821 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -574,11 +574,11 @@ std::vector< Reference< XAxis > > AxisHelper::getAllAxesOfCoordinateSystem( if(xCooSys.is()) { - sal_Int32 nDimensionIndex = 0; sal_Int32 nMaxDimensionIndex = xCooSys->getDimension() -1; if( nMaxDimensionIndex>=0 ) { - for(nDimensionIndex=0; nDimensionIndex<=nMaxDimensionIndex; ++nDimensionIndex) + sal_Int32 nDimensionIndex = 0; + for(; nDimensionIndex<=nMaxDimensionIndex; ++nDimensionIndex) { const sal_Int32 nMaximumAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex); for(sal_Int32 nAxisIndex=0; nAxisIndex<=nMaximumAxisIndex; ++nAxisIndex) diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx index 8f3a504bfb0a..4e0a2e7404e2 100644 --- a/chart2/source/tools/RangeHighlighter.cxx +++ b/chart2/source/tools/RangeHighlighter.cxx @@ -216,12 +216,14 @@ void RangeHighlighter::fillRangesForDiagram( const Reference< chart2::XDiagram > void RangeHighlighter::fillRangesForDataSeries( const uno::Reference< chart2::XDataSeries > & xSeries ) { - sal_Int32 nPreferredColor = PREFERED_DEFAULT_COLOR; Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY ); if( xSource.is()) + { + sal_Int32 nPreferredColor = PREFERED_DEFAULT_COLOR; lcl_fillRanges( m_aSelectedRanges, ::chart::DataSourceHelper::getRangesFromDataSource( xSource ), nPreferredColor ); + } } void RangeHighlighter::fillRangesForErrorBars( @@ -245,12 +247,14 @@ void RangeHighlighter::fillRangesForErrorBars( if( bUsesRangesAsErrorBars ) { - sal_Int32 nPreferredColor = PREFERED_DEFAULT_COLOR; Reference< chart2::data::XDataSource > xSource( xErrorBar, uno::UNO_QUERY ); if( xSource.is()) + { + sal_Int32 nPreferredColor = PREFERED_DEFAULT_COLOR; lcl_fillRanges( m_aSelectedRanges, ::chart::DataSourceHelper::getRangesFromDataSource( xSource ), nPreferredColor ); + } } else { @@ -269,12 +273,12 @@ void RangeHighlighter::fillRangesForCategories( const Reference< chart2::XAxis > void RangeHighlighter::fillRangesForDataPoint( const Reference< uno::XInterface > & xDataSeries, sal_Int32 nIndex ) { - sal_Int32 nPreferredColor = PREFERED_DEFAULT_COLOR; if( xDataSeries.is()) { Reference< chart2::data::XDataSource > xSource( xDataSeries, uno::UNO_QUERY ); if( xSource.is() ) { + sal_Int32 nPreferredColor = PREFERED_DEFAULT_COLOR; ::std::vector< chart2::data::HighlightedRange > aHilightedRanges; Sequence< Reference< chart2::data::XLabeledDataSequence > > aLSeqSeq( xSource->getDataSequences()); for( sal_Int32 i=0; i<aLSeqSeq.getLength(); ++i ) |