diff options
author | Ingrid Halama <iha@openoffice.org> | 2010-05-10 18:52:14 +0200 |
---|---|---|
committer | Ingrid Halama <iha@openoffice.org> | 2010-05-10 18:52:14 +0200 |
commit | 017f1bc3f7b1810f2cbf1ba5971184920be87cf8 (patch) | |
tree | 411e6dee78ee482df88a494ae452b45ce3fe5d79 /chart2 | |
parent | e0a1128c4b13e2f32a76e0b5f55839b705798da0 (diff) |
chartpositioning: #i100778# for exploded pie charts use the offset of the series as radius for excluding positioning
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/charttypes/PieChart.cxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx index 93f9440d2317..eee13848b11b 100644 --- a/chart2/source/view/charttypes/PieChart.cxx +++ b/chart2/source/view/charttypes/PieChart.cxx @@ -280,18 +280,21 @@ double PieChart::getMaxOffset() if(fExplodePercentage>m_fMaxOffset) m_fMaxOffset=fExplodePercentage; - uno::Sequence< sal_Int32 > aAttributedDataPointIndexList; - if( xSeriesProp->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= aAttributedDataPointIndexList ) + if(!m_bSizeExcludesLabelsAndExplodedSegments) { - for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;) + uno::Sequence< sal_Int32 > aAttributedDataPointIndexList; + if( xSeriesProp->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= aAttributedDataPointIndexList ) { - uno::Reference< beans::XPropertySet > xPointProp( pSeries->getPropertiesOfPoint(aAttributedDataPointIndexList[nN]) ); - if(xPointProp.is()) + for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;) { - fExplodePercentage=0.0; - xPointProp->getPropertyValue( C2U( "Offset" )) >>= fExplodePercentage; - if(fExplodePercentage>m_fMaxOffset) - m_fMaxOffset=fExplodePercentage; + uno::Reference< beans::XPropertySet > xPointProp( pSeries->getPropertiesOfPoint(aAttributedDataPointIndexList[nN]) ); + if(xPointProp.is()) + { + fExplodePercentage=0.0; + xPointProp->getPropertyValue( C2U( "Offset" )) >>= fExplodePercentage; + if(fExplodePercentage>m_fMaxOffset) + m_fMaxOffset=fExplodePercentage; + } } } } @@ -299,7 +302,7 @@ double PieChart::getMaxOffset() } double PieChart::getMaximumX() { - double fMaxOffset = m_bSizeExcludesLabelsAndExplodedSegments ? 0.0 : getMaxOffset(); + double fMaxOffset = getMaxOffset(); if( m_aZSlots.size()>0 && m_bUseRings) return m_aZSlots[0].size()+0.5+fMaxOffset; return 1.5+fMaxOffset; @@ -403,7 +406,7 @@ void PieChart::createShapes() for( nPointIndex = 0; nPointIndex < nPointCount; nPointIndex++ ) { double fLogicInnerRadius, fLogicOuterRadius; - double fOffset = m_bSizeExcludesLabelsAndExplodedSegments ? 0.0 : getMaxOffset(); + double fOffset = getMaxOffset(); bool bIsVisible = m_pPosHelper->getInnerAndOuterRadius( fSlotX+1.0, fLogicInnerRadius, fLogicOuterRadius, m_bUseRings, fOffset ); if( !bIsVisible ) continue; |