diff options
Diffstat (limited to 'chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx')
-rw-r--r-- | chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx index de4fe9f2d745..f30bb4aeda57 100644 --- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx @@ -93,6 +93,8 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( , m_bClockwise(false) , m_aSupportedMissingValueTreatments() , m_nMissingValueTreatment(0) + , m_bSupportingPlottingOfHiddenCells(false) + , m_bIncludeHiddenCells(true) { try { @@ -159,6 +161,23 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( m_aSupportedMissingValueTreatments = ChartTypeHelper::getSupportedMissingValueTreatments( xChartType ); m_nMissingValueTreatment = DiagramHelper::getCorrectedMissingValueTreatment( ChartModelHelper::findDiagram(m_xChartModel), xChartType ); + + uno::Reference< XChartDocument > xChartDoc( m_xChartModel, uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xProp( xChartDoc->getDataProvider(), uno::UNO_QUERY ); + if( xProp.is() ) + { + try + { + //test whether the data provider offers this property + xProp->getPropertyValue(C2U("IncludeHiddenCells")); + //if not exception is thrown the property is offered + m_bSupportingPlottingOfHiddenCells = true; + xDiagramProperties->getPropertyValue( C2U("IncludeHiddenCells") ) >>= m_bIncludeHiddenCells; + } + catch( const beans::UnknownPropertyException& ) + { + } + } } catch( uno::Exception ex ) { @@ -341,6 +360,16 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte } } break; + case SCHATTR_INCLUDE_HIDDEN_CELLS: + { + if( m_bSupportingPlottingOfHiddenCells ) + { + bool bIncludeHiddenCells = static_cast<const SfxBoolItem &>(rItemSet.Get(nWhichId)).GetValue(); + if (bIncludeHiddenCells != m_bIncludeHiddenCells) + bChanged = ChartModelHelper::setIncludeHiddenCells( bIncludeHiddenCells, m_xChartModel ); + } + } + break; } return bChanged; } @@ -412,6 +441,12 @@ void SeriesOptionsItemConverter::FillSpecialItem( rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) ); break; } + case SCHATTR_INCLUDE_HIDDEN_CELLS: + { + if( m_bSupportingPlottingOfHiddenCells ) + rOutItemSet.Put( SfxBoolItem(nWhichId, m_bIncludeHiddenCells) ); + break; + } default: break; } |