diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx index 4d89769118d6..63e961855cbe 100644 --- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: SeriesOptionsItemConverter.cxx,v $ - * $Revision: 1.6 $ + * $Revision: 1.7 $ * * This file is part of OpenOffice.org. * @@ -43,11 +43,19 @@ #include "DiagramHelper.hxx" #include "ChartTypeHelper.hxx" #include "DataSeriesHelper.hxx" + +#include #include // for SfxBoolItem #include #include + +//SfxIntegerListItem +#include +#define _SVSTDARR_ULONGS +#include + #include #include #include @@ -83,6 +91,8 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( , m_bSupportingStartingAngle(false) , m_nStartingAngle(90) , m_bClockwise(false) + , m_aSupportedMissingValueTreatments() + , m_nMissingValueTreatment(0) { try { @@ -145,6 +155,10 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( { xDiagramProperties->getPropertyValue( C2U( "StartingAngle" ) ) >>= m_nStartingAngle; } + + m_aSupportedMissingValueTreatments = ChartTypeHelper::getSupportedMissingValueTreatments( xChartType ); + m_nMissingValueTreatment = DiagramHelper::getCorrectedMissingValueTreatment( + ChartModelHelper::findDiagram(m_xChartModel), xChartType ); } catch( uno::Exception ex ) { @@ -302,6 +316,31 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte } } break; + + case SCHATTR_MISSING_VALUE_TREATMENT: + { + if( m_aSupportedMissingValueTreatments.getLength() ) + { + sal_Int32 nNew = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue(); + if( m_nMissingValueTreatment != nNew ) + { + try + { + uno::Reference< beans::XPropertySet > xDiagramProperties( ChartModelHelper::findDiagram(m_xChartModel), uno::UNO_QUERY ); + if( xDiagramProperties.is() ) + { + xDiagramProperties->setPropertyValue( C2U( "MissingValueTreatment" ), uno::makeAny( nNew )); + bChanged = true; + } + } + catch( uno::Exception& e ) + { + ASSERT_EXCEPTION( e ); + } + } + } + } + break; } return bChanged; } @@ -359,6 +398,20 @@ void SeriesOptionsItemConverter::FillSpecialItem( rOutItemSet.Put( SfxBoolItem(nWhichId,m_bClockwise) ); break; } + case SCHATTR_MISSING_VALUE_TREATMENT: + { + if( m_aSupportedMissingValueTreatments.getLength() ) + rOutItemSet.Put( SfxInt32Item( nWhichId, m_nMissingValueTreatment )); + break; + } + case SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS: + { + SvULongs aList; + for ( sal_Int32 nN=0; nN(nN) ); + rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) ); + break; + } default: break; }