diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-10-22 15:52:03 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-10-22 15:52:03 +0000 |
commit | cdd8abc8f92525a1d8bbdf14b322c7f9197dec14 (patch) | |
tree | 363ec4b989e9dd9004f9aba5051121fe4eb396c9 /chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx | |
parent | 677b4b4bbc5e86801e4888dd6d737c525d33271a (diff) |
INTEGRATION: CWS chart14 (1.3.12); FILE MERGED
2007/10/11 09:24:29 iha 1.3.12.3: #i26795# display bars on different axes next to each other - overlap&gapwidth
2007/09/05 18:06:50 bm 1.3.12.2: #i26795# warnings removed
2007/08/31 14:17:35 bm 1.3.12.1: #i26795# implement feature: display bars on different axes side-by-side
Diffstat (limited to 'chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx')
-rw-r--r-- | chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx | 59 |
1 files changed, 54 insertions, 5 deletions
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx index 19a3560b769b..98546b8df961 100644 --- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx @@ -4,9 +4,9 @@ * * $RCSfile: SeriesOptionsItemConverter.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: rt $ $Date: 2007-07-25 08:41:51 $ + * last change: $Author: vg $ $Date: 2007-10-22 16:52:03 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -90,6 +90,10 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( , m_nBarOverlap(0) , m_nGapWidth(100) , m_bConnectBars(false) + , m_bSupportingAxisSideBySide(false) + , m_bGroupBarsPerAxis(true) + , m_bAllSeriesAttachedToSameAxis(true) + , m_nAllSeriesAxisIndex(-1) { try { @@ -131,6 +135,13 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( { xDiagramProperties->getPropertyValue( C2U("ConnectBars")) >>= m_bConnectBars; } + + m_bSupportingAxisSideBySide = ChartTypeHelper::isSupportingAxisSideBySide( xChartType, nDimensionCount ); + if( m_bSupportingAxisSideBySide && xDiagramProperties.is() ) + { + xDiagramProperties->getPropertyValue( C2U("GroupBarsPerAxis")) >>= m_bGroupBarsPerAxis; + m_bAllSeriesAttachedToSameAxis = ChartTypeHelper::allSeriesAttachedToSameAxis( xChartType, m_nAllSeriesAxisIndex ); + } } catch( uno::Exception ex ) { @@ -199,11 +210,17 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte { if( xChartTypeProps->getPropertyValue( aPropName ) >>= m_aBarPositionSequence ) { - if( nAxisIndex >= 0 && nAxisIndex < m_aBarPositionSequence.getLength() ) + bool bGroupBarsPerAxis = static_cast< const SfxBoolItem & >(rItemSet.Get( SCHATTR_GROUP_BARS_PER_AXIS )).GetValue(); + if(!bGroupBarsPerAxis) { - m_aBarPositionSequence[nAxisIndex] = rBarPosition; - xChartTypeProps->setPropertyValue( aPropName, uno::makeAny(m_aBarPositionSequence) ); + //set the same value for all axes + for( sal_Int32 nN = 0; nN < m_aBarPositionSequence.getLength(); nN++ ) + m_aBarPositionSequence[nN] = rBarPosition; } + else if( nAxisIndex >= 0 && nAxisIndex < m_aBarPositionSequence.getLength() ) + m_aBarPositionSequence[nAxisIndex] = rBarPosition; + + xChartTypeProps->setPropertyValue( aPropName, uno::makeAny(m_aBarPositionSequence) ); } } } @@ -228,6 +245,24 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte } } break; + + case SCHATTR_GROUP_BARS_PER_AXIS: + { + bool bOldGroupBarsPerAxis = true; + m_bGroupBarsPerAxis = static_cast< const SfxBoolItem & >( + rItemSet.Get( nWhichId )).GetValue(); + if( m_bSupportingAxisSideBySide ) + { + uno::Reference< beans::XPropertySet > xDiagramProperties( ChartModelHelper::findDiagram(m_xChartModel), uno::UNO_QUERY ); + if( xDiagramProperties.is() && + (xDiagramProperties->getPropertyValue( C2U("GroupBarsPerAxis")) >>= bOldGroupBarsPerAxis) && + bOldGroupBarsPerAxis != m_bGroupBarsPerAxis ) + { + xDiagramProperties->setPropertyValue( C2U("GroupBarsPerAxis"), uno::makeAny(m_bGroupBarsPerAxis) ); + } + } + } + break; } return bChanged; } @@ -262,6 +297,20 @@ void SeriesOptionsItemConverter::FillSpecialItem( rOutItemSet.Put( SfxBoolItem(nWhichId,m_bConnectBars)); break; } + case SCHATTR_GROUP_BARS_PER_AXIS: + { + if( m_bSupportingAxisSideBySide ) + rOutItemSet.Put( SfxBoolItem(nWhichId,m_bGroupBarsPerAxis) ); + break; + } + case SCHATTR_AXIS_FOR_ALL_SERIES: + { + if( m_nAllSeriesAxisIndex != - 1) + rOutItemSet.Put( SfxInt32Item(nWhichId, m_nAllSeriesAxisIndex)); + break; + } + default: + break; } } |